|
|
|
@ -215,7 +215,7 @@ class Problem
|
|
|
|
|
if (PlatformRepository::isPlatformPackage($packageName)) {
|
|
|
|
|
// handle php/php-*/hhvm
|
|
|
|
|
if (0 === stripos($packageName, 'php') || $packageName === 'hhvm') {
|
|
|
|
|
$version = self::getPlatformPackageVersion($pool, $packageName, phpversion());
|
|
|
|
|
$version = self::getPlatformPackageVersion($pool, $packageName);
|
|
|
|
|
|
|
|
|
|
$msg = "- Root composer.json requires ".$packageName.self::constraintToText($constraint).' but ';
|
|
|
|
|
|
|
|
|
@ -243,7 +243,7 @@ class Problem
|
|
|
|
|
$ext = substr($packageName, 4);
|
|
|
|
|
$msg = "- Root composer.json requires PHP extension ".$packageName.self::constraintToText($constraint).' but ';
|
|
|
|
|
|
|
|
|
|
$version = self::getPlatformPackageVersion($pool, $packageName, phpversion($ext) ?: '0');
|
|
|
|
|
$version = self::getPlatformPackageVersion($pool, $packageName);
|
|
|
|
|
if (null === $version) {
|
|
|
|
|
if (extension_loaded($ext)) {
|
|
|
|
|
return array(
|
|
|
|
@ -427,11 +427,14 @@ class Problem
|
|
|
|
|
* @param string $version the effective runtime version of the platform package
|
|
|
|
|
* @return ?string a version string or null if it appears the package was artificially disabled
|
|
|
|
|
*/
|
|
|
|
|
private static function getPlatformPackageVersion(Pool $pool, string $packageName, string $version): ?string
|
|
|
|
|
private static function getPlatformPackageVersion(Pool $pool, string $packageName): ?string
|
|
|
|
|
{
|
|
|
|
|
$available = $pool->whatProvides($packageName);
|
|
|
|
|
|
|
|
|
|
if (count($available)) {
|
|
|
|
|
if (!count($available)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$selected = null;
|
|
|
|
|
foreach ($available as $pkg) {
|
|
|
|
|
if ($pkg->getRepository() instanceof PlatformRepository) {
|
|
|
|
@ -458,9 +461,6 @@ class Problem
|
|
|
|
|
if ($selected instanceof CompletePackageInterface && isset($extra['config.platform']) && $extra['config.platform'] === true) {
|
|
|
|
|
$version .= '; ' . str_replace('Package ', '', $selected->getDescription());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $version;
|
|
|
|
|
}
|
|
|
|
|