mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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>
This commit is contained in:
parent
a1890d400b
commit
1613bd2f29
1 changed files with 5 additions and 1 deletions
|
@ -4,7 +4,11 @@ function config_load() {
|
||||||
global $AUR_CONFIG;
|
global $AUR_CONFIG;
|
||||||
|
|
||||||
if (!isset($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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue