mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
confparser: Split loading of config into own function
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
3bc4496328
commit
9ef7de0569
1 changed files with 6 additions and 1 deletions
|
@ -1,11 +1,16 @@
|
|||
<?php
|
||||
|
||||
function config_get($section, $key) {
|
||||
function config_load() {
|
||||
global $AUR_CONFIG;
|
||||
|
||||
if (!isset($AUR_CONFIG)) {
|
||||
$AUR_CONFIG = parse_ini_file("../../conf/config", true, INI_SCANNER_RAW);
|
||||
}
|
||||
}
|
||||
|
||||
function config_get($section, $key) {
|
||||
global $AUR_CONFIG;
|
||||
config_load();
|
||||
|
||||
return $AUR_CONFIG[$section][$key];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue