aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-05-30 14:01:12 +0100
committerMatthew Wild <mwild1@gmail.com>2009-05-30 14:01:12 +0100
commitcb3a7f8168f7b43816e844c0d5c3b8603a549510 (patch)
tree407b245c47f24ce6bb72637495734cbb60e03b73 /prosody
parent9ce3ead7b7e27b36e67b2694530c052b645bfd59 (diff)
downloadprosody-cb3a7f8168f7b43816e844c0d5c3b8603a549510.tar.gz
prosody-cb3a7f8168f7b43816e844c0d5c3b8603a549510.zip
prosody: New global 'prosody' object
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody23
1 files changed, 21 insertions, 2 deletions
diff --git a/prosody b/prosody
index bbc13273..60ea85b6 100755
--- a/prosody
+++ b/prosody
@@ -72,6 +72,19 @@ bare_sessions = {};
full_sessions = {};
hosts = {};
+-- Global 'prosody' object
+prosody = {};
+local prosody = prosody;
+
+prosody.bare_sessions = bare_sessions;
+prosody.full_sessions = full_sessions;
+prosody.hosts = hosts;
+
+prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR,
+ plugins = CFG_PLUGINDIR, data = CFG_DATADIR };
+
+prosody.arg = arg;
+
--- Load and initialise core modules
require "util.import"
require "core.xmlhandlers"
@@ -127,18 +140,24 @@ function prosody_reload_config()
end
-- Function to reopen logfiles
-function prosody_reopen_logfiles()
+function prosody.reopen_logfiles()
log("info", "Re-opening log files");
eventmanager.fire_event("reopen-log-files"); -- Handled by appropriate log sinks
end
+-- Temporary
+prosody_reopen_logfiles = prosody.reopen_logfiles;
+
-- Function to initiate prosody shutdown
-function prosody_shutdown(reason)
+function prosody.shutdown(reason)
log("info", "Shutting down: %s", reason or "unknown reason");
eventmanager.fire_event("server-stopping", { reason = reason });
server.setquitting(true);
end
+-- Temporary
+prosody_shutdown = prosody.shutdown;
+
-- Signal to modules that we are ready to start
eventmanager.fire_event("server-starting");