summaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2010-11-17 09:18:01 +0000
committerTed Trask <ttrask01@yahoo.com>2010-11-17 09:18:01 +0000
commit4f3ecab1e7390850b81f5366afb5a189c81fb1b3 (patch)
tree6f665c1b2e8fb24d969692df51e73f7b2cdc88a7 /www
parentb3a7f0d7db3f16db91e61bd03346316d0c0aaebb (diff)
downloadacf-core-4f3ecab1e7390850b81f5366afb5a189c81fb1b3.tar.bz2
acf-core-4f3ecab1e7390850b81f5366afb5a189c81fb1b3.tar.xz
Changed mvc soft_require to include the prefix to avoid controller name conflict problems.
Diffstat (limited to 'www')
-rwxr-xr-xwww/cgi-bin/mvc.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/www/cgi-bin/mvc.lua b/www/cgi-bin/mvc.lua
index 78cdc0e..41aa9db 100755
--- a/www/cgi-bin/mvc.lua
+++ b/www/cgi-bin/mvc.lua
@@ -222,8 +222,13 @@ soft_require = function (self, name )
-- 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 = p .. "/?.lua;" .. package.path
+ local t
+ if posix.dirname(name) == "." then
+ t = require(posix.basename(name))
+ else
+ t = require(posix.basename(posix.dirname(name)).."."..posix.basename(name))
+ end
package.path = PATH
return t
end