Mercurial > prosody-hg
comparison core/configmanager.lua @ 863:fee8a700e92e
Automated merge with http://luaetta.ath.cx:1234/
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 03 Mar 2009 17:18:43 +0000 |
| parents | 49298263f241 |
| children | 2c0b9e3c11c3 |
comparison
equal
deleted
inserted
replaced
| 862:b3b80ccddb0c | 863:fee8a700e92e |
|---|---|
| 7 -- | 7 -- |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| 11 local _G = _G; | 11 local _G = _G; |
| 12 local setmetatable, loadfile, pcall, rawget, rawset, io, error, dofile = | 12 local setmetatable, loadfile, pcall, rawget, rawset, io, error, dofile, type = |
| 13 setmetatable, loadfile, pcall, rawget, rawset, io, error, dofile; | 13 setmetatable, loadfile, pcall, rawget, rawset, io, error, dofile, type; |
| 14 | 14 |
| 15 module "configmanager" | 15 module "configmanager" |
| 16 | 16 |
| 17 local parsers = {}; | 17 local parsers = {}; |
| 18 | 18 |
| 115 end | 115 end |
| 116 env.host = env.Host; | 116 env.host = env.Host; |
| 117 | 117 |
| 118 function env.Component(name) | 118 function env.Component(name) |
| 119 return function (module) | 119 return function (module) |
| 120 set(name, "core", "component_module", module); | 120 if type(module) == "string" then |
| 121 -- Don't load the global modules by default | 121 set(name, "core", "component_module", module); |
| 122 set(name, "core", "modules_enable", false); | 122 -- Don't load the global modules by default |
| 123 rawset(env, "__currenthost", name); | 123 set(name, "core", "modules_enable", false); |
| 124 rawset(env, "__currenthost", name); | |
| 125 end | |
| 124 end | 126 end |
| 125 end | 127 end |
| 126 env.component = env.Component; | 128 env.component = env.Component; |
| 127 | 129 |
| 128 function env.Include(file) | 130 function env.Include(file) |
