Update: 2026-07-22 00:46:37

This commit is contained in:
Hamza-Ayed
2026-07-22 00:46:37 +03:00
parent 540e77984b
commit b613022169
2 changed files with 11 additions and 9 deletions
+7 -6
View File
@@ -26,13 +26,14 @@ if (!$lat || !$lng) {
echo json_encode(['status' => false, 'msg' => 'Invalid Coordinates']); exit;
}
try {
$redis = new Client(['scheme'=>'tcp',
'host'=>'127.0.0.1',
$redisHost = getenv('REDIS_HOST') ?: ($_ENV['REDIS_HOST'] ?? (file_exists('/.dockerenv') ? 'redis' : '127.0.0.1'));
$redis = new Client([
'scheme' => 'tcp',
'host' => $redisHost,
'password' => $PASS_REDIS,
'port'=>6379,
'database' => 0]
);
'port' => 6379,
'database' => 0
]);
$redis->connect();
// 🔥 التعديل هنا: إضافة WITHCOORD لجلب الإحداثيات من الريدز مباشرة
+3 -2
View File
@@ -101,10 +101,11 @@ function getRedis(): ?RedisClient {
}
try {
$redisHost = getenv('REDIS_HOST') ?: ($_ENV['REDIS_HOST'] ?? (file_exists('/.dockerenv') ? 'redis' : '127.0.0.1'));
$client = new RedisClient([
'scheme' => 'tcp',
'host' => '127.0.0.1',
'port' => 6379,
'host' => $redisHost,
'port' => (int)(getenv('REDIS_PORT') ?: 6379),
'password' => $redisPass,
'read_write_timeout' => 0,
]);