From 758b3f359341f963946d6d34e8f39d2a9c1f6040 Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 20 Feb 2022 20:49:13 +0100 Subject: debuggage --- model/Article.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'model/Article.php') diff --git a/model/Article.php b/model/Article.php index e640174..ef68661 100644 --- a/model/Article.php +++ b/model/Article.php @@ -84,12 +84,12 @@ class Article // nommer les fichiers avec le timestamp pour: // - les trier par ordre chronologique // - rendre quasi impossible d'avoir deux fois le même nom (à la condition de gérer la "concurrence") - $nom_fichier = 'data/' . $this->page . '/' . $this->format . '/' . $this->time . '.' . $this->format; + $fileName = 'data/' . $this->page . '/' . $this->format . '/' . $this->time . '.' . $this->format; - $fichier = fopen($nom_fichier, 'w'); // w pour créer ou écraser - fputs($fichier, $content); - fclose($fichier); - chmod($nom_fichier, 0666); + $file = fopen($fileName, 'w'); // w pour créer ou écraser + fputs($file, $content); + fclose($file); + chmod($fileName, 0666); } // read @@ -109,8 +109,9 @@ class Article // update public function update($content) { - // 'w' crée ou écrase - $file = fopen('data/' . $this->page . '/' . $this->format . '/' . $this->fileCode . '.' . $this->format, 'w'); + $fileName = 'data/' . $this->page . '/' . $this->format . '/' . $this->fileCode . '.' . $this->format; + //var_dump($fileName); die(); + $file = fopen($fileName, 'w'); // w pour créer ou écraser fputs($file, $content); fclose($file); //chown($this->fileName, 'http'); -- cgit v1.2.3