Update: 2026-06-23 17:46:32
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user