diff options
author | Kim Alvefur <zash@zash.se> | 2014-09-18 02:22:48 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-09-18 02:22:48 +0200 |
commit | 31be1596b93612e1c848402bd21207ad06ae30e8 (patch) | |
tree | 361f642064745fd1a6601050e7573062ff65e2ad /core | |
parent | 57b543c70405092fc24f859c05c734fc8b361030 (diff) | |
parent | b19f5a09a19534973d522e7400139f040d76391b (diff) | |
download | prosody-31be1596b93612e1c848402bd21207ad06ae30e8.tar.gz prosody-31be1596b93612e1c848402bd21207ad06ae30e8.zip |
Merge 0.10->trunk
Diffstat (limited to 'core')
-rw-r--r-- | core/moduleapi.lua | 10 | ||||
-rw-r--r-- | core/modulemanager.lua | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua index 30d28418..e9609ed9 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"; @@ -19,6 +19,7 @@ local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; local error, setmetatable, type = error, setmetatable, type; local ipairs, pairs, select = ipairs, pairs, select; local tonumber, tostring = tonumber, tostring; +local require = require; local pack = table.pack or function(...) return {n=select("#",...), ...}; end -- table.pack is only in 5.2 local unpack = table.unpack or unpack; -- renamed in 5.2 @@ -386,7 +387,10 @@ function api:load_resource(path, mode) end function api:open_store(name, type) - return storagemanager.open(self.host, name or self.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 = { ["*"] = {} }; |