setName() 공개 메소드

public setName ( string $name )
$name string name of the file
예제 #1
0
 /**
  * {@inheritDoc}
  */
 public function createFile($key, Filesystem $filesystem)
 {
     $file = new File($key, $filesystem);
     if (!array_key_exists($key, $this->fileData)) {
         $directory = dirname($key) == '.' ? '' : dirname($key);
         $this->listDirectory($directory);
     }
     $fileData = $this->fileData[$key];
     $file->setName($fileData['name']);
     $file->setSize($fileData['size']);
     return $file;
 }
예제 #2
0
파일: Ftp.php 프로젝트: knplabs/gaufrette
 /**
  * {@inheritdoc}
  */
 public function createFile($key, Filesystem $filesystem)
 {
     $this->ensureDirectoryExists($this->directory, $this->create);
     $file = new File($key, $filesystem);
     if (!array_key_exists($key, $this->fileData)) {
         $dirname = \Gaufrette\Util\Path::dirname($key);
         $directory = $dirname == '.' ? '' : $dirname;
         $this->listDirectory($directory);
     }
     if (isset($this->fileData[$key])) {
         $fileData = $this->fileData[$key];
         $file->setName($fileData['name']);
         $file->setSize($fileData['size']);
     }
     return $file;
 }
예제 #3
0
파일: Ftp.php 프로젝트: nervo/Gaufrette
 /**
  * {@inheritDoc}
  */
 public function createFile($key, Filesystem $filesystem)
 {
     if (!$this->exists($key)) {
         throw new \RuntimeException(sprintf('The \'%s\' file does not exist.', $key));
     }
     $file = new File($key, $filesystem);
     if (!array_key_exists($key, $this->fileData)) {
         $directory = dirname($key) == '.' ? '' : dirname($key);
         $this->listDirectory($directory);
     }
     $fileData = $this->fileData[$key];
     $created = new \DateTime();
     $created->setTimestamp($fileData['time']);
     $file->setName($fileData['name']);
     $file->setCreated($created);
     $file->setSize($fileData['size']);
     return $file;
 }