From 6282be37d87478530b24ec4dae1c5ebde1089e99 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Wed, 22 Jul 2026 04:03:37 +0300 Subject: [PATCH] Fix get.php key loading fallback --- backend/ride/location/get.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/ride/location/get.php b/backend/ride/location/get.php index 7b3de2ed..d04fabc2 100644 --- a/backend/ride/location/get.php +++ b/backend/ride/location/get.php @@ -32,8 +32,9 @@ try { // 2. طلب بيانات السائقين من سيرفر اللوكيشن (Redis API) // — يرجع cache hits لو موجودة، وإلا يرجع IDs فقط // ========================================== - $locationServerUrl = getenv('LOCATION_API_URL'); - $INTERNAL_KEY = trim(file_get_contents(getenv('INTERNAL_SOCKET_KEY_PATH'))); + $locationServerUrl = getenv('LOCATION_API_URL') ?: 'http://nginx/loction_server/api_get_nearby.php'; + $keyPath = getenv('INTERNAL_SOCKET_KEY_PATH') ?: '/keys/.internal_socket_key'; + $INTERNAL_KEY = getenv('INTERNAL_SOCKET_KEY') ?: (file_exists($keyPath) ? trim((string)@file_get_contents($keyPath)) : (file_exists('/home/location/.internal_socket_key') ? trim((string)@file_get_contents('/home/location/.internal_socket_key')) : '')); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $locationServerUrl);