Move classes required for Lua runtime support into a new `luci-lua-runtime` package. Also replace the `luci.http` and `luci.util` classes in `luci-lib-base` with stubbed versions interacting with the ucode based runtime environment. Finally merge `luci-base-ucode` into the remainders of `luci-base`. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
18 lines
477 B
Lua
18 lines
477 B
Lua
-- Copyright 2008 Steven Barth <steven@midlink.org>
|
|
-- Licensed to the public under the Apache License 2.0.
|
|
|
|
local util = require "luci.util"
|
|
module("luci.config",
|
|
function(m)
|
|
if pcall(require, "luci.model.uci") then
|
|
local config = util.threadlocal()
|
|
setmetatable(m, {
|
|
__index = function(tbl, key)
|
|
if not config[key] then
|
|
config[key] = luci.model.uci.cursor():get_all("luci", key)
|
|
end
|
|
return config[key]
|
|
end
|
|
})
|
|
end
|
|
end)
|