コード例 #1
0
ファイル: Edit.php プロジェクト: suood/bolt
 /**
  * Test write access for uploadable fields.
  * Autocreates the desired directory if it does not exist.
  *
  * @param array $fields
  *
  * @return array
  */
 private function setCanUpload($fields)
 {
     $filesystem = $this->filesystem->getFilesystem('files');
     foreach ($fields as &$values) {
         if (isset($values['upload'])) {
             $values['canUpload'] = ($filesystem->has($values['upload']) || $filesystem->createDir($values['upload'])) && $filesystem->getVisibility($values['upload']);
         } else {
             $values['canUpload'] = true;
         }
     }
     return $fields;
 }
コード例 #2
0
 protected function createResponder($saveFiles = false)
 {
     $responder = new Responder($this->creator, $this->finder, $this->errorImage, $saveFiles ? $this->fs->getFilesystem('web') : null, $this->cache);
     return $responder;
 }
コード例 #3
0
ファイル: FinderTest.php プロジェクト: pkdevboxy/bolt-thumbs
 public function testImageNotFoundUsesDefault()
 {
     $image = $this->finder->find('herp/derp.png');
     $this->assertSame($this->fs->getFilesystem('images'), $image->getFilesystem());
     $this->assertSame('samples/sample1.jpg', $image->getPath());
 }