Composer

InstalledVersions::getInstalledPackagesByType()public staticWPSCache 1.0

Returns a list of all package names with a specific type e.g. 'library'

Method of the class: InstalledVersions{}

No Hooks.

Return

String[].

Usage

$result = InstalledVersions::getInstalledPackagesByType( $type );
$type(string) (required)
-

InstalledVersions::getInstalledPackagesByType() code WPSCache 1.9.2

public static function getInstalledPackagesByType($type)
{
    $packagesByType = array();

    foreach (self::getInstalled() as $installed) {
        foreach ($installed['versions'] as $name => $package) {
            if (isset($package['type']) && $package['type'] === $type) {
                $packagesByType[] = $name;
            }
        }
    }

    return $packagesByType;
}