126 -- The ' = true' are needed so as not to set off __newindex when we assign the functions below |
126 -- The ' = true' are needed so as not to set off __newindex when we assign the functions below |
127 env = setmetatable({ |
127 env = setmetatable({ |
128 Host = true, host = true, VirtualHost = true, |
128 Host = true, host = true, VirtualHost = true, |
129 Component = true, component = true, |
129 Component = true, component = true, |
130 Include = true, include = true, RunScript = true }, { |
130 Include = true, include = true, RunScript = true }, { |
131 __index = function (t, k) |
131 __index = function (_, k) |
132 return rawget(_G, k); |
132 return rawget(_G, k); |
133 end, |
133 end, |
134 __newindex = function (t, k, v) |
134 __newindex = function (_, k, v) |
135 set(config, env.__currenthost or "*", k, v); |
135 set(config_table, env.__currenthost or "*", k, v); |
136 end |
136 end |
137 }); |
137 }); |
138 |
138 |
139 rawset(env, "__currenthost", "*") -- Default is global |
139 rawset(env, "__currenthost", "*") -- Default is global |
140 function env.VirtualHost(name) |
140 function env.VirtualHost(name) |