Jarves\File\FileInfo::setSize PHP 메소드

setSize() 공개 메소드

public setSize ( string $size )
$size string
    public function setSize($size)
    {
        $this->size = $size;
    }

Usage Example

예제 #1
0
파일: Local.php 프로젝트: jarves/jarves
 /**
  * {@inheritDoc}
  */
 public function getFile($path)
 {
     $file = new \Jarves\File\FileInfo();
     $file->setPath($path ?: '/');
     $path = $this->getFullPath($path ?: '/');
     if (!file_exists($path)) {
         throw new FileNotFoundException(sprintf('File `%s` does not exists.', $path));
     }
     if (!is_readable($path)) {
         throw new FileNotFoundException(sprintf('File `%s` is not readable.', $path));
     }
     $file->setType(is_dir($path) ? 'dir' : 'file');
     $file->setCreatedTime(filectime($path));
     $file->setModifiedTime(filectime($path));
     $file->setSize(filesize($path));
     return $file;
 }
All Usage Examples Of Jarves\File\FileInfo::setSize