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);