feat(installer): Create config.local.php on local environment (#1745)

* feat(installer): Create `config.local.php` on local environment

* Update install.php
This commit is contained in:
Roman Kelesidis 2025-01-11 13:07:13 +03:00 committed by GitHub
commit 0d93b2c768
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -305,10 +305,7 @@ if (is_file(BB_ROOT . '.env')) {
if (!empty($newValue) || $key === 'DB_PASSWORD') {
$line = "$key=$newValue";
// Configuring database connection
if (in_array($key, ['DB_HOST', 'DB_PORT', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD'])) {
$$key = $newValue;
}
$$key = $newValue;
}
}
@ -388,5 +385,11 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) {
$conn->close();
out("- Importing SQL dump completed!\n", 'success');
out("- Voila! Good luck & have fun!", 'success');
rename(__FILE__, __FILE__ . '_' . hash('xxh128', time()));
if ($APP_ENV === 'local') {
if (!is_file(BB_ROOT . 'library/config.local.php')) {
copy(BB_ROOT . 'library/config.php', BB_ROOT . 'library/config.local.php');
}
} else {
rename(__FILE__, __FILE__ . '_' . hash('xxh128', time()));
}
}