"; echo "
"; echo "URL: $url
"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIEFILE, ''); // Enable cookies // Agregar cookie de sesión si existe if (isset($_COOKIE['PHPSESSID'])) { curl_setopt($ch, CURLOPT_COOKIE, 'PHPSESSID=' . $_COOKIE['PHPSESSID']); } $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); curl_close($ch); $headers = substr($response, 0, $headerSize); $body = substr($response, $headerSize); echo "HTTP Code: $httpCode
"; echo "" . htmlspecialchars($headers) . ""; echo "
" . htmlspecialchars($body) . ""; // Intentar decodificar JSON if ($body) { $jsonData = json_decode($body, true); if ($jsonData !== null) { echo "
" . json_encode($jsonData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . ""; if (isset($jsonData['success'])) { if ($jsonData['success']) { echo "
Menús encontrados: " . count($jsonData['data']) . "
"; } } else { echo "Debug info: " . $jsonData['debug'] . "
"; } } } } else { echo "" . htmlspecialchars(implode("\n", $recentLogs)) . "";
} else {
echo "No se encontró archivo de log en: $logFile
"; } // Mostrar error log de PHP si existe $errorLogFile = dirname(__DIR__) . '/logs/error.log'; if (file_exists($errorLogFile)) { $errorLogs = file_get_contents($errorLogFile); $recentErrorLogs = array_slice(explode("\n", $errorLogs), -10); // Últimas 10 líneas echo "" . htmlspecialchars(implode("\n", $recentErrorLogs)) . "";
}
} catch (Exception $e) {
echo "Test ejecutado: " . date('Y-m-d H:i:s') . "
"; echo "