Update: 2026-07-05 18:08:08

This commit is contained in:
Hamza-Ayed
2026-07-05 18:08:08 +03:00
parent c96f457d2d
commit 5d79b67789
+10 -1
View File
@@ -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);