Example #1
0
 public function getMap($simpleName = false, $dirOnly = false)
 {
     $list = array();
     if (!$this->is_dir()) {
         require_once 'My/Dir/Exception.php';
         throw new My_Dir_Exception('Diretório não existente');
     }
     $pathName = !$simpleName ? $this->_path : $this->simpleName($this->_path);
     $open = opendir($this->_path);
     while (false !== ($file = readdir($open))) {
         if ($file == '..' || $file == '.') {
             continue;
         }
         if (is_dir($cFile = $this->_path . DIRECTORY_SEPARATOR . $file)) {
             $dir = new My_Dir($cFile);
             $fileName = $simpleName ? $this->simpleName($cFile) : $cFile;
             $list[$fileName] = $dir->getMap($simpleName, $dirOnly);
         } elseif (!$dirOnly && is_file($cFile)) {
             $fileName = $simpleName ? $this->simpleName($cFile) : $cFile;
             $list[$fileName] = $fileName;
         }
     }
     closedir($open);
     return count($list) ? $list : false;
 }
Example #2
0
         return false;
     }
 }
 public function chmod($mode)
 {
     if (!$this->is_file()) {
         require_once 'Painel/Dir/Exception.php';
         throw new My_Dir_Exception('Arquivo não existente');
     }