Backup #2206
| ID | 2206 |
| Dateipfad | /var/www/dev.campus.systemische-tools.de/src/Controller/CrawlerController.php |
| Version | 1 |
| Typ |
modified |
| Größe | 1.7 KB |
| Hash | 240544360fe1af2ab5096c21c36636a7fe84b818a09e5af0f5b8ed579439e7c7 |
| Datum | 2026-04-21 03:17:09 |
| Geändert von | claude-code-hook |
| Grund | Claude Code Pre-Hook Backup vor Edit-Operation |
| Datei existiert |
Ja
|
Dateiinhalt
<?php
declare(strict_types=1);
namespace Controller;
// @responsibility: HTTP-Endpunkte fuer Crawl-Uebersicht
use Framework\Controller;
use Infrastructure\Crawler\CrawlerCrawlRepository;
use Infrastructure\Crawler\CrawlerErrorRepository;
use Infrastructure\Crawler\CrawlerPageRepository;
use Infrastructure\Crawler\CrawlerStatsRepository;
class CrawlerController extends Controller
{
public function __construct(
private readonly CrawlerCrawlRepository $crawls,
private readonly CrawlerPageRepository $pages,
private readonly CrawlerStatsRepository $stats,
private readonly CrawlerErrorRepository $errorsRepo,
) {
}
public function index(): void
{
$this->view('crawler.index', [
'title' => 'Crawler',
'crawls' => $this->crawls->listRecent(50),
]);
}
public function show(int $id): void
{
$crawl = $this->crawls->find($id);
if ($crawl === null) {
$this->notFound('Crawl nicht gefunden');
return;
}
$this->view('crawler.show', [
'title' => 'Crawl #' . $id,
'crawl' => $crawl,
'pages' => $this->pages->listByCrawl($id, 200, 0),
'stats' => $this->stats->forCrawl($id),
]);
}
public function errors(int $id): void
{
$crawl = $this->crawls->find($id);
if ($crawl === null) {
$this->notFound('Crawl nicht gefunden');
return;
}
$this->view('crawler.errors', [
'title' => 'Fehler #' . $id,
'crawl' => $crawl,
'errors' => $this->errorsRepo->listByCrawl($id),
]);
}
}
Vollständig herunterladen
Aktionen
← Zurück zur Übersicht