diff options
| author | polo <ordipolo@gmx.fr> | 2022-02-20 20:49:13 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2022-02-20 20:49:13 +0100 |
| commit | 758b3f359341f963946d6d34e8f39d2a9c1f6040 (patch) | |
| tree | 3efb7f1da4be4157615419e630eb0d6efbcb6c3d /model | |
| parent | a5ddb2af05644972de70dab3225bab0797a93934 (diff) | |
| download | melaine-758b3f359341f963946d6d34e8f39d2a9c1f6040.tar.gz melaine-758b3f359341f963946d6d34e8f39d2a9c1f6040.tar.bz2 melaine-758b3f359341f963946d6d34e8f39d2a9c1f6040.zip | |
debuggage
Diffstat (limited to 'model')
| -rw-r--r-- | model/Album.php | 2 | ||||
| -rw-r--r-- | model/Article.php | 15 | ||||
| -rw-r--r-- | model/Image.php | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/model/Album.php b/model/Album.php index e716a99..5e93d05 100644 --- a/model/Album.php +++ b/model/Album.php | |||
| @@ -175,7 +175,7 @@ class Album extends Article | |||
| 175 | fclose($fichier); | 175 | fclose($fichier); |
| 176 | chmod($nom_fichier, 0666); | 176 | chmod($nom_fichier, 0666); |
| 177 | 177 | ||
| 178 | return($Image->erreur); | 178 | //return($Image->erreur); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | // delete | 181 | // delete |
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 | |||
| 84 | // nommer les fichiers avec le timestamp pour: | 84 | // nommer les fichiers avec le timestamp pour: |
| 85 | // - les trier par ordre chronologique | 85 | // - les trier par ordre chronologique |
| 86 | // - rendre quasi impossible d'avoir deux fois le même nom (à la condition de gérer la "concurrence") | 86 | // - rendre quasi impossible d'avoir deux fois le même nom (à la condition de gérer la "concurrence") |
| 87 | $nom_fichier = 'data/' . $this->page . '/' . $this->format . '/' . $this->time . '.' . $this->format; | 87 | $fileName = 'data/' . $this->page . '/' . $this->format . '/' . $this->time . '.' . $this->format; |
| 88 | 88 | ||
| 89 | $fichier = fopen($nom_fichier, 'w'); // w pour créer ou écraser | 89 | $file = fopen($fileName, 'w'); // w pour créer ou écraser |
| 90 | fputs($fichier, $content); | 90 | fputs($file, $content); |
| 91 | fclose($fichier); | 91 | fclose($file); |
| 92 | chmod($nom_fichier, 0666); | 92 | chmod($fileName, 0666); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | // read | 95 | // read |
| @@ -109,8 +109,9 @@ class Article | |||
| 109 | // update | 109 | // update |
| 110 | public function update($content) | 110 | public function update($content) |
| 111 | { | 111 | { |
| 112 | // 'w' crée ou écrase | 112 | $fileName = 'data/' . $this->page . '/' . $this->format . '/' . $this->fileCode . '.' . $this->format; |
| 113 | $file = fopen('data/' . $this->page . '/' . $this->format . '/' . $this->fileCode . '.' . $this->format, 'w'); | 113 | //var_dump($fileName); die(); |
| 114 | $file = fopen($fileName, 'w'); // w pour créer ou écraser | ||
| 114 | fputs($file, $content); | 115 | fputs($file, $content); |
| 115 | fclose($file); | 116 | fclose($file); |
| 116 | //chown($this->fileName, 'http'); | 117 | //chown($this->fileName, 'http'); |
diff --git a/model/Image.php b/model/Image.php index 429961e..cd70d4a 100644 --- a/model/Image.php +++ b/model/Image.php | |||
| @@ -108,6 +108,8 @@ class Image | |||
| 108 | else | 108 | else |
| 109 | { | 109 | { |
| 110 | // message d'erreur | 110 | // message d'erreur |
| 111 | header('Location: index.php?page=' . $this->page . '&erreur=erreur_depandance_bibli_images'); | ||
| 112 | exit(); | ||
| 111 | } | 113 | } |
| 112 | } | 114 | } |
| 113 | } \ No newline at end of file | 115 | } \ No newline at end of file |
