summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/lib/confparser.inc.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/web/lib/confparser.inc.php b/web/lib/confparser.inc.php
index 499481df..29f17e83 100644
--- a/web/lib/confparser.inc.php
+++ b/web/lib/confparser.inc.php
@@ -8,11 +8,21 @@ function config_load() {
if (!$path) {
$path = "/etc/aurweb/config";
}
+ $defaults_path = getenv('AUR_CONFIG_DEFAULTS');
+ if (!$defaults_path) {
+ $defaults_path = path . ".defaults";
+ }
+ if (file_exists($defaults_path)) {
+ $default_config = parse_ini_file($defaults_path, true, INI_SCANNER_RAW);
+ } else {
+ $default_config = [];
+ }
if (file_exists($path)) {
- $AUR_CONFIG = parse_ini_file($path, true, INI_SCANNER_RAW);
+ $config = parse_ini_file($path, true, INI_SCANNER_RAW);
} else {
die("aurweb config file not found");
}
+ $AUR_CONFIG = array_replace_recursive($default_config, $config)
}
}