Fix when config.local.php cannot be saved

This commit is contained in:
slawkens
2025-09-09 17:49:05 +02:00
parent 3f24f961b1
commit 4eab805d26

View File

@@ -42,10 +42,9 @@ if(!$error) {
$configToSave['cache_prefix'] = 'myaac_' . generateRandomString(8, true, false, true); $configToSave['cache_prefix'] = 'myaac_' . generateRandomString(8, true, false, true);
$configToSave['database_auto_migrate'] = true; $configToSave['database_auto_migrate'] = true;
if(!$error) {
$content = ''; $content = '';
$saved = Settings::saveConfig($configToSave, BASE . 'config.local.php', $content); $saved = Settings::saveConfig($configToSave, BASE . 'config.local.php', $content);
if ($saved) { if ($saved || file_exists(BASE . 'config.local.php')) {
success($locale['step_database_config_saved']); success($locale['step_database_config_saved']);
$_SESSION['saved'] = true; $_SESSION['saved'] = true;
@@ -74,14 +73,14 @@ if(!$error) {
} }
} }
} else { } else {
$error = true;
$_SESSION['config_content'] = $content; $_SESSION['config_content'] = $content;
unset($_SESSION['saved']); unset($_SESSION['saved']);
$locale['step_database_error_file'] = str_replace('$FILE$', '<b>' . BASE . 'config.php</b>', $locale['step_database_error_file']); $locale['step_database_error_file'] = str_replace('$FILE$', '<b>' . BASE . 'config.local.php</b>', $locale['step_database_error_file']);
error($locale['step_database_error_file'] . '<br/> error($locale['step_database_error_file'] . '<br/>
<textarea cols="70" rows="10">' . $content . '</textarea>'); <textarea cols="70" rows="10">' . $content . '</textarea>');
} }
}
} }
?> ?>