aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-29 03:28:07 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-29 03:28:07 +0000
commitf03d1616f0b685bda23dfbe79d4d8cc7fd95fde5 (patch)
tree132e2f26bf8f64086adc5f75fc45a9921a1e5e4c /core/modulemanager.lua
parente7cfd639687786d0426897f4706200818c66295a (diff)
parent7271c148cef981f9263a8794ebe27634423b07bd (diff)
downloadprosody-f03d1616f0b685bda23dfbe79d4d8cc7fd95fde5.tar.gz
prosody-f03d1616f0b685bda23dfbe79d4d8cc7fd95fde5.zip
Automated merge with http://waqas.ath.cx/
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index ce34f3e6..31059512 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -1,4 +1,5 @@
+local plugin_dir = CFG_PLUGINDIR or "./plugins/";
local logger = require "util.logger";
local log = logger.init("modulemanager")
@@ -11,8 +12,8 @@ local type = type;
local tostring, print = tostring, print;
+-- We need this to let modules access the real global namespace
local _G = _G;
-local debug = debug;
module "modulemanager"
@@ -30,7 +31,7 @@ function load(host, module_name, config)
if not (host and module_name) then
return nil, "insufficient-parameters";
end
- local mod, err = loadfile("plugins/mod_"..module_name..".lua");
+ local mod, err = loadfile(plugin_dir.."mod_"..module_name..".lua");
if not mod then
log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
return nil, err;