예제 #1
0
 /**
  * Retrieve information about a file
  *
  * @param string $url
  * @param int    $flags
  */
 public function url_stat($url, $flags)
 {
     try {
         $this->openFile($url);
         if ($this->file->isLink() && !($flags & STREAM_URL_STAT_LINK)) {
             return $this->file->getLinkTarget()->getStat();
         }
         return $this->file->getStat();
     } catch (Exception $e) {
         if ($flags & STREAM_URL_STAT_QUIET) {
             throw $e;
         }
         return false;
     }
 }
예제 #2
0
 /**
  * Apply bitmask filters on current file.
  *
  * @param \Filicious\File $file
  *
  * @return bool
  */
 protected function applyBitmaskFilters(File $file)
 {
     $basename = $file->getBasename();
     if (!($this->bitmask & File::LIST_HIDDEN) && $basename[0] == '.' || !($this->bitmask & File::LIST_VISIBLE) && $basename[0] != '.' || !($this->bitmask & File::LIST_FILES) && $file->isFile() || !($this->bitmask & File::LIST_DIRECTORIES) && $file->isDirectory() || !($this->bitmask & File::LIST_LINKS) && $file->isLink() || !($this->bitmask & File::LIST_OPAQUE) && !$file->isLink()) {
         return false;
     }
     return true;
 }