コード例 #1
0
ファイル: uploader.php プロジェクト: irenehilber/kirby-base
 public function replace()
 {
     $file = $this->file;
     $upload = new Upload($file->root(), array('overwrite' => true, 'accept' => function ($upload) use($file) {
         if ($upload->mime() != $file->mime()) {
             throw new Error(l('files.replace.error.type'));
         }
     }));
     $file = $this->move($upload);
     kirby()->trigger('panel.file.replace', $file);
 }
コード例 #2
0
ファイル: uploader.php プロジェクト: robinandersen/robin
 public function replace()
 {
     $file = $this->file;
     $upload = new Upload($file->root(), array('overwrite' => true, 'accept' => function ($upload) use($file) {
         if ($upload->mime() != $file->mime()) {
             throw new Error(l('files.replace.error.type'));
         }
     }));
     $file = $this->move($upload);
     // make sure that the file is being marked as updated
     touch($file->root());
     // clean the thumbs folder
     $this->page->removeThumbs();
     kirby()->trigger('panel.file.replace', $file);
 }