flags = $flags; $this->goPastDotsIfNeeded(); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/filesystemiterator.current.php ) * * Get file information of the current element. * * @return mixed The filename, file information, or $this depending * on the set flags. See the FilesystemIterator * constants. */ public function current() { $f = parent::current(); if ($this->flags & FilesystemIterator::CURRENT_AS_PATHNAME) { return $f->getPathname(); } else if ($this->flags & FilesystemIterator::CURRENT_AS_SELF) { return $this; } // FilesystemIterator::CURRENT_AS_FILEINFO == 0 return $f; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/filesystemiterator.getflags.php * ) * * Gets the handling flags, as set in FilesystemIterator::__construct() or * FilesystemIterator::setFlags(). * * @return mixed The integer value of the set flags. */ public function getFlags() { return $this->flags; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/filesystemiterator.key.php ) * * * @return mixed Returns the pathname or filename depending on the * set flags. See the FilesystemIterator constants. */ public function key() { if ($this->flags & FilesystemIterator::KEY_AS_FILENAME) { return parent::current()->getFileName(); } // FilesystemIterator::KEY_AS_PATHNAME == 0 return parent::current()->getPathName(); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/filesystemiterator.next.php ) * * Move to the next file. * * @return mixed No value is returned. */ public function next() { parent::next(); $this->goPastDotsIfNeeded(); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/filesystemiterator.rewind.php ) * * Rewinds the directory back to the start. * * @return mixed No value is returned. */ public function rewind() { parent::rewind(); $this->goPastDotsIfNeeded(); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/filesystemiterator.setflags.php * ) * * Sets handling flags. * * @flags mixed The handling flags to set. See the * FilesystemIterator constants. * * @return mixed No value is returned. */ public function setFlags(int $flags) { $this->flags = $flags; } private function goPastDotsIfNeeded() { if ($this->flags & FilesystemIterator::SKIP_DOTS) { $f = parent::current(); while ($f && $f->isDot()) { parent::next(); $f = parent::current(); } } } public function __toString() { return $this->getPathname(); } }