示例#1
0
 protected function _matchFile(WebFileInfo $file)
 {
     if ($this->flags & self::FIND_FILES) {
         if (!$this->_matchFilename($file->getBasename()) || !$this->_matchExtension($file->getExtension())) {
             return;
         }
         if ($file->isLink() && $this->flags & self::FIND_LINKS) {
             $this->iterator->append($file);
         } else {
             $this->iterator->append($file);
         }
     }
 }
示例#2
0
 public function getDocBookTypeByPath($path = null)
 {
     $_file = new WebFileInfo($path);
     if ($_file->isDir()) {
         return 'directory';
     }
     $config = $this->docbook->getRegistry()->get('file_types', array(), 'docbook');
     foreach ($config as $type => $infos) {
         $extensions = isset($infos['extensions']) ? explode(',', $infos['extensions']) : array();
         if (in_array($_file->getExtension(), $extensions)) {
             return $type;
         }
     }
     return 'default';
 }