Composer

InstalledVersions::getInstalledPackages()public staticWPSCache 1.0

Returns a list of all package names which are present, either by being installed, replaced or provided

Method of the class: InstalledVersions{}

No Hooks.

Return

String[].

Usage

$result = InstalledVersions::getInstalledPackages();

InstalledVersions::getInstalledPackages() code WPSCache 1.9.2

public static function getInstalledPackages()
{
    $packages = array();
    foreach (self::getInstalled() as $installed) {
        $packages[] = array_keys($installed['versions']);
    }

    if (1 === \count($packages)) {
        return $packages[0];
    }

    return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}