size() public static method

public static size ( $file, $rewrite = true )
Esempio n. 1
0
 /**
  * Set file size
  *
  * @return  mixed
  */
 public function setSize($size = NULL)
 {
     if (intval($size) > 0) {
         $this->set('size', $size);
     }
     if ($this->get('size')) {
         // Already set
         return $this->get('size');
     }
     // Get size for local
     if ($this->exists()) {
         $this->set('size', Filesystem::size($this->get('fullPath')));
     }
     // Formatted size
     if ($this->get('size')) {
         $this->set('formattedSize', \Hubzero\Utility\Number::formatBytes($this->get('size')));
     }
     return $this->get('size');
 }