admin: add server log viewer; fix curl_close() PHP 8.5 deprecation in status.php

- public/admin/logs.php: new page tailing nginx error/access + PHP-FPM logs.
  Selector for log file and line count (50/100/200/500, default 100).
  Lines reversed (newest first), colour-coded by severity, numbered gutter.
  Graceful degradation when exec() unavailable or file unreadable (dev msg).

- templates/admin/head.php: 'Journaux' nav link added after 'Statut'.

- public/admin/status.php: remove curl_close() call deprecated in PHP 8.5
  (no-op since PHP 8.0); replace with unset($ch) to silence the warning
  that was leaking raw text above the page output.
This commit is contained in:
Pontoporeia
2026-03-24 15:47:08 +01:00
parent c678b75494
commit 020bfa5a33
4 changed files with 283 additions and 2 deletions

View File

@@ -50,7 +50,8 @@ function localHttpCheck(string $url): ?array {
curl_exec($ch);
$ms = (int) round((microtime(true) - $start) * 1000);
$code = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
// curl_close() is a no-op since PHP 8.0 and deprecated in PHP 8.5; omitted.
unset($ch);
return $code > 0 ? [$code, $ms] : null;
}