ImageManager::_dirs PHP Метод

_dirs() публичный Метод

Recursively travese the directories to get a list of accessable directories.
public _dirs ( string $base, string $path ) : array
$base string the full path to the current directory
$path string the relative path name
Результат array of accessiable sub-directories array('path name' => 'full directory path', ...)
    function _dirs($base, $path)
    {
        $base = Files::fixPath($base);
        $dirs = array();
        if ($this->isValidBase() == false) {
            return $dirs;
        }
        $d = @dir($base);
        while (false !== ($entry = $d->read())) {
            //If it is a directory, and it doesn't start with
            // a dot, and if is it not the thumbnail directory
            if (is_dir($base . $entry) && substr($entry, 0, 1) != '.' && $this->isThumbDir($entry) == false) {
                $relative = Files::fixPath($path . $entry);
                $fullpath = Files::fixPath($base . $entry);
                $dirs[$relative] = $fullpath;
                $dirs = array_merge($dirs, $this->_dirs($fullpath, $relative));
            }
        }
        $d->close();
        return $dirs;
    }