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';
|
require_once __DIR__ . '/helpers.php';
|
||||||
|
|
||||||
// تحديد مسار الـ .env بشكل ديناميكي
|
// تحديد مسار الـ .env بشكل ديناميكي
|
||||||
$homeDir = realpath(__DIR__ . '/../../../');
|
if (preg_match('#^(/home/[^/]+)#', __DIR__, $matches)) {
|
||||||
if (!$homeDir || !is_dir($homeDir)) {
|
$homeDir = $matches[1];
|
||||||
// Fallback if realpath fails
|
} else {
|
||||||
$siteUser = get_current_user();
|
$homeDir = dirname($_SERVER['DOCUMENT_ROOT'] ?? __DIR__);
|
||||||
$homeDir = "/home/$siteUser";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$envFile = getenv('ENV_FILE_PATH') ?: ($homeDir . '/.env');
|
$envFile = getenv('ENV_FILE_PATH') ?: ($homeDir . '/.env');
|
||||||
|
|||||||
Reference in New Issue
Block a user