prosody

changeset 3609
954b1159f2f3
parent 3605
b8208f5e612a
child 3705
ddbac8737c2d
equal deleted inserted replaced
3608:ae0f83feaff4 3609:954b1159f2f3
160 prosody.full_sessions = full_sessions; 160 prosody.full_sessions = full_sessions;
161 prosody.hosts = hosts; 161 prosody.hosts = hosts;
162 162
163 prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR, 163 prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR,
164 plugins = CFG_PLUGINDIR, data = CFG_DATADIR }; 164 plugins = CFG_PLUGINDIR, data = CFG_DATADIR };
165
166 local path_sep = package.config:sub(1,1);
167 local rel_path_start = ".."..path_sep;
168 function prosody.resolve_relative_path(parent_path, path)
169 if path then
170 local is_relative;
171 if path_sep == "/" and path:sub(1,1) ~= "/" then
172 is_relative = true;
173 elseif path_sep == "\\" and (path:sub(1,1) ~= "/" and path:sub(2,3) ~= ":\\") then
174 is_relative = true;
175 end
176 if is_relative then
177 return parent_path..path_sep..path;
178 end
179 end
180 return path;
181 end
182 165
183 prosody.arg = _G.arg; 166 prosody.arg = _G.arg;
184 167
185 prosody.platform = "unknown"; 168 prosody.platform = "unknown";
186 if os.getenv("WINDIR") then 169 if os.getenv("WINDIR") then
308 require "core.hostmanager" 291 require "core.hostmanager"
309 require "core.modulemanager" 292 require "core.modulemanager"
310 require "core.usermanager" 293 require "core.usermanager"
311 require "core.sessionmanager" 294 require "core.sessionmanager"
312 require "core.stanza_router" 295 require "core.stanza_router"
313 package.loaded['core.componentmanager'] = setmetatable({},{__index=function()
314 log("warn", "componentmanager is deprecated: %s", debug.traceback():match("\n[^\n]*\n[\s\t]*([^\n]*)"));
315 return function() end
316 end});
317 296
318 require "net.http" 297 require "net.http"
319 298
320 require "util.array" 299 require "util.array"
321 require "util.datetime" 300 require "util.datetime"

mercurial