From d8e32ce5e112d1441c24464003e971e010fee5ac Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sun, 14 Jun 2015 15:08:39 +0200 Subject: confparser: Add function for checking if config section exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg Signed-off-by: Lukas Fleischer --- web/lib/confparser.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'web/lib') diff --git a/web/lib/confparser.inc.php b/web/lib/confparser.inc.php index 790aa0e..db44b36 100644 --- a/web/lib/confparser.inc.php +++ b/web/lib/confparser.inc.php @@ -23,3 +23,10 @@ function config_get_bool($section, $key) { $val = strtolower(config_get($section, $key)); return ($val == 'yes' || $val == 'true' || $val == '1'); } + +function config_section_exists($key) { + global $AUR_CONFIG; + config_load(); + + return array_key_exists($key, $AUR_CONFIG); +} -- cgit v1.2.3-70-g09d2