Update: 2026-06-23 15:35:14

This commit is contained in:
Hamza-Ayed
2026-06-23 15:35:14 +03:00
parent b4d054a870
commit bea94ed617
4 changed files with 69 additions and 6 deletions

View File

@@ -4,9 +4,24 @@
require_once realpath(__DIR__ . '/../vendor/autoload.php');
require_once 'load_env.php';
$env_file = getenv('ENV_FILE_PATH') ?: (__DIR__ . '/../../../env/.env');
$siteUser = get_current_user();
$homeDir = "/home/$siteUser";
if (!is_dir($homeDir)) {
$homeDir = realpath(__DIR__ . '/../../../'); // Fallback
}
$env_file = getenv('ENV_FILE_PATH') ?: ($homeDir . '/.env');
if (!file_exists($env_file)) {
$env_file = __DIR__ . '/../.env';
}
loadEnvironment($env_file);
if (!getenv('ENCRYPTION_KEY_PATH')) {
$encKeyDefault = "$homeDir/.enckey";
putenv("ENCRYPTION_KEY_PATH=$encKeyDefault");
$_ENV['ENCRYPTION_KEY_PATH'] = $encKeyDefault;
}
// ✅ FIX C-02: استخدام getenv بدلاً من file_get_contents الثابت
$keyPath = getenv('ENCRYPTION_KEY_PATH');
$key = '';