Update: 2026-06-23 17:46:32

This commit is contained in:
Hamza-Ayed
2026-06-23 17:46:33 +03:00
parent 52c4f96976
commit 6ad7aceee1

View File

@@ -57,11 +57,10 @@ if ($vendorPath) require_once $vendorPath;
require_once __DIR__ . '/helpers.php';
// تحديد مسار الـ .env بشكل ديناميكي
$homeDir = realpath(__DIR__ . '/../../../');
if (!$homeDir || !is_dir($homeDir)) {
// Fallback if realpath fails
$siteUser = get_current_user();
$homeDir = "/home/$siteUser";
if (preg_match('#^(/home/[^/]+)#', __DIR__, $matches)) {
$homeDir = $matches[1];
} else {
$homeDir = dirname($_SERVER['DOCUMENT_ROOT'] ?? __DIR__);
}
$envFile = getenv('ENV_FILE_PATH') ?: ($homeDir . '/.env');