Composer

InstalledVersions::getInstallPath()public staticWPSCache 1.0

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

Хуков нет.

Возвращает

Строку|null. If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.

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

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

Код InstalledVersions::getInstallPath() WPSCache 1.9.2

public static function getInstallPath($packageName)
{
    foreach (self::getInstalled() as $installed) {
        if (!isset($installed['versions'][$packageName])) {
            continue;
        }

        return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
    }

    throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}