aurweb/web/lib/confparser.inc.php
Lukas Fleischer 1af375828f Use raw scanner mode in config_get()
We do not want PHP to parse the values for us. Use raw scanner mode to
avoid issues with certain values, such as regular expressions.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-12-27 12:42:11 +01:00

20 lines
455 B
PHP

<?php
function config_get($section, $key) {
global $AUR_CONFIG;
if (!isset($AUR_CONFIG)) {
$AUR_CONFIG = parse_ini_file("../../conf/config", true, INI_SCANNER_RAW);
}
return $AUR_CONFIG[$section][$key];
}
function config_get_int($section, $key) {
return intval(config_get($section, $key));
}
function config_get_bool($section, $key) {
$val = strtolower(config_get($section, $key));
return ($val == 'yes' || $val == 'true' || $val == '1');
}