Update bootstrap and cli env loaders to support /home/scout/.env
This commit is contained in:
@@ -3,9 +3,15 @@
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
// Bootstrap Environment configurations
|
||||
if (file_exists(__DIR__ . '/../.env')) {
|
||||
$localEnv = __DIR__ . '/../.env';
|
||||
$parentEnv = __DIR__ . '/../../..';
|
||||
|
||||
if (file_exists($localEnv)) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..');
|
||||
$dotenv->load();
|
||||
} elseif (file_exists($parentEnv . '/.env')) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable($parentEnv);
|
||||
$dotenv->load();
|
||||
}
|
||||
|
||||
use App\Core\Container;
|
||||
|
||||
8
cli.php
8
cli.php
@@ -7,9 +7,15 @@ if (php_sapi_name() !== 'cli') {
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
// Bootstrap Environment configurations
|
||||
if (file_exists(__DIR__ . '/.env')) {
|
||||
$localEnv = __DIR__ . '/.env';
|
||||
$parentEnv = __DIR__ . '/../..';
|
||||
|
||||
if (file_exists($localEnv)) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||
$dotenv->load();
|
||||
} elseif (file_exists($parentEnv . '/.env')) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable($parentEnv);
|
||||
$dotenv->load();
|
||||
}
|
||||
|
||||
use App\Core\Container;
|
||||
|
||||
Reference in New Issue
Block a user