Add links to all owned packages to the dashboard
[aur.git] / web / lib / confparser.inc.php
blob789300e11fbd1706a2541de8643dac5f61d7db70
1 <?php
3 function config_load() {
4 global $AUR_CONFIG;
6 if (!isset($AUR_CONFIG)) {
7 $AUR_CONFIG = parse_ini_file("/etc/aurweb/config", true, INI_SCANNER_RAW);
11 function config_get($section, $key) {
12 global $AUR_CONFIG;
13 config_load();
15 return $AUR_CONFIG[$section][$key];
18 function config_get_int($section, $key) {
19 return intval(config_get($section, $key));
22 function config_get_bool($section, $key) {
23 $val = strtolower(config_get($section, $key));
24 return ($val == 'yes' || $val == 'true' || $val == '1');
27 function config_items($section) {
28 global $AUR_CONFIG;
29 config_load();
31 return $AUR_CONFIG[$section];
34 function config_section_exists($key) {
35 global $AUR_CONFIG;
36 config_load();
38 return array_key_exists($key, $AUR_CONFIG);