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;
}