size() public method

Returns the entire size of the directory and all its contents
public size ( ) : integer
return integer
Esempio n. 1
0
 /**
  * Gets the size of the directory and all subfolders and files
  *
  * @param   string $dir The path of the directory
  * @return  mixed
  */
 public static function size($dir)
 {
     if (!file_exists($dir)) {
         return false;
     }
     // It's easier to handle this with the Folder class
     $object = new Folder($dir);
     return $object->size();
 }
Esempio n. 2
0
 /**
  * Whether free place in folder to this file size
  * @param Folder $folder
  * @param $fileSize
  * @return bool
  */
 private function hasFreeSpace(Folder $folder, $fileSize)
 {
     return $this->_config['folder_size_max'] - $folder->size() >= $fileSize;
 }