diff options
author | Kim Alvefur <zash@zash.se> | 2014-09-17 14:48:49 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-09-17 14:48:49 +0200 |
commit | 3d4d1527111f5774ba1314e34daa986e49807a39 (patch) | |
tree | 25b2e671f9d80fb19bd32037cf716a9557de7f6c /core | |
parent | 1b3c4c26a18ee8b0ecb2097ac480040e51a27b05 (diff) | |
download | prosody-3d4d1527111f5774ba1314e34daa986e49807a39.tar.gz prosody-3d4d1527111f5774ba1314e34daa986e49807a39.zip |
core.modulemanager, core.moduleapi: Hack around dependency loop
Diffstat (limited to 'core')
-rw-r--r-- | core/moduleapi.lua | 7 | ||||
-rw-r--r-- | core/modulemanager.lua | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua index 887ba858..e5f86b37 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -7,7 +7,7 @@ -- local config = require "core.configmanager"; -local modulemanager = require "modulemanager"; -- This is necessary to avoid require loops +local modulemanager; -- This gets set from modulemanager local array = require "util.array"; local set = require "util.set"; local logger = require "util.logger"; @@ -370,4 +370,7 @@ function api:open_store(name, type) return require"core.storagemanager".open(self.host, name or self.name, type); end -return api; +return function (mm) + modulemanager = mm; + return api; +end diff --git a/core/modulemanager.lua b/core/modulemanager.lua index db4c6bd0..198e208a 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -37,7 +37,7 @@ local _G = _G; module "modulemanager" -local api = _G.require "core.moduleapi"; -- Module API container +local api = _G.require "core.moduleapi"(_M); -- Module API container -- [host] = { [module] = module_env } local modulemap = { ["*"] = {} }; |