protected function probe($path, &$parentItem, $fullPath = '')
{
if (empty($fullPath)) {
$fullPath = $path;
}
$pathParts = explode('/', $path);
$path = $pathParts[count($pathParts) - 1];
$this->path->setPath($fullPath);
$parentItem[$path] = $this->path->getDetail();
if ($this->path->getType() === 'dir') {
// Recursively iterate the directory and find the inner contents
$handle = opendir($fullPath);
while ($content = readdir($handle)) {
if ($content == '.' || $content == '..') {
continue;
}
$this->probe($content, $parentItem[$path], $fullPath . '/' . $content);
}
}
}