Comparison

core/moduleapi.lua @ 6418:ae798314347c

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 18 Sep 2014 02:22:48 +0200
parent 6168:3942630b4e35
parent 6415:010b141e91ed
child 6423:1c78f10f05d0
comparison
equal deleted inserted replaced
6410:d782cbb46c2a 6418:ae798314347c
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 local config = require "core.configmanager"; 9 local config = require "core.configmanager";
10 local modulemanager = require "modulemanager"; -- This is necessary to avoid require loops 10 local modulemanager; -- This gets set from modulemanager
11 local array = require "util.array"; 11 local array = require "util.array";
12 local set = require "util.set"; 12 local set = require "util.set";
13 local logger = require "util.logger"; 13 local logger = require "util.logger";
14 local pluginloader = require "util.pluginloader"; 14 local pluginloader = require "util.pluginloader";
15 local timer = require "util.timer"; 15 local timer = require "util.timer";
17 17
18 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; 18 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat;
19 local error, setmetatable, type = error, setmetatable, type; 19 local error, setmetatable, type = error, setmetatable, type;
20 local ipairs, pairs, select = ipairs, pairs, select; 20 local ipairs, pairs, select = ipairs, pairs, select;
21 local tonumber, tostring = tonumber, tostring; 21 local tonumber, tostring = tonumber, tostring;
22 local require = require;
22 local pack = table.pack or function(...) return {n=select("#",...), ...}; end -- table.pack is only in 5.2 23 local pack = table.pack or function(...) return {n=select("#",...), ...}; end -- table.pack is only in 5.2
23 local unpack = table.unpack or unpack; -- renamed in 5.2 24 local unpack = table.unpack or unpack; -- renamed in 5.2
24 25
25 local prosody = prosody; 26 local prosody = prosody;
26 local hosts = prosody.hosts; 27 local hosts = prosody.hosts;
384 path = resolve_relative_path(self:get_directory(), path); 385 path = resolve_relative_path(self:get_directory(), path);
385 return io.open(path, mode); 386 return io.open(path, mode);
386 end 387 end
387 388
388 function api:open_store(name, type) 389 function api:open_store(name, type)
389 return storagemanager.open(self.host, name or self.name, type); 390 return require"core.storagemanager".open(self.host, name or self.name, type);
390 end 391 end
391 392
392 return api; 393 return function (mm)
394 modulemanager = mm;
395 return api;
396 end