Composer

InstalledVersions::getInstalled()private staticWPSCache 1.0

Method of the class: InstalledVersions{}

No Hooks.

Return

Array[].

Usage

$result = InstalledVersions::getInstalled();

InstalledVersions::getInstalled() code WPSCache 1.9.2

private static function getInstalled()
{
    if (null === self::$canGetVendors) {
        self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
    }

    $installed = array();

    if (self::$canGetVendors) {
        foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
            if (isset(self::$installedByVendor[$vendorDir])) {
                $installed[] = self::$installedByVendor[$vendorDir];
            } elseif (is_file($vendorDir.'/composer/installed.php')) {
                $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
                if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
                    self::$installed = $installed[count($installed) - 1];
                }
            }
        }
    }

    if (null === self::$installed) {
        // only require the installed.php file if this file is loaded from its dumped location,
        // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
        if (substr(__DIR__, -8, 1) !== 'C') {
            self::$installed = require __DIR__ . '/installed.php';
        } else {
            self::$installed = array();
        }
    }
    $installed[] = self::$installed;

    return $installed;
}