Composer
InstalledVersions::getInstallPath()
Method of the class: InstalledVersions{}
No Hooks.
Return
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.
Usage
$result = InstalledVersions::getInstallPath( $packageName );
- $packageName(string) (required)
- -
InstalledVersions::getInstallPath() InstalledVersions::getInstallPath code WPSCache 1.12.4
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'); }