Changeset

4067:db98915e8e30

configmanager: Added rawget().
author Waqas Hussain <waqas20@gmail.com>
date Wed, 05 Jan 2011 06:16:07 +0500
parents 4066:461812921f8f
children 4068:15c4cefb825c
files core/configmanager.lua
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/configmanager.lua	Tue Jan 04 21:38:14 2011 +0000
+++ b/core/configmanager.lua	Wed Jan 05 06:16:07 2011 +0500
@@ -47,6 +47,15 @@
 	end
 	return nil;
 end
+function _M.rawget(host, section, key)
+	local hostconfig = rawget(config, host);
+	if hostconfig then
+		local sectionconfig = rawget(hostconfig, section);
+		if sectionconfig then
+			return rawget(sectionconfig, key);
+		end
+	end
+end
 
 local function set(config, host, section, key, value)
 	if host and section and key then