Update: 2026-07-23 02:14:58

This commit is contained in:
Hamza-Ayed
2026-07-23 02:14:58 +03:00
parent 9e065e5a83
commit e5bf70fddb
5 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -82,7 +82,7 @@ function findBestDrivers($con, $lat, $lng, $carType, $endLat = null, $endLng = n
// 🔥 [Fix Hardcoded URL] كان مثبتاً على رابط الإنتاج مباشرة بخلاف كل استدعاء
// آخر لسيرفر اللوكيشن في هذا الملف (يعتمد على env)، فأي بيئة غير إنتاج كانت
// تضرب سيرفر الإنتاج الحقيقي بالخطأ.
$locationServerUrl = getenv('LOCATION_API_URL') ?: "https://location.intaleq.xyz/api_get_nearby.php";
$locationServerUrl = getenv('LOCATION_API_URL') ?: "http://nginx/loction_server/api_get_nearby.php";
$INTERNAL_KEY = function_exists('getInternalSocketKey') ? getInternalSocketKey() : '';
$postData = ['lat' => $lat, 'lng' => $lng, 'radius' => 5, 'limit' => 100];
@@ -253,7 +253,7 @@ function getDistanceBetweenPoints($lat1, $lon1, $lat2, $lon2) {
}
// --- دالة مساعدة لمخاطبة سيرفر السائقين (Location Socket) ---
function notifyDriversRideTaken($rideId, $winnerDriverId) {
$url = getenv('LOCATION_SERVER_URL') ?: 'http://location.intaleq.xyz:2021';
$url = getenv('LOCATION_SERVER_URL') ?: 'http://nginx/loction_server/driver_socket.php';
if (!isAllowedSocketUrl($url)) return;
$INTERNAL_KEY = function_exists('getInternalSocketKey') ? getInternalSocketKey() : '';
@@ -275,7 +275,7 @@ function notifyDriversRideTaken($rideId, $winnerDriverId) {
curl_close($ch);
}
function notifyDriversOnLocationServer($drivers_ids_array, $payload, $rideId = null) {
$url = getenv('LOCATION_SERVER_URL') ?: 'http://location.intaleq.xyz:2021';
$url = getenv('LOCATION_SERVER_URL') ?: 'http://nginx/loction_server/driver_socket.php';
if (!isAllowedSocketUrl($url)) return null;
$INTERNAL_KEY = function_exists('getInternalSocketKey') ? getInternalSocketKey() : '';
@@ -311,7 +311,7 @@ function notifyDriversOnLocationServer($drivers_ids_array, $payload, $rideId = n
* تخاطب السوكيت الموجود محلياً على نفس السيرفر
*/
function notifyPassengerOnRideServer($passenger_id, $payload) {
$url = getenv('RIDE_SOCKET_URL') ?: 'http://location.intaleq.xyz:3031';
$url = getenv('RIDE_SOCKET_URL') ?: 'http://nginx/loction_server/passenger_socket.php';
if (!isAllowedSocketUrl($url)) return null;
$INTERNAL_KEY = function_exists('getInternalSocketKey') ? getInternalSocketKey() : '';
@@ -82,7 +82,7 @@ try {
// 🔥 يُرسل دائماً بغض النظر عن driver_id — إذا كانت الرحلة لم تُقبل بعد
// (driver_id = 0)، لوكيشن سيرفر يستخدم ride:offered_drivers:{rideId}
// من Redis لإشعار كل السائقين الذين وصلهم عرض هذه الرحلة أصلاً.
$socketUrl = getenv('LOCATION_SERVER_URL') ?: 'http://location.intaleq.xyz:2021';
$socketUrl = getenv('LOCATION_SERVER_URL') ?: 'http://nginx/loction_server/driver_socket.php';
$internalKeyPath = getenv('INTERNAL_SOCKET_KEY_PATH') ?: '';
$internalKey = ($internalKeyPath && file_exists($internalKeyPath)) ? trim(file_get_contents($internalKeyPath)) : (getenv('INTERNAL_SOCKET_KEY') ?: '');
+1 -1
View File
@@ -30,7 +30,7 @@ require_once __DIR__ . '/streak_helper.php';
// --- Secure S2S Configuration ---
define('S2S_SHARED_KEY', getenv('S2S_SHARED_KEY') );
define('WALLET_PAYMENT_URL', 'https://walletintaleq.intaleq.xyz/v1/main/ride/payment/process_ride_payments.php');
define('WALLET_PAYMENT_URL', getenv('WALLET_PAYMENT_URL') ?: 'http://nginx/v2/main/ride/payment/process_ride_payments.php');
// ============================================================
// 1. Receive Raw Parameters (NO price from client)
+1 -1
View File
@@ -13,7 +13,7 @@ use Firebase\JWT\BeforeValidException;
function forwardLocationToPassengerSocket($passengerId, $payload) {
if (empty($passengerId)) return;
// نفترض أن سيرفر الركاب يعمل محلياً على 3031
$url = "http://127.0.0.1:3031";
$url = getenv('RIDE_SOCKET_URL') ?: "http://nginx/loction_server/passenger_socket.php";
$INTERNAL_KEY = trim(file_get_contents('/home/location/.internal_socket_key'));
$postData = [
@@ -22,7 +22,7 @@ if (empty($id) || $rideId <= 0) {
// ── 1. Try Redis via the location server's internal HTTP API ──────────────
$status = null;
$locationServerUrl = getenv('LOCATION_SERVER_URL') ?: 'http://location.intaleq.xyz:2021';
$locationServerUrl = getenv('LOCATION_SERVER_URL') ?: 'http://nginx/loction_server/driver_socket.php';
$internalKey = getInternalSocketKey();
if ($internalKey) {