simplificaiton config

This commit is contained in:
2026-03-18 08:51:50 +01:00
parent 88b0dd4e77
commit ac6b80cb69
8 changed files with 135 additions and 193 deletions

View File

@@ -25,11 +25,16 @@ $CONFIG = [
'LOG_LEVEL' => 'INFO'
];
if (file_exists($MONITORING_CONF_DIR . '/monitoring.conf.php')) {
$global_conf = include $MONITORING_CONF_DIR . '/monitoring.conf.php';
if (is_array($global_conf)) {
$CONFIG = array_merge($CONFIG, $global_conf);
}
// 1. On charge la configuration GLOBALE (La vérité est ici)
$global_conf = $MONITORING_CONF_DIR . "/monitoring.local.conf.php";
if (file_exists($global_conf)) {
$CONFIG = array_replace_recursive($CONFIG, include $global_conf);
}
// 2. On charge ensuite la config spécifique au script (si besoin de surcharger)
// $specific_conf est défini par le script qui appelle la lib
if (isset($specific_conf) && file_exists($specific_conf)) {
$CONFIG = array_replace_recursive($CONFIG, include $specific_conf);
}
// Variables d'exécution