pupupu

simple static CMS for crappy servers
git clone https://git.ce9e.org/pupupu.git

commit
ae48013307b4ab2f8ee02104eca045ca94730513
parent
4c609f7d24b2e7f885425fd3805b4728605fa45a
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2018-10-14 15:20
rename uploads to files

Diffstat

M index.php 8 ++++----

1 files changed, 4 insertions, 4 deletions


diff --git a/index.php b/index.php

@@ -163,7 +163,7 @@ class Pupupu
  163   163 
  164   164     public function upload($file)
  165   165     {
  166    -1         $p = $this->targetDir . '/uploads/' . $file['name'];
   -1   166         $p = $this->targetDir . '/files/' . $file['name'];
  167   167         mkdirp(dirname($p));
  168   168         move_uploaded_file($file['tmp_name'], $p);
  169   169     }
@@ -171,10 +171,10 @@ class Pupupu
  171   171     public function getUploads()
  172   172     {
  173   173         $uploads = array();
  174    -1         $p = $this->targetDir . '/uploads';
   -1   174         $p = $this->targetDir . '/files';
  175   175         foreach (scandir($p) as $name) {
  176   176             if (is_file("$p/$name")) {
  177    -1                 $uploads[$name] = "/uploads/$name";
   -1   177                 $uploads[$name] = "/files/$name";
  178   178             }
  179   179         }
  180   180         return $uploads;
@@ -182,7 +182,7 @@ class Pupupu
  182   182 
  183   183     public function rmUpload($name)
  184   184     {
  185    -1         unlink($this->targetDir . '/uploads/' . $name);
   -1   185         unlink($this->targetDir . '/files/' . $name);
  186   186     }
  187   187 
  188   188     public function render($path, $verbose=false)