Debug-Tool ist deaktiviert.';
return;
}
$debugDir = __DIR__ . '/../../../debug';
if (!is_dir($debugDir)) {
if ($isList || $isRaw) {
http_response_code(404);
header('Content-Type: text/plain; charset=utf-8');
echo 'debug_dir_missing';
return;
}
echo '
Debug-Verzeichnis fehlt.
';
return;
}
$files = array_values(array_filter(scandir($debugDir) ?: [], function ($f) use ($debugDir) {
if ($f === '.' || $f === '..') return false;
$path = $debugDir . '/' . $f;
return is_file($path);
}));
$selected = (string)($_GET['file'] ?? '');
$content = null;
if ($selected !== '' && preg_match('/^[a-zA-Z0-9._-]+$/', $selected)) {
$path = $debugDir . '/' . $selected;
if (is_file($path)) {
$content = file_get_contents($path);
}
}
if ($isList) {
header('Content-Type: application/json; charset=utf-8');
echo json_encode($files);
return;
}
if ($isRaw) {
header('Content-Type: text/plain; charset=utf-8');
$tail = isset($_GET['tail']) ? (int)$_GET['tail'] : 0;
if ($tail > 0 && $content !== null) {
$lines = preg_split('/\\R/', $content) ?: [];
$content = implode(PHP_EOL, array_slice($lines, -$tail));
}
echo $content ?? '';
return;
}
?>
Debug
Debug Logs
Hier kannst du temporäre Log-Files aus dem debug/-Ordner ansehen.
Inhalt
Wähle eine Datei.
= e($content) ?>