Fix .env search path for server root
This commit is contained in:
@@ -8,8 +8,8 @@
|
|||||||
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
|
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
|
||||||
require_once __DIR__ . '/vendor/autoload.php';
|
require_once __DIR__ . '/vendor/autoload.php';
|
||||||
|
|
||||||
// Check inside current dir, parent dir, or grandparent dir
|
// Check inside current dir, parent dir, grandparent dir, or user root dir
|
||||||
$envPaths = [__DIR__, dirname(__DIR__), dirname(dirname(__DIR__))];
|
$envPaths = [__DIR__, dirname(__DIR__), dirname(dirname(__DIR__)), dirname(dirname(dirname(__DIR__)))];
|
||||||
foreach ($envPaths as $path) {
|
foreach ($envPaths as $path) {
|
||||||
if (file_exists($path . '/.env')) {
|
if (file_exists($path . '/.env')) {
|
||||||
$dotenv = Dotenv\Dotenv::createImmutable($path);
|
$dotenv = Dotenv\Dotenv::createImmutable($path);
|
||||||
|
|||||||
Reference in New Issue
Block a user