protected function findComposerPackagesInPath($startingDirectory)
    {
        $directories = [$startingDirectory];
        while ($directories !== []) {
            $currentDirectory = array_pop($directories);
            if ($handle = opendir($currentDirectory)) {
                while (false !== ($filename = readdir($handle))) {
                    if ($filename[0] === '.') {
                        continue;
                    }
                    $pathAndFilename = $currentDirectory . $filename;
                    if (is_dir($pathAndFilename)) {
                        $potentialPackageDirectory = $pathAndFilename . '/';
                        if (is_file($potentialPackageDirectory . 'composer.json')) {
                            $composerManifest = ComposerUtility::getComposerManifest($potentialPackageDirectory);
                            // TODO: Maybe get rid of magic string "neos-package-collection" by fetching collection package types from outside.
                            if (isset($composerManifest['type']) && $composerManifest['type'] === 'neos-package-collection') {
                                $directories[] = $potentialPackageDirectory;
                                continue;
                            }
                            yield $potentialPackageDirectory;
                        } else {
                            $directories[] = $potentialPackageDirectory;
                        }
                    }
                }
                closedir($handle);
            }
        }
    }
protected function findComposerPackagesInPath($startingDirectory)
    {
        $directories = [$startingDirectory];
        while ($directories !== []) {
            $currentDirectory = array_pop($directories);
            if ($handle = opendir($currentDirectory)) {
                while (false !== ($filename = readdir($handle))) {
                    if ($filename[0] === '.') {
                        continue;
                    }
                    $pathAndFilename = $currentDirectory . $filename;
                    if (is_dir($pathAndFilename)) {
                        $potentialPackageDirectory = $pathAndFilename . '/';
                        if (is_file($potentialPackageDirectory . 'composer.json')) {
                            $composerManifest = ComposerUtility::getComposerManifest($potentialPackageDirectory);
                            // TODO: Maybe get rid of magic string "neos-package-collection" by fetching collection package types from outside.
                            if (isset($composerManifest['type']) && $composerManifest['type'] === 'neos-package-collection') {
                                $directories[] = $potentialPackageDirectory;
                                continue;
                            }
                            yield $potentialPackageDirectory;
                        } else {
                            $directories[] = $potentialPackageDirectory;
                        }
                    }
                }
                closedir($handle);
            }
        }
    }
protected function findComposerPackagesInPath ( $ startingDirectory ) { $ directories = [ $ startingDirectory ] ; while ( $ directories !== [ ] ) { $ currentDirectory = array_pop ( $ directories ) ; if ( $ handle = opendir ( $ currentDirectory ) ) { while ( false !== ( $ filename = readdir ( $ handle ) ) ) { if ( $ filename [ 0 ] === '.' ) { continue ; } $ pathAndFilename = $ currentDirectory . $ filename ; if ( is_dir ( $ pathAndFilename ) ) { $ potentialPackageDirectory = $ pathAndFilename . '/' ; if ( is_file ( $ potentialPackageDirectory . 'composer.json' ) ) { $ composerManifest = ComposerUtility :: getComposerManifest ( $ potentialPackageDirectory ) ; // TODO: Maybe get rid of magic string "neos-package-collection" by fetching collection package types from outside. if ( isset ( $ composerManifest [ 'type' ] ) && $ composerManifest [ 'type' ] === 'neos-package-collection' ) { $ directories [ ] = $ potentialPackageDirectory ; continue ; } yield $ potentialPackageDirectory ; } else { $ directories [ ] = $ potentialPackageDirectory ; } } } closedir ( $ handle ) ; } } }
Recursively traverses directories from the given starting points and returns all folder paths that contain a composer.json and
which does NOT have the key "extra.neos.is-merged-repository" set, as that indicates a composer package that joins several "real" packages together.
In case a "is-merged-repository" is found the traversal continues inside.

@param string $startingDirectory
@return \Generator
Recursively traverses directories from the given starting points and returns all folder paths that contain a composer . json and which does NOT have the key extra . neos . is - merged - repository set as that indicates a composer package that joins several real packages together . In case a is - merged - repository is found the traversal continues inside .