Changeset

5023:dcc8e789df36

mod_admin_telnet, prosody, prosodyctl, ejabberd2prosody: Don't depend on modules setting globals
author Florian Zeitz <florob@babelmonkeys.de>
date Sat, 09 Jun 2012 02:27:44 +0200
parents 5022:776a57ca0d84
children 5024:d25e1b9332cc
files plugins/mod_admin_telnet.lua prosody prosodyctl tools/ejabberd2prosody.lua util/prosodyctl.lua
diffstat 5 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Sat Jun 09 01:18:21 2012 +0200
+++ b/plugins/mod_admin_telnet.lua	Sat Jun 09 02:27:44 2012 +0200
@@ -15,6 +15,9 @@
 
 local console_listener = { default_port = 5582; default_mode = "*l"; interface = "127.0.0.1" };
 
+local hostmanager = require "core.hostmanager";
+local modulemanager = require "core.modulemanager";
+
 local iterators = require "util.iterators";
 local keys, values = iterators.keys, iterators.values;
 local jid = require "util.jid";
--- a/prosody	Sat Jun 09 01:18:21 2012 +0200
+++ b/prosody	Sat Jun 09 02:27:44 2012 +0200
@@ -128,7 +128,7 @@
 end
 
 function sanity_check()
-	for host, host_config in pairs(configmanager.getconfig()) do
+	for host, host_config in pairs(config.getconfig()) do
 		if host ~= "*"
 		and host_config.core.enabled ~= false
 		and not host_config.core.component_module then
--- a/prosodyctl	Sat Jun 09 01:18:21 2012 +0200
+++ b/prosodyctl	Sat Jun 09 02:27:44 2012 +0200
@@ -227,9 +227,9 @@
 	hosts[hostname] = make_host(hostname);
 end
 	
-require "core.modulemanager"
+local modulemanager = require "core.modulemanager"
 
-require "util.prosodyctl"
+local prosodyctl = require "util.prosodyctl"
 require "socket"
 -----------------------
 
@@ -509,7 +509,7 @@
 		return 1;
 	end
 	
-	require "util.array";
+	local array = require "util.array";
 	local keys = require "util.iterators".keys;
 	
 	print("Prosody "..(prosody.version or "(unknown version)"));
--- a/tools/ejabberd2prosody.lua	Sat Jun 09 01:18:21 2012 +0200
+++ b/tools/ejabberd2prosody.lua	Sat Jun 09 02:27:44 2012 +0200
@@ -15,7 +15,7 @@
 	package.path = package.path .. ";"..arg[0]:gsub("/ejabberd2prosody.lua$", "/?.lua");
 end
 
-require "erlparse";
+local erlparse = require "erlparse";
 
 prosody = {};
 
--- a/util/prosodyctl.lua	Sat Jun 09 01:18:21 2012 +0200
+++ b/util/prosodyctl.lua	Sat Jun 09 02:27:44 2012 +0200
@@ -273,3 +273,5 @@
 	signal.kill(pid, signal.SIGHUP);
 	return true;
 end
+
+return _M;