Composer

InstalledVersions::getInstalledPackagesByType()public staticWPSCache 1.0

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

Метод класса: InstalledVersions{}

Хуков нет.

Возвращает

Строку[].

Использование

$result = InstalledVersions::getInstalledPackagesByType( $type );
$type(строка) (обязательный)
-

Код InstalledVersions::getInstalledPackagesByType() WPSCache 1.12.4

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;
}