summaryrefslogtreecommitdiffstats
path: root/web/lib/confparser.inc.php
blob: 397791138cafbcaad7bc3c269a2ef29e1ff0b9be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?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');
}