LUAC = luac
LUAC_OPTIONS = -s
-FILES =
+FILES = ffluci/debug.lua
CFILES = ffluci/util.lua ffluci/http.lua ffluci/fs.lua \
ffluci/sys.lua ffluci/model/uci.lua ffluci/model/ipkg.lua \
function load(cbimap)
require("ffluci.fs")
require("ffluci.i18n")
+ require("ffluci.config")
- local cbidir = ffluci.fs.dirname(ffluci.util.__file__()) .. "/model/cbi/"
+ local cbidir = ffluci.config.path .. "/model/cbi/"
local func, err = loadfile(cbidir..cbimap..".lua")
if not func then
module("ffluci.config", package.seeall)
require("ffluci.model.uci")
require("ffluci.util")
+require("ffluci.debug")
+
+-- Our path (wtf Lua lacks __file__ support)
+path = ffluci.debug.path
-- Warning! This is only for fallback and compatibility purporses! --
main = {}
--- /dev/null
+module("ffluci.debug", package.seeall)
+path = require("ffluci.fs").dirname(debug.getinfo(1, 'S').source:sub(2))
\ No newline at end of file
module("ffluci.i18n", package.seeall)
-require("ffluci.fs")
-require("ffluci.util")
require("ffluci.config")
table = {}
-i18ndir = ffluci.fs.dirname(ffluci.util.__file__()) .. "/i18n/"
+i18ndir = ffluci.config.path .. "/i18n/"
-- Clears the translation table
function clear()
require("ffluci.util")
require("ffluci.template")
require("ffluci.i18n")
+require("ffluci.config")
-- Default modelpath
-modelpath = ffluci.fs.dirname(ffluci.util.__file__()) .. "/model/menu/"
+modelpath = ffluci.config.path .. "/model/menu/"
-- Menu definition extra scope
scope = {
require("ffluci.i18n")
require("ffluci.model.uci")
-viewdir = ffluci.fs.dirname(ffluci.util.__file__()) .. "/view/"
+viewdir = ffluci.config.path .. "/view/"
-- Compile modes:
end
return value
-end
-
-
--- Returns the filename of the calling script
-function __file__()
- return debug.getinfo(2, 'S').source:sub(2)
end
\ No newline at end of file