From 17329fb607fcc47901b1c595e4c4331eedc7e5d8 Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Mon, 13 Apr 2020 16:44:56 +0300 Subject: [PATCH] .env generation fix --- bootstrap.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index 59352f4..ed41e68 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -21,9 +21,8 @@ $root = __DIR__; //Config init { - if (!getenv('SERVER_ADDRESS')) { - if ($options['docker'] || !file_exists(ROOT_DIR . '/.env')) { + if ($options['docker']) { $envSource = file_exists(ROOT_DIR . '/.env') ? ROOT_DIR . '/.env' : ROOT_DIR . '/.env.example'; $envContent = file_get_contents($envSource); $envContent = str_replace( @@ -32,6 +31,8 @@ $root = __DIR__; $envContent ); file_put_contents(ROOT_DIR . '/.env', $envContent); + } elseif (!file_exists(ROOT_DIR . '/.env')) { + copy( ROOT_DIR . '/.env.example', ROOT_DIR . '/.env'); } Dotenv\Dotenv::createImmutable(ROOT_DIR)->load();