Skip to content

Commit

Permalink
fix: [settings] invalid bootstrap loading of config.json
Browse files Browse the repository at this point in the history
- it was dependent on the app_local.php file existing
  • Loading branch information
iglocska committed May 15, 2024
1 parent 8603b7d commit 6907ed2
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,18 @@
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);
}
}

Expand Down

0 comments on commit 6907ed2

Please sign in to comment.