mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
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:
parent
2465d7944a
commit
0d93b2c768
1 changed files with 8 additions and 5 deletions
13
install.php
13
install.php
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue