# HG changeset patch # User jbe # Date 1425162521 -3600 # Node ID 827c44692141e120679691d78e0a92fa8878269c # Parent 82cc171e8510bff95e32c111dd4bb561d5e3f61c Allow setting certain global variables in autoloader diff -r 82cc171e8510 -r 827c44692141 framework/bin/mcp.lua --- a/framework/bin/mcp.lua Sat Feb 28 23:11:40 2015 +0100 +++ b/framework/bin/mcp.lua Sat Feb 28 23:28:41 2015 +0100 @@ -162,12 +162,21 @@ return false end end + if self == _ENV then + _G[key] = false -- allow writing global variable + end if merge and try_exec(merge_path .. ".lua") then elseif merge and try_dir(merge_path .. "/") then elseif try_exec(path .. ".lua") then elseif try_dir(path .. "/") then else end - return rawget(self, key) + local value = rawget(self, key) + if self == _ENV and value == false then + _G[key] = nil + return nil + else + return value + end end install_autoloader(_G, nil, "") try_exec(WEBMCP_FRAMEWORK_PATH .. "env/__init.lua")