elFinder\elFinderVolumeDriver::gettree PHP Method

gettree() protected method

Return subdirs tree
Author: Dmitry (dio) Levashov
protected gettree ( string $path, integer $deep, $exclude = '' ) : array
$path string parent dir path
$deep integer tree deep
return array
    protected function gettree($path, $deep, $exclude = '')
    {
        $dirs = array();
        !isset($this->dirsCache[$path]) && $this->cacheDir($path);
        foreach ($this->dirsCache[$path] as $p) {
            $stat = $this->stat($p);
            if ($stat && empty($stat['hidden']) && $p != $exclude && $stat['mime'] == 'directory') {
                $dirs[] = $stat;
                if ($deep > 0 && !empty($stat['dirs'])) {
                    $dirs = array_merge($dirs, $this->gettree($p, $deep - 1));
                }
            }
        }
        return $dirs;
    }