diff --git a/src/Composer/DependencyResolver/Problem.php b/src/Composer/DependencyResolver/Problem.php index c4f502907..ec68b28db 100644 --- a/src/Composer/DependencyResolver/Problem.php +++ b/src/Composer/DependencyResolver/Problem.php @@ -81,6 +81,13 @@ class Problem return "\n - The requested PHP extension ".$job['packageName'].$this->constraintToText($job['constraint']).' '.$error.'.'; } + // handle linked libs + if (0 === stripos($job['packageName'], 'lib-')) { + $lib = substr($job['packageName'], 4); + + return "\n - The requested linked library ".$job['packageName'].$this->constraintToText($job['constraint']).' has the wrong version instaled or is missing from your system, make sure to have the extension providing it.'; + } + return "\n - The requested package ".$job['packageName'].$this->constraintToText($job['constraint']).' could not be found.'; } } @@ -88,7 +95,6 @@ class Problem $messages = array(); foreach ($reasons as $reason) { - $rule = $reason['rule']; $job = $reason['job']; diff --git a/src/Composer/DependencyResolver/Rule.php b/src/Composer/DependencyResolver/Rule.php index 2b645ce94..f1b9b408c 100644 --- a/src/Composer/DependencyResolver/Rule.php +++ b/src/Composer/DependencyResolver/Rule.php @@ -191,7 +191,22 @@ class Rule } $text .= ' -> satisfiable by '.implode(', ', $requireText).'.'; } else { - $text .= ' -> no matching package found.'; + $targetName = $this->reasonData->getTarget(); + + // handle php extensions + if (0 === strpos($targetName, 'ext-')) { + $ext = substr($targetName, 4); + $error = extension_loaded($ext) ? 'has the wrong version ('.phpversion($ext).') installed' : 'is missing from your system'; + + $text .= ' -> the requested PHP extension '.$ext.' '.$error.'.'; + } elseif (0 === strpos($targetName, 'lib-')) { + // handle linked libs + $lib = substr($targetName, 4); + + $text .= ' -> the requested linked library '.$lib.' has the wrong version instaled or is missing from your system, make sure to have the extension providing it.'; + } else { + $text .= ' -> no matching package found.'; + } } return $text;