/** * @param string $file_name The path of the file * @param string $client_file_name * @param string $root_dir The absolute path of the root directory */ public function __construct($file_name, $client_file_name = null, $root_dir = null) { parent::__construct($file_name, $root_dir); if (!is_null($client_file_name)) { $this->setClientFilename($client_file_name); } }
/** * Check if the object exists * * @return bool `true` if it exists, `false` otherwise */ public function exists() { return parent::exists() && is_file($this->getRealPath()); }
protected function _matchDir(WebFileInfo $file) { if (is_null($this->depth) || $this->_recursion_depth <= $this->depth) { if (!empty($this->excluded_directories)) { foreach ($this->excluded_directories as $dirname) { if ($file->getBasename() == $dirname) { return false; } } } if ($this->flags & self::FIND_DIRS) { $this->iterator->append($file); } $this->_findByDirectory($file->getRealPath()); } }
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'; }