fix: [settings] invalid bootstrap loading of config.json

- it was dependent on the app_local.php file existing
dependabot/npm_and_yarn/webroot/theme/braces-3.0.3
iglocska 2024-05-15 13:15:56 +02:00
parent 8603b7da04
commit 6907ed2842
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 11 additions and 10 deletions

View File

@ -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);
}
}