|
@@ -208,44 +208,50 @@ class Rule
|
|
|
// handle php/hhvm
|
|
|
if (defined('HHVM_VERSION')) {
|
|
|
return $text . ' -> your HHVM version does not satisfy that requirement.';
|
|
|
- } elseif ($targetName === 'hhvm') {
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($targetName === 'hhvm') {
|
|
|
return $text . ' -> you are running this with PHP and not HHVM.';
|
|
|
- } else {
|
|
|
- $packages = $pool->whatProvides($targetName);
|
|
|
- $package = count($packages) ? current($packages) : phpversion();
|
|
|
+ }
|
|
|
|
|
|
- if (!($package instanceof CompletePackage)) {
|
|
|
- return $text . ' -> your PHP version ('.phpversion().') does not satisfy that requirement.';
|
|
|
- }
|
|
|
+ $packages = $pool->whatProvides($targetName);
|
|
|
+ $package = count($packages) ? current($packages) : phpversion();
|
|
|
|
|
|
- $extra = $package->getExtra();
|
|
|
+ if (!($package instanceof CompletePackage)) {
|
|
|
+ return $text . ' -> your PHP version ('.phpversion().') does not satisfy that requirement.';
|
|
|
+ }
|
|
|
|
|
|
- if (!empty($extra['config.platform'])) {
|
|
|
- $text .= ' -> your PHP version ('.phpversion().') overridden by "config.platform.php" version ('.$package->getPrettyVersion().') does not satisfy that requirement.';
|
|
|
- } else {
|
|
|
- $text .= ' -> your PHP version ('.$package->getPrettyVersion().') does not satisfy that requirement.';
|
|
|
- }
|
|
|
+ $extra = $package->getExtra();
|
|
|
|
|
|
- return $text;
|
|
|
+ if (!empty($extra['config.platform'])) {
|
|
|
+ $text .= ' -> your PHP version ('.phpversion().') overridden by "config.platform.php" version ('.$package->getPrettyVersion().') does not satisfy that requirement.';
|
|
|
+ } else {
|
|
|
+ $text .= ' -> your PHP version ('.$package->getPrettyVersion().') does not satisfy that requirement.';
|
|
|
}
|
|
|
- } elseif (0 === strpos($targetName, 'ext-')) {
|
|
|
+
|
|
|
+ return $text;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (0 === strpos($targetName, 'ext-')) {
|
|
|
// handle php extensions
|
|
|
$ext = substr($targetName, 4);
|
|
|
$error = extension_loaded($ext) ? 'has the wrong version ('.(phpversion($ext) ?: '0').') installed' : 'is missing from your system';
|
|
|
|
|
|
return $text . ' -> the requested PHP extension '.$ext.' '.$error.'.';
|
|
|
- } elseif (0 === strpos($targetName, 'lib-')) {
|
|
|
+ }
|
|
|
+
|
|
|
+ if (0 === strpos($targetName, 'lib-')) {
|
|
|
// handle linked libs
|
|
|
$lib = substr($targetName, 4);
|
|
|
|
|
|
return $text . ' -> the requested linked library '.$lib.' has the wrong version installed or is missing from your system, make sure to have the extension providing it.';
|
|
|
- } else {
|
|
|
- if ($providers = $pool->whatProvides($targetName, $this->reasonData->getConstraint(), true, true)) {
|
|
|
- return $text . ' -> satisfiable by ' . $this->formatPackagesUnique($pool, $providers) .' but these conflict with your requirements or minimum-stability.';
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- return $text . ' -> no matching package found.';
|
|
|
+ if ($providers = $pool->whatProvides($targetName, $this->reasonData->getConstraint(), true, true)) {
|
|
|
+ return $text . ' -> satisfiable by ' . $this->formatPackagesUnique($pool, $providers) .' but these conflict with your requirements or minimum-stability.';
|
|
|
}
|
|
|
+
|
|
|
+ return $text . ' -> no matching package found.';
|
|
|
}
|
|
|
|
|
|
return $text;
|