From 6907ed2842c24fe34c3fcdda29c64596ca2e97ec Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 15 May 2024 13:15:56 +0200 Subject: [PATCH] fix: [settings] invalid bootstrap loading of config.json - it was dependent on the app_local.php file existing --- config/bootstrap.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/config/bootstrap.php b/config/bootstrap.php index 3f00c0b..397659f 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -89,17 +89,18 @@ try { if (file_exists(CONFIG . 'app_local.php')) { Configure::load('app_local', 'default'); //Configure::load('cerebrate', 'default', true); - $settingsFile = new File(CONFIG . 'config.json'); - if ($settingsFile->exists()) { - $settings = file_get_contents(CONFIG . 'config.json'); - $settings = json_decode($settings, true); - foreach ($settings as $path => $setting) { - if($path == 'debug') { - Configure::write($path, (bool) $setting); - continue; - } - Configure::write($path, $setting); +} + +$settingsFile = new File(CONFIG . 'config.json'); +if ($settingsFile->exists()) { + $settings = file_get_contents(CONFIG . 'config.json'); + $settings = json_decode($settings, true); + foreach ($settings as $path => $setting) { + if ($path == 'debug') { + Configure::write($path, (bool) $setting); + continue; } + Configure::write($path, $setting); } }