aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-02-21 10:42:19 +0100
committerKim Alvefur <zash@zash.se>2015-02-21 10:42:19 +0100
commit075278ff98d8d5d8026b07b277cef08a474a6eec (patch)
tree71be0c3f872550dc6849e4cde3afd5ebfa68c1b9 /core/modulemanager.lua
parent280f602e1a22ae54b8f06fad2ffd3ff630745317 (diff)
downloadprosody-075278ff98d8d5d8026b07b277cef08a474a6eec.tar.gz
prosody-075278ff98d8d5d8026b07b277cef08a474a6eec.zip
core.*: Remove use of module() function
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua18
1 files changed, 15 insertions, 3 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index e629b005..41c9b2fe 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -13,6 +13,7 @@ local pluginloader = require "util.pluginloader";
local set = require "util.set";
local new_multitable = require "util.multitable".new;
+local api = require "core.moduleapi"; -- Module API container
local hosts = hosts;
local prosody = prosody;
@@ -35,9 +36,9 @@ local component_inheritable_modules = {"tls", "saslauth", "dialback", "iq", "s2s
-- We need this to let modules access the real global namespace
local _G = _G;
-module "modulemanager"
+local _ENV = nil;
-local api = _G.require "core.moduleapi".init(_M); -- Module API container
+local load_modules_for_host, load, unload, reload, get_module, get_items, get_modules, is_loaded, module_has_method, call_module_method;
-- [host] = { [module] = module_env }
local modulemap = { ["*"] = {} };
@@ -317,4 +318,15 @@ function call_module_method(module, method, ...)
end
end
-return _M;
+return {
+ load_modules_for_host = load_modules_for_host;
+ load = load;
+ unload = unload;
+ reload = reload;
+ get_module = get_module;
+ get_items = get_items;
+ get_modules = get_modules;
+ is_loaded = is_loaded;
+ module_has_method = module_has_method;
+ call_module_method = call_module_method;
+};