protected function scanDirectory(string $path, string $parentDir): array
    {
        $files = [];

        $rdi = new \RecursiveDirectoryIterator(
            $path,
            \FilesystemIterator::SKIP_DOTS |
            \FilesystemIterator::KEY_AS_FILENAME |
            \FilesystemIterator::CURRENT_AS_FILEINFO
        );

        $rii = new \RecursiveIteratorIterator($rdi);

        $needle = Constants::DS.$parentDir.Constants::DS;
        $len = \strlen($needle);
        foreach ($rii as $fileInfo) {
            $path = $fileInfo->getPathname();
            $pos = \strrpos($path, $needle);
            $files[] = \substr($path, $pos + $len);
        }

        return $files;
    }
protected function scanDirectory(string $path, string $parentDir): array
    {
        $files = [];

        $rdi = new \RecursiveDirectoryIterator(
            $path,
            \FilesystemIterator::SKIP_DOTS |
            \FilesystemIterator::KEY_AS_FILENAME |
            \FilesystemIterator::CURRENT_AS_FILEINFO
        );

        $rii = new \RecursiveIteratorIterator($rdi);

        $needle = Constants::DS.$parentDir.Constants::DS;
        $len = \strlen($needle);
        foreach ($rii as $fileInfo) {
            $path = $fileInfo->getPathname();
            $pos = \strrpos($path, $needle);
            $files[] = \substr($path, $pos + $len);
        }

        return $files;
    }
protected function scanDirectory ( string $ path , string $ parentDir ) : array { $ files = [ ] ; $ rdi = new \ RecursiveDirectoryIterator ( $ path , \ FilesystemIterator :: SKIP_DOTS | \ FilesystemIterator :: KEY_AS_FILENAME | \ FilesystemIterator :: CURRENT_AS_FILEINFO ) ; $ rii = new \ RecursiveIteratorIterator ( $ rdi ) ; $ needle = Constants :: DS . $ parentDir . Constants :: DS ; $ len = \ strlen ( $ needle ) ; foreach ( $ rii as $ fileInfo ) { $ path = $ fileInfo -> getPathname ( ) ; $ pos = \ strrpos ( $ path , $ needle ) ; $ files [ ] = \ substr ( $ path , $ pos + $ len ) ; } return $ files ; }
Scans the given directory and its sub-directories returning a list of all the relative path to each
file from the given marker.
@param string $path
@param string $rootMarker
@return array
Scans the given directory and its sub - directories returning a list of all the relative path to each file from the given marker .