Update: 2026-07-05 18:08:08
This commit is contained in:
@@ -5,7 +5,16 @@ if (php_sapi_name() !== 'cli') {
|
||||
}
|
||||
|
||||
// Load .env for CLI
|
||||
$envPaths = [__DIR__ . '/../.env', __DIR__ . '/../../.env'];
|
||||
$homeDir = '';
|
||||
if (preg_match('#^(/home/[^/]+)#', __DIR__, $matches)) {
|
||||
$homeDir = $matches[1];
|
||||
}
|
||||
|
||||
$envPaths = [
|
||||
__DIR__ . '/../.env',
|
||||
__DIR__ . '/../../.env',
|
||||
$homeDir ? $homeDir . '/.env' : ''
|
||||
];
|
||||
foreach ($envPaths as $envPath) {
|
||||
if (file_exists($envPath)) {
|
||||
$lines = file($envPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
|
||||
Reference in New Issue
Block a user