fix example file path, add existion check on config init

This commit is contained in:
ghost 2023-09-13 18:52:54 +03:00
parent fdb119587e
commit 7254a4ae50

View File

@ -16,7 +16,7 @@ if (!in_array($_SERVER['PHP_ENV'], ['default', 'mirror', 'dev', 'test', 'prod'])
}
// Generate configuration file if not exists
if (!file_exists(__DIR__ . '/../../env.' . $_SERVER['PHP_ENV'] . '.php'))
if (!file_exists(__DIR__ . '/env.' . $_SERVER['PHP_ENV'] . '.php') && file_exists(__DIR__ . '/../../example/environment/env.example.php'))
{
if (copy(__DIR__ . '/../../example/environment/env.example.php', __DIR__ . '/env.' . $_SERVER['PHP_ENV'] . '.php'))
{