public function parents($hash)
{
if (($current = $this->dir($hash)) == false) {
return false;
}
$path = $this->decode($hash);
$tree = array();
while ($path && $path != $this->root) {
$path = $this->_dirname($path);
$stat = $this->stat($path);
if (!empty($stat['hidden']) || !$stat['read']) {
return false;
}
array_unshift($tree, $stat);
if ($path != $this->root) {
foreach ($this->gettree($path, 0) as $dir) {
if (!in_array($dir, $tree)) {
$tree[] = $dir;
}
}
}
}
return $tree ? $tree : array($current);
}