Composer
InstalledVersions::getReference()
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 reference
Usage
$result = InstalledVersions::getReference( $packageName );
- $packageName(string) (required)
- -
InstalledVersions::getReference() InstalledVersions::getReference code WPSCache 1.12.4
public static function getReference($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['reference'])) { return null; } return $installed['versions'][$packageName]['reference']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); }