SystemExplorerController.php
- Pfad:
src/Controller/SystemExplorerController.php - Namespace: Controller
- Zeilen: 234 | Größe: 7,631 Bytes
- Geändert: 2025-12-25 12:32:35 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 100
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Dependencies 10
- extends Framework\Controller
- constructor Domain\Repository\DokumentExplorerRepositoryInterface
- constructor Domain\Repository\SeiteExplorerRepositoryInterface
- constructor Domain\Repository\ChunkExplorerRepositoryInterface
- constructor Infrastructure\Docs\HybridSearchService
- use Domain\Repository\ChunkExplorerRepositoryInterface
- use Domain\Repository\DokumentExplorerRepositoryInterface
- use Domain\Repository\SeiteExplorerRepositoryInterface
- use Framework\Controller
- use Infrastructure\Docs\HybridSearchService
Klassen 1
-
SystemExplorerControllerclass Zeile 15
Funktionen 10
-
__construct()public Zeile 22 -
index()public Zeile 38 -
dokumente()public Zeile 55 -
dokumentShow()public Zeile 67 -
seiten()public Zeile 88 -
seiteShow()public Zeile 106 -
chunks()public Zeile 127 -
chunkShow()public Zeile 160 -
taxonomie()public Zeile 190 -
suche()public Zeile 204
Versionen 35
-
v35
2025-12-25 12:32 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Write-Operation -
v34
2025-12-23 07:53 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v33
2025-12-23 04:47 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v32
2025-12-23 04:46 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v31
2025-12-23 04:46 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v30
2025-12-23 04:39 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v29
2025-12-23 04:24 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v28
2025-12-22 08:40 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v27
2025-12-22 08:40 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v26
2025-12-22 08:39 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v25
2025-12-22 08:39 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v24
2025-12-22 08:37 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v23
2025-12-22 08:22 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v22
2025-12-22 08:22 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v21
2025-12-22 08:22 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v20
2025-12-22 08:20 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v19
2025-12-22 08:15 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v18
2025-12-22 08:14 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v17
2025-12-22 08:14 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v16
2025-12-22 08:14 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v15
2025-12-22 08:11 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v14
2025-12-22 08:11 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v13
2025-12-22 08:11 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v12
2025-12-22 08:06 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v11
2025-12-22 08:06 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v10
2025-12-22 08:06 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v9
2025-12-22 08:03 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v8
2025-12-22 08:03 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v7
2025-12-22 08:00 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v6
2025-12-22 01:44 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v5
2025-12-22 01:44 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v4
2025-12-22 01:44 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v3
2025-12-20 19:56 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v2
2025-12-20 17:23 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v1
2025-12-20 17:07 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
Code
<?php
declare(strict_types=1);
namespace Controller;
// @responsibility: HTTP-Endpunkte für System-Dokumentation (Chunks, Seiten, Taxonomie)
use Domain\Repository\ChunkExplorerRepositoryInterface;
use Domain\Repository\DokumentExplorerRepositoryInterface;
use Domain\Repository\SeiteExplorerRepositoryInterface;
use Framework\Controller;
use Infrastructure\Docs\HybridSearchService;
class SystemExplorerController extends Controller
{
private DokumentExplorerRepositoryInterface $dokumentRepository;
private SeiteExplorerRepositoryInterface $seiteRepository;
private ChunkExplorerRepositoryInterface $chunkRepository;
private HybridSearchService $searchService;
public function __construct(
DokumentExplorerRepositoryInterface $dokumentRepository,
SeiteExplorerRepositoryInterface $seiteRepository,
ChunkExplorerRepositoryInterface $chunkRepository,
HybridSearchService $searchService
) {
$this->dokumentRepository = $dokumentRepository;
$this->seiteRepository = $seiteRepository;
$this->chunkRepository = $chunkRepository;
$this->searchService = $searchService;
}
/**
* GET /explorer
* Dashboard mit Statistiken
*/
public function index(): void
{
$this->view('system-explorer.index', [
'title' => 'Doc2Vector Explorer',
'dokumenteCount' => $this->dokumentRepository->countDokumente(),
'seitenCount' => $this->seiteRepository->countSeiten(),
'chunkStats' => $this->chunkRepository->getChunkStats(),
'taxonomyCategories' => $this->chunkRepository->getTopTaxonomyCategories(10),
'dokumente' => $this->dokumentRepository->getDokumenteWithStats(),
'recentChunks' => $this->chunkRepository->getRecentChunks(5),
]);
}
/**
* GET /explorer/dokumente
* Liste aller Hauptbereiche (depth=0)
*/
public function dokumente(): void
{
$this->view('system-explorer.dokumente.index', [
'title' => 'Dokumente',
'dokumente' => $this->dokumentRepository->getDokumenteWithFullStats(),
]);
}
/**
* GET /explorer/dokumente/{id}
* Dokument-Details mit Seiten und Chunks
*/
public function dokumentShow(int $id): void
{
$dokument = $this->dokumentRepository->getDokumentRoot($id);
if ($dokument === null) {
$this->notFound('Dokument nicht gefunden');
}
$this->view('system-explorer.dokumente.show', [
'title' => $dokument['title'],
'dokument' => $dokument,
'seiten' => $this->seiteRepository->getSeitenWithStatsForParent($id),
'chunks' => $this->chunkRepository->getChunksForDokument($id),
'taxonomy' => $this->seiteRepository->getTaxonomyForDokumentTree($id),
]);
}
/**
* GET /explorer/seiten
* Liste aller Seiten (depth>0)
*/
public function seiten(): void
{
$search = $this->getString('search');
$parentId = $this->getString('parent');
$this->view('system-explorer.seiten.index', [
'title' => 'Seiten',
'seiten' => $this->seiteRepository->getSeitenFiltered($search, $parentId),
'dokumente' => $this->dokumentRepository->getDokumenteForFilter(),
'currentSearch' => $search,
'currentParent' => $parentId,
]);
}
/**
* GET /explorer/seiten/{id}
* Seiten-Details mit Chunks
*/
public function seiteShow(int $id): void
{
$seite = $this->seiteRepository->getSeiteWithParent($id);
if ($seite === null) {
$this->notFound('Seite nicht gefunden');
}
$this->view('system-explorer.seiten.show', [
'title' => $seite['title'],
'seite' => $seite,
'chunks' => $this->chunkRepository->getChunksDetailedForDokument($id),
'unterseiten' => $this->seiteRepository->getUnterseiten($id),
'breadcrumb' => $this->seiteRepository->buildBreadcrumb($seite),
]);
}
/**
* GET /explorer/chunks
* Liste aller Chunks mit Filtern
*/
public function chunks(): void
{
$category = $this->getString('category');
$status = $this->getString('status');
$search = $this->getString('search');
$pagination = $this->getPagination(50);
$totalCount = $this->chunkRepository->countChunksFiltered($category, $status, $search);
$pagination = $pagination->withTotal($totalCount);
$this->view('system-explorer.chunks.index', [
'title' => 'Chunks',
'chunks' => $this->chunkRepository->getChunksFilteredPaginated(
$category,
$status,
$search,
$pagination->limit,
$pagination->offset
),
'categories' => $this->chunkRepository->getDistinctCategories(),
'currentCategory' => $category,
'currentStatus' => $status,
'currentSearch' => $search,
'currentPage' => $pagination->page,
'totalCount' => $pagination->totalCount,
'totalPages' => $pagination->totalPages(),
]);
}
/**
* GET /explorer/chunks/{id}
* Chunk-Details
*/
public function chunkShow(int $id): void
{
$chunk = $this->chunkRepository->getChunk($id);
if ($chunk === null) {
$this->notFound('Chunk nicht gefunden');
}
// Nachbar-Chunks
$prevChunk = $this->chunkRepository->getChunkByDokumentAndIndex(
$chunk['dokumentation_id'],
$chunk['chunk_index'] - 1
);
$nextChunk = $this->chunkRepository->getChunkByDokumentAndIndex(
$chunk['dokumentation_id'],
$chunk['chunk_index'] + 1
);
$this->view('system-explorer.chunks.show', [
'title' => 'Chunk #' . $chunk['id'],
'chunk' => $chunk,
'prevChunk' => $prevChunk,
'nextChunk' => $nextChunk,
]);
}
/**
* GET /explorer/taxonomie
* Taxonomie-Übersicht
*/
public function taxonomie(): void
{
$this->view('system-explorer.taxonomie', [
'title' => 'Taxonomie & Entities',
'categories' => $this->chunkRepository->getCategoriesWithStats(),
'topKeywords' => $this->chunkRepository->getTopKeywords(30),
'topEntities' => $this->chunkRepository->getTopEntitiesRaw(30),
]);
}
/**
* GET /explorer/suche
* Suche-Formular
*/
public function suche(): void
{
$query = $this->getString('q');
$category = $this->getString('category');
$limit = $this->getLimit(20, 10);
$results = [];
$suggestions = [];
if ($query !== '') {
$filters = [];
if ($category !== '') {
$filters['taxonomy_category'] = $category;
}
$results = $this->searchService->search($query, $filters, $limit);
$suggestions = $this->searchService->suggestRelatedSearches($results);
}
$this->view('system-explorer.suche', [
'title' => 'Dokumentation durchsuchen',
'query' => $query,
'results' => $results,
'suggestions' => $suggestions,
'categories' => $this->chunkRepository->getDistinctCategories(),
'currentCategory' => $category,
'limit' => $limit,
]);
}
}