confparser: Add function for checking if config section exists

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Johannes Löthberg 2015-06-14 15:08:39 +02:00 committed by Lukas Fleischer
parent 9ef7de0569
commit d8e32ce5e1

View file

@ -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);
}