summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2017-02-04 23:54:54 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2017-02-08 19:18:27 +0100
commit1613bd2f2980d5da7f2d3e0a0113f126b6deb155 (patch)
treef9ec7eca3eabab7509854b25d4615d69a768119d
parenta1890d400b2eefeaf20c80701951af6b2a8ff55e (diff)
downloadaur-1613bd2f2980d5da7f2d3e0a0113f126b6deb155.tar.gz
aur-1613bd2f2980d5da7f2d3e0a0113f126b6deb155.tar.xz
confparser.inc.php: Support alternative config path
Add a AUR_CONFIG environment variable that can be used to specify an alternative configuration file, similar to the feature introduced in ecbf32f (git-interface: Add AUR_CONFIG environment variable, 2016-08-03). Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
-rw-r--r--web/lib/confparser.inc.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/lib/confparser.inc.php b/web/lib/confparser.inc.php
index 789300e1..e7128be6 100644
--- a/web/lib/confparser.inc.php
+++ b/web/lib/confparser.inc.php
@@ -4,7 +4,11 @@ function config_load() {
global $AUR_CONFIG;
if (!isset($AUR_CONFIG)) {
- $AUR_CONFIG = parse_ini_file("/etc/aurweb/config", true, INI_SCANNER_RAW);
+ $path = getenv('AUR_CONFIG');
+ if (!$path) {
+ $path = "/etc/aurweb/config";
+ }
+ $AUR_CONFIG = parse_ini_file($path, true, INI_SCANNER_RAW);
}
}