aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2012-06-09 02:27:44 +0200
committerFlorian Zeitz <florob@babelmonkeys.de>2012-06-09 02:27:44 +0200
commit8395775fc1bd1e72a8c83927003d2af1ed5f304a (patch)
treef224f9bbbd3070899a9ad981d0b4802a0fb22648
parent5937bc4c8554fbd2121b2052cf52d6a24bf40aa0 (diff)
downloadprosody-8395775fc1bd1e72a8c83927003d2af1ed5f304a.tar.gz
prosody-8395775fc1bd1e72a8c83927003d2af1ed5f304a.zip
mod_admin_telnet, prosody, prosodyctl, ejabberd2prosody: Don't depend on modules setting globals
-rw-r--r--plugins/mod_admin_telnet.lua3
-rwxr-xr-xprosody2
-rwxr-xr-xprosodyctl6
-rwxr-xr-xtools/ejabberd2prosody.lua2
-rw-r--r--util/prosodyctl.lua2
5 files changed, 10 insertions, 5 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 8787427e..cdac7d4e 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -15,6 +15,9 @@ local hosts = prosody.hosts;
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";
diff --git a/prosody b/prosody
index 6f5a14eb..b8de92f5 100755
--- a/prosody
+++ b/prosody
@@ -128,7 +128,7 @@ function log_dependency_warnings()
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
diff --git a/prosodyctl b/prosodyctl
index 45b5604a..0817db35 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -227,9 +227,9 @@ for hostname, config in pairs(config.getconfig()) do
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 @@ function commands.about(arg)
return 1;
end
- require "util.array";
+ local array = require "util.array";
local keys = require "util.iterators".keys;
print("Prosody "..(prosody.version or "(unknown version)"));
diff --git a/tools/ejabberd2prosody.lua b/tools/ejabberd2prosody.lua
index 545bd922..656f0824 100755
--- a/tools/ejabberd2prosody.lua
+++ b/tools/ejabberd2prosody.lua
@@ -15,7 +15,7 @@ if arg[0]:match("^./") then
package.path = package.path .. ";"..arg[0]:gsub("/ejabberd2prosody.lua$", "/?.lua");
end
-require "erlparse";
+local erlparse = require "erlparse";
prosody = {};
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index 439de551..a598a44a 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -273,3 +273,5 @@ function reload()
signal.kill(pid, signal.SIGHUP);
return true;
end
+
+return _M;