portmanager: Add luacheck annotations
[prosody.git] / prosody
diff --git a/prosody b/prosody
index aab803c5b8c71c16ce616a7b0ccb09ef617f4318..e6a23d8e703f6fb172f188d45a6e87a089fde333 100755 (executable)
--- a/prosody
+++ b/prosody
@@ -151,13 +151,11 @@ function sandbox_require()
        -- for neat sandboxing of modules
        local _realG = _G;
        local _real_require = require;
-       if not getfenv then
+       local getfenv = getfenv or function (f)
                -- FIXME: This is a hack to replace getfenv() in Lua 5.2
-               function getfenv(f)
-                       local name, env = debug.getupvalue(debug.getinfo(f or 1).func, 1);
-                       if name == "_ENV" then
-                               return env;
-                       end
+               local name, env = debug.getupvalue(debug.getinfo(f or 1).func, 1);
+               if name == "_ENV" then
+                       return env;
                end
        end
        function require(...)
@@ -294,6 +292,7 @@ function load_secondary_libraries()
        require "util.import"
        require "util.xmppstream"
        require "core.stanza_router"
+       require "core.statsmanager"
        require "core.hostmanager"
        require "core.portmanager"
        require "core.modulemanager"