$90 GRAYBYTE WORDPRESS FILE MANAGER $31

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/php54/usr/share/pear/Symfony/Component/Finder/Iterator/

HOME
Current File : /opt/alt/php54/usr/share/pear/Symfony/Component/Finder/Iterator//RecursiveDirectoryIterator.php
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Finder\Iterator;

use Symfony\Component\Finder\Exception\AccessDeniedException;
use Symfony\Component\Finder\SplFileInfo;

/**
 * Extends the \RecursiveDirectoryIterator to support relative paths
 *
 * @author Victor Berchet <[email protected]>
 */
class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
{
    /**
     * @var boolean
     */
    private $ignoreUnreadableDirs;

    /**
     * @var Boolean
     */
    private $rewindable;

    /**
     * Constructor.
     *
     * @param string  $path
     * @param int     $flags
     * @param boolean $ignoreUnreadableDirs
     *
     * @throws \RuntimeException
     */
    public function __construct($path, $flags, $ignoreUnreadableDirs = false)
    {
        if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) {
            throw new \RuntimeException('This iterator only support returning current as fileinfo.');
        }

        parent::__construct($path, $flags);
        $this->ignoreUnreadableDirs = $ignoreUnreadableDirs;
    }

    /**
     * Return an instance of SplFileInfo with support for relative paths
     *
     * @return SplFileInfo File information
     */
    public function current()
    {
        return new SplFileInfo(parent::current()->getPathname(), $this->getSubPath(), $this->getSubPathname());
    }

    /**
     * @return \RecursiveIterator
     *
     * @throws AccessDeniedException
     */
    public function getChildren()
    {
        try {
            return parent::getChildren();
        } catch (\UnexpectedValueException $e) {
            if ($this->ignoreUnreadableDirs) {
                // If directory is unreadable and finder is set to ignore it, a fake empty content is returned.
                return new \RecursiveArrayIterator(array());
            } else {
                throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e);
            }
        }
    }

    /**
     * Do nothing for non rewindable stream
     */
    public function rewind()
    {
        if (false === $this->isRewindable()) {
            return;
        }

        // @see https://bugs.php.net/bug.php?id=49104
        parent::next();

        parent::rewind();
    }

    /**
     * Checks if the stream is rewindable.
     *
     * @return Boolean true when the stream is rewindable, false otherwise
     */
    public function isRewindable()
    {
        if (null !== $this->rewindable) {
            return $this->rewindable;
        }

        if (false !== $stream = @opendir($this->getPath())) {
            $infos = stream_get_meta_data($stream);
            closedir($stream);

            if ($infos['seekable']) {
                return $this->rewindable = true;
            }
        }

        return $this->rewindable = false;
    }
}


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.54 PM
root / root
0755
CustomFilterIterator.php
1.508 KB
18 Dec 2019 11.22 AM
root / root
0644
DateRangeFilterIterator.php
1.427 KB
18 Dec 2019 11.22 AM
root / root
0644
DepthRangeFilterIterator.php
1.235 KB
18 Dec 2019 11.22 AM
root / root
0644
ExcludeDirectoryFilterIterator.php
1.402 KB
18 Dec 2019 11.22 AM
root / root
0644
FilePathsIterator.php
2.643 KB
18 Dec 2019 11.22 AM
root / root
0644
FileTypeFilterIterator.php
1.346 KB
18 Dec 2019 11.22 AM
root / root
0644
FilecontentFilterIterator.php
1.904 KB
18 Dec 2019 11.22 AM
root / root
0644
FilenameFilterIterator.php
1.685 KB
18 Dec 2019 11.22 AM
root / root
0644
FilterIterator.php
1.405 KB
18 Dec 2019 11.22 AM
root / root
0644
MultiplePcreFilterIterator.php
1.732 KB
18 Dec 2019 11.22 AM
root / root
0644
PathFilterIterator.php
1.914 KB
18 Dec 2019 11.22 AM
root / root
0644
RecursiveDirectoryIterator.php
2.976 KB
18 Dec 2019 11.22 AM
root / root
0644
SizeRangeFilterIterator.php
1.411 KB
18 Dec 2019 11.22 AM
root / root
0644
SortableIterator.php
2.485 KB
18 Dec 2019 11.22 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF