diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-12-31 09:07:05 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-12-31 09:07:05 +0000 |
commit | be4063286a0b8f46754c082178517b3c684c3dff (patch) | |
tree | 32966a8ba376048fa34b718cd6663138aea87249 /www/cgi-bin | |
parent | bd1d77b3b8278dfab279fe31ff88eab953bdd4c0 (diff) | |
download | acf-core-be4063286a0b8f46754c082178517b3c684c3dff.tar.bz2 acf-core-be4063286a0b8f46754c082178517b3c684c3dff.tar.xz |
Allow appdir and libdir to be comma-separated lists of directories.
Diffstat (limited to 'www/cgi-bin')
-rw-r--r-- | www/cgi-bin/mvc.lua | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/www/cgi-bin/mvc.lua b/www/cgi-bin/mvc.lua index efaca5f..f176fe9 100644 --- a/www/cgi-bin/mvc.lua +++ b/www/cgi-bin/mvc.lua @@ -208,19 +208,21 @@ end -- otherwise, returns nil, but no error soft_require = function (self, name ) local filename, file - filename = self.conf.appdir .. name .. ".lua" - file = io.open(filename) - if file then - file:close() - local PATH=package.path - -- FIXME - this should really try to open the lua file, - -- and if it doesnt exist silently fail. - -- This version allows things from /usr/local/lua/5.1 to - -- be loaded - package.path = self.conf.appdir .. posix.dirname(name) .. "/?.lua;" .. package.path - local t = require(posix.basename(name)) - package.path = PATH - return t + for p in string.gmatch(self.conf.appdir, "[^,]+") do + filename = p .. name .. ".lua" + file = io.open(filename) + if file then + file:close() + local PATH=package.path + -- FIXME - this should really try to open the lua file, + -- and if it doesnt exist silently fail. + -- This version allows things from /usr/local/lua/5.1 to + -- be loaded + package.path = p .. posix.dirname(name) .. "/?.lua;" .. package.path + local t = require(posix.basename(name)) + package.path = PATH + return t + end end return nil end |