simplificaiton config
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user