Software /
code /
prosody
Comparison
prosodyctl @ 3013:518e3f6f9946
prosodyctl: Relocate global prosody object creation (see fff153f7f4de)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 05 May 2010 20:14:03 +0100 |
parent | 2706:c2dde8bda3fe |
child | 3014:169d096988e1 |
comparison
equal
deleted
inserted
replaced
3012:6d86e26f0923 | 3013:518e3f6f9946 |
---|---|
26 if CFG_DATADIR then | 26 if CFG_DATADIR then |
27 if os.getenv("HOME") then | 27 if os.getenv("HOME") then |
28 CFG_DATADIR = CFG_DATADIR:gsub("^~", os.getenv("HOME")); | 28 CFG_DATADIR = CFG_DATADIR:gsub("^~", os.getenv("HOME")); |
29 end | 29 end |
30 end | 30 end |
31 | |
32 -- Global 'prosody' object | |
33 prosody = { | |
34 hosts = {}, | |
35 events = require "util.events".new(), | |
36 platform = "posix" | |
37 }; | |
38 local prosody = prosody; | |
31 | 39 |
32 config = require "core.configmanager" | 40 config = require "core.configmanager" |
33 | 41 |
34 do | 42 do |
35 -- TODO: Check for other formats when we add support for them | 43 -- TODO: Check for other formats when we add support for them |
60 require "core.loggingmanager" | 68 require "core.loggingmanager" |
61 | 69 |
62 if not require "util.dependencies".check_dependencies() then | 70 if not require "util.dependencies".check_dependencies() then |
63 os.exit(1); | 71 os.exit(1); |
64 end | 72 end |
65 | |
66 prosody = { hosts = {}, events = events, platform = "posix" }; | |
67 | 73 |
68 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; | 74 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; |
69 require "util.datamanager".set_data_path(data_path); | 75 require "util.datamanager".set_data_path(data_path); |
70 | 76 |
71 -- Switch away from root and into the prosody user -- | 77 -- Switch away from root and into the prosody user -- |