Software / code / prosody
Comparison
main.lua @ 438:193f9dd64f17
Bumper commit for the new modulemanager API \o/ Updates all the modules, though some more changes may be in store.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 27 Nov 2008 03:12:12 +0000 |
| parent | 433:afbf29498123 |
| child | 452:613c5c6bdce4 |
comparison
equal
deleted
inserted
replaced
| 437:c1a720db2157 | 438:193f9dd64f17 |
|---|---|
| 61 require "util.jid" | 61 require "util.jid" |
| 62 | 62 |
| 63 ------------------------------------------------------------------------ | 63 ------------------------------------------------------------------------ |
| 64 | 64 |
| 65 -- Initialise modules | 65 -- Initialise modules |
| 66 local modules_enabled = config.get("*", "core", "modules_enabled"); | 66 |
| 67 if modules_enabled then | 67 for host in pairs(hosts) do |
| 68 for _, module in pairs(modules_enabled) do | 68 if host ~= "*" then |
| 69 modulemanager.load(module); | 69 local modules_enabled = config.get(host, "core", "modules_enabled"); |
| 70 if modules_enabled then | |
| 71 for _, module in pairs(modules_enabled) do | |
| 72 modulemanager.load(host, module); | |
| 73 end | |
| 74 end | |
| 70 end | 75 end |
| 71 end | 76 end |
| 72 | 77 |
| 73 -- setup error handling | 78 -- setup error handling |
| 74 setmetatable(_G, { __index = function (t, k) print("WARNING: ATTEMPT TO READ A NIL GLOBAL!!!", k); error("Attempt to read a non-existent global. Naughty boy.", 2); end, __newindex = function (t, k, v) print("ATTEMPT TO SET A GLOBAL!!!!", tostring(k).." = "..tostring(v)); error("Attempt to set a global. Naughty boy.", 2); end }) --]][][[]][]; | 79 setmetatable(_G, { __index = function (t, k) print("WARNING: ATTEMPT TO READ A NIL GLOBAL!!!", k); error("Attempt to read a non-existent global. Naughty boy.", 2); end, __newindex = function (t, k, v) print("ATTEMPT TO SET A GLOBAL!!!!", tostring(k).." = "..tostring(v)); error("Attempt to set a global. Naughty boy.", 2); end }) --]][][[]][]; |