From f4a895fa6fcaa1b101a576e15cfa4b51d04f266d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=A3=8E?= Date: Thu, 30 Aug 2012 16:42:14 +0800 Subject: [PATCH] add config --- config | 1 + lualib/config.lua | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 lualib/config.lua diff --git a/config b/config index 1a28330f..f5f5c448 100644 --- a/config +++ b/config @@ -10,3 +10,4 @@ standalone = "0.0.0.0:2012" luaservice = root.."service/?.lua;"..root.."service/?/init.lua" cpath = root.."service/?.so" protopath = root.."proto" +redis = root .. "redisconf" diff --git a/lualib/config.lua b/lualib/config.lua new file mode 100644 index 00000000..6ec7b59f --- /dev/null +++ b/lualib/config.lua @@ -0,0 +1,9 @@ +local function config(path , pre) + assert(path) + local env = pre or {} + local f = assert(loadfile(path,"t",env)) + f() + return env +end + +return config \ No newline at end of file