Update: 2026-08-01 18:37:02
This commit is contained in:
@@ -57,6 +57,11 @@ class Database
|
||||
$user = getenv($cfg['user']);
|
||||
$pass = getenv($cfg['pass']);
|
||||
|
||||
// Fallback for missing ride table if intaleq-ridesDB is still configured
|
||||
if ($name === 'ride' && $dbname === 'intaleq-ridesDB') {
|
||||
$dbname = 'rideDB';
|
||||
}
|
||||
|
||||
if (!$dbname || !$user) {
|
||||
error_log("[FATAL] Database config missing for: $name (Check ENV keys: {$cfg['name']}, {$cfg['user']})");
|
||||
throw new RuntimeException("Database configuration error.");
|
||||
|
||||
@@ -52,13 +52,19 @@ try {
|
||||
$response = curl_exec($ch);
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
error_log("[get.php] api_get_nearby HTTP $httpCode | Response: $response");
|
||||
|
||||
$redisDrivers = [];
|
||||
if ($httpCode == 200 && $response) {
|
||||
$json = json_decode($response, true);
|
||||
if (isset($json['status']) && $json['status'] === true) {
|
||||
$redisDrivers = $json['drivers'] ?? $json['data'] ?? [];
|
||||
} else {
|
||||
error_log("[get.php] api_get_nearby returned error or false status. JSON: " . print_r($json, true));
|
||||
}
|
||||
} else {
|
||||
error_log("[get.php] api_get_nearby failed. HTTP Code: $httpCode");
|
||||
}
|
||||
|
||||
if (empty($redisDrivers)) {
|
||||
|
||||
Reference in New Issue
Block a user