Compare commits

..

2 Commits

Author SHA1 Message Date
NOrtmann1 37a032aa9f Merge branch 'dev' of https://git.gigaworld.ddns.net/niklas.ortmann/webprogrammierung into dev 2026-06-10 16:15:11 +02:00
NOrtmann1 fd8e13eaa9 Update LocalArticleManager.php 2026-06-10 16:14:59 +02:00
+7 -2
View File
@@ -36,14 +36,19 @@ class LocalArticleManager implements ArticleManagerDAO {
* Speichert alle Artikel/Beiträge in der Datei. * Speichert alle Artikel/Beiträge in der Datei.
* @param $articles * @param $articles
* @return void * @return void
* TODO: Exceptions implementieren. * @throws InternalServerErrorException
*/ */
public function saveArticle($articles) private function saveArticle($articles)
{ {
try{
file_put_contents( file_put_contents(
$this->file, $this->file,
json_encode($articles, JSON_PRETTY_PRINT) json_encode($articles, JSON_PRETTY_PRINT)
); );
}catch (Exception $e){
throw new InternalServerErrorException($e->getMessage());
}
} }
public function addArticle($title, $content, $author, $category, $tags) public function addArticle($title, $content, $author, $category, $tags)