function InstalledVersions::getInstallPath
Same name in this branch
- 11.1.x vendor/composer/composer/src/Composer/InstalledVersions.php \Composer\InstalledVersions::getInstallPath()
Parameters
string $packageName:
Return value
string|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.
1 call to InstalledVersions::getInstallPath()
- DrupalFinderComposerRuntime::getDrupalRoot in vendor/
webflo/ drupal-finder/ src/ DrupalFinderComposerRuntime.php - Get the Drupal root path.
File
-
vendor/
composer/ InstalledVersions.php, line 236
Class
- InstalledVersions
- This class is copied in every Composer installed project and available to all
Namespace
ComposerCode
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');
}