Example #1
0
 public function setPath($path)
 {
     // Update
     if ($path == '*') {
         $path = $this->_path;
     }
     $path = _realpath($path);
     if (_file_exists($path) and _is_dir($path)) {
         if (_is_readable($path)) {
             $this->_path = $path;
             $this->_tree = _scandir($this->_path);
             $this->_size = count($this->_tree);
             return $this->_path;
         } else {
             throw new Exception("Can't read dir: {$path}");
         }
     } else {
         throw new Exception("Not a dir: {$path}");
     }
 }
Example #2
0
 public function isReadable()
 {
     return _is_readable($this->_path);
 }