From fd6f1f86a5e9216469cd648601ecb9ba875f9eb6 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 14 Jan 2025 09:49:42 +0300 Subject: [PATCH] feat(installer): More explanations (#1754) --- install.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/install.php b/install.php index a637c4a30..802b90179 100644 --- a/install.php +++ b/install.php @@ -385,12 +385,22 @@ 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'); - if ($APP_ENV === 'local') { + + if (isset($APP_ENV) && $APP_ENV === 'local') { if (!is_file(BB_ROOT . 'library/config.local.php')) { - copy(BB_ROOT . 'library/config.php', BB_ROOT . 'library/config.local.php'); + if (copy(BB_ROOT . 'library/config.php', BB_ROOT . 'library/config.local.php')) { + out('- Local configuration file created!', 'success'); + } else { + out('- Cannot create library/config.local.php file. You can create it manually, just copy config.php and rename it to config.local.php', 'warning'); + } } } else { - rename(__FILE__, __FILE__ . '_' . hash('xxh128', time())); + if (rename(__FILE__, __FILE__ . '_' . hash('xxh128', time()))) { + out("- Installation file renamed!", 'success'); + } else { + out('- Cannot rename installation file (' . __FILE__ . '). Please, rename it manually for security reasons', 'warning'); + } } + + out("\n- Voila! Good luck & have fun!", 'success'); }