KamranAhmed\Smasher\Scanner::probe PHP Method

probe() protected method

Probes the path and keeps populating the array with the results
protected probe ( $path, &$parentItem, string $fullPath = '' )
$path
$parentItem
$fullPath string
    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);
            }
        }
    }