[aur-dev] [PATCH v4 1/5] confparser: Split loading of config into own function

Lukas Fleischer lfleischer at archlinux.org
Sun Jun 14 15:37:54 UTC 2015


From: Johannes Löthberg <johannes at kyriasis.com>

Signed-off-by: Johannes Löthberg <johannes at kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer at archlinux.org>
---
 web/lib/confparser.inc.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/web/lib/confparser.inc.php b/web/lib/confparser.inc.php
index 3977911..790aa0e 100644
--- a/web/lib/confparser.inc.php
+++ b/web/lib/confparser.inc.php
@@ -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];
 }
-- 
2.4.3


More information about the aur-dev mailing list