WIP Suche implementiert, sowie Sortieren der Ergebnisse #19

Merged
niklas.ortmann merged 54 commits from ImplementedSearch into dev 2026-06-03 16:07:42 +02:00
2 changed files with 21 additions and 21 deletions
Showing only changes of commit 0e26679f24 - Show all commits
+1 -21
View File
@@ -44,25 +44,5 @@ class ArticleManager extends LocalArticleManager
return $articleManager;
}
public function search(string $keyword): array
{
$results = [];
$contentFolder = __DIR__ . '/../content/';
$files = glob($contentFolder . "*.php");
foreach ($files as $file) {
$content = file_get_contents($file);
if (stripos($content, $keyword) !== false) {
$filename = basename($file, ".php");
$results[] = [
'title' => ucfirst($filename),
'link' => "index.php?pfad=" . $filename
];
}
}
return $results;
}
}
+20
View File
@@ -97,5 +97,25 @@ class LocalArticleManager implements ArticleManagerDAO {
return is_array($articles) ? $articles : [];
}
public function search(string $keyword): array
{
$results = [];
$contentFolder = __DIR__ . '/../content/';
$files = glob($contentFolder . "*.php");
foreach ($files as $file) {
$content = file_get_contents($file);
if (stripos($content, $keyword) !== false) {
$filename = basename($file, ".php");
$results[] = [
'title' => ucfirst($filename),
'link' => "index.php?pfad=" . $filename
];
}
}
return $results;
}
}
?>