Diff

core/moduleapi.lua @ 6779:6236668da30a

core.*: Remove use of module() function
author Kim Alvefur <zash@zash.se>
date Sat, 21 Feb 2015 10:42:19 +0100
parent 6659:0a494394cd3e
child 6791:e813e8cf6046
child 7115:805d068d2fd5
line wrap: on
line diff
--- a/core/moduleapi.lua	Sat Feb 21 10:38:44 2015 +0100
+++ b/core/moduleapi.lua	Sat Feb 21 10:42:19 2015 +0100
@@ -7,7 +7,6 @@
 --
 
 local config = require "core.configmanager";
-local modulemanager; -- This gets set from modulemanager
 local array = require "util.array";
 local set = require "util.set";
 local it = require "util.iterators";
@@ -145,6 +144,7 @@
 end
 
 function api:depends(name)
+	local modulemanager = require"core.modulemanager";
 	if not self.dependencies then
 		self.dependencies = {};
 		self:hook("module-reloaded", function (event)
@@ -326,6 +326,7 @@
 end
 
 function api:get_host_items(key)
+	local modulemanager = require"core.modulemanager";
 	local result = modulemanager.get_items(key, self.host) or {};
 	return result;
 end
@@ -417,9 +418,4 @@
 	return self:measure_object_event(prosody.events.wrappers, event_name, stat_name);
 end
 
-function api.init(mm)
-	modulemanager = mm;
-	return api;
-end
-
 return api;