public static function getPackagesData($packagesPath)
    {
        $packagesData = array();
        $packagesDirectoryIterator = new \DirectoryIterator($packagesPath);
        foreach ($packagesDirectoryIterator as $categoryFileInfo) {
            $category = $categoryFileInfo->getFilename();
            if (!$categoryFileInfo->isDir() || $category[0] === '.' || $category === 'Libraries') {
                continue;
            }

            $categoryDirectoryIterator = new \DirectoryIterator($categoryFileInfo->getPathname());
            foreach ($categoryDirectoryIterator as $packageFileInfo) {
                $packageKey = $packageFileInfo->getFilename();
                if (!$packageFileInfo->isDir() || $packageKey[0] === '.') {
                    continue;
                }

                $meta = self::readPackageMetaData(Files::concatenatePaths(array($packageFileInfo->getPathname(), 'Meta/Package.xml')));
                $composerManifest = self::readComposerManifest(Files::concatenatePaths(array($packageFileInfo->getPathname(), 'composer.json')));

                $packagesData[$packageKey] = array(
                    'packageKey' => $packageKey,
                    'category' => $category,
                    'path' => $packageFileInfo->getPathname(),
                    'meta' => $meta,
                    'composerManifest' => $composerManifest
                );
            }
        }
        return $packagesData;
    }
public static function getPackagesData($packagesPath)
    {
        $packagesData = array();
        $packagesDirectoryIterator = new \DirectoryIterator($packagesPath);
        foreach ($packagesDirectoryIterator as $categoryFileInfo) {
            $category = $categoryFileInfo->getFilename();
            if (!$categoryFileInfo->isDir() || $category[0] === '.' || $category === 'Libraries') {
                continue;
            }

            $categoryDirectoryIterator = new \DirectoryIterator($categoryFileInfo->getPathname());
            foreach ($categoryDirectoryIterator as $packageFileInfo) {
                $packageKey = $packageFileInfo->getFilename();
                if (!$packageFileInfo->isDir() || $packageKey[0] === '.') {
                    continue;
                }

                $meta = self::readPackageMetaData(Files::concatenatePaths(array($packageFileInfo->getPathname(), 'Meta/Package.xml')));
                $composerManifest = self::readComposerManifest(Files::concatenatePaths(array($packageFileInfo->getPathname(), 'composer.json')));

                $packagesData[$packageKey] = array(
                    'packageKey' => $packageKey,
                    'category' => $category,
                    'path' => $packageFileInfo->getPathname(),
                    'meta' => $meta,
                    'composerManifest' => $composerManifest
                );
            }
        }
        return $packagesData;
    }
public static function getPackagesData ( $ packagesPath ) { $ packagesData = array ( ) ; $ packagesDirectoryIterator = new \ DirectoryIterator ( $ packagesPath ) ; foreach ( $ packagesDirectoryIterator as $ categoryFileInfo ) { $ category = $ categoryFileInfo -> getFilename ( ) ; if ( ! $ categoryFileInfo -> isDir ( ) || $ category [ 0 ] === '.' || $ category === 'Libraries' ) { continue ; } $ categoryDirectoryIterator = new \ DirectoryIterator ( $ categoryFileInfo -> getPathname ( ) ) ; foreach ( $ categoryDirectoryIterator as $ packageFileInfo ) { $ packageKey = $ packageFileInfo -> getFilename ( ) ; if ( ! $ packageFileInfo -> isDir ( ) || $ packageKey [ 0 ] === '.' ) { continue ; } $ meta = self :: readPackageMetaData ( Files :: concatenatePaths ( array ( $ packageFileInfo -> getPathname ( ) , 'Meta/Package.xml' ) ) ) ; $ composerManifest = self :: readComposerManifest ( Files :: concatenatePaths ( array ( $ packageFileInfo -> getPathname ( ) , 'composer.json' ) ) ) ; $ packagesData [ $ packageKey ] = array ( 'packageKey' => $ packageKey , 'category' => $ category , 'path' => $ packageFileInfo -> getPathname ( ) , 'meta' => $ meta , 'composerManifest' => $ composerManifest ) ; } } return $ packagesData ; }
Will return an array with all available packages.

The data for each entry will be an array with the key, full path to
the package (index 'path') and a category (the packages subfolder,
index 'category'). The array is indexed by package key.

@param string $packagesPath
@return array
Will return an array with all available packages .