Composer
InstalledVersions::getInstalledPackagesByType()
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() InstalledVersions::getInstalledPackagesByType code 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; }