Browse Source

Merge branch '1.6'

Jordi Boggiano 7 years ago
parent
commit
dae3c5bc2d

+ 11 - 1
src/Composer/DependencyResolver/Problem.php

@@ -11,6 +11,7 @@
  */
 
 namespace Composer\DependencyResolver;
+use Composer\Package\CompletePackageInterface;
 
 /**
  * Represents a problem detected while solving dependencies
@@ -90,8 +91,17 @@ class Problem
 
                 // handle php/hhvm
                 if ($job['packageName'] === 'php' || $job['packageName'] === 'php-64bit' || $job['packageName'] === 'hhvm') {
+                    $version = phpversion();
                     $available = $this->pool->whatProvides($job['packageName']);
-                    $version = count($available) ? $available[0]->getPrettyVersion() : phpversion();
+
+                    if (count($available)) {
+                        $firstAvailable = reset($available);
+                        $version = $firstAvailable->getPrettyVersion();
+                        $extra = $firstAvailable->getExtra();
+                        if ($firstAvailable instanceof CompletePackageInterface && isset($extra['config.platform']) && $extra['config.platform'] === true) {
+                            $version .= '; ' . $firstAvailable->getDescription();
+                        }
+                    }
 
                     $msg = "\n    - This package requires ".$job['packageName'].$this->constraintToText($job['constraint']).' but ';
 

+ 10 - 1
src/Composer/IO/ConsoleIO.php

@@ -289,7 +289,16 @@ class ConsoleIO extends BaseIO
         $question->setErrorMessage($errorMessage);
         $question->setMultiselect($multiselect);
 
-        return $helper->ask($this->input, $this->getErrorOutput(), $question);
+        $result = $helper->ask($this->input, $this->getErrorOutput(), $question);
+
+        $results = array();
+        foreach ($choices as $index => $choice) {
+            if (in_array($choice, $result, true)) {
+                $results[] = (string) $index;
+            }
+        }
+
+        return $results;
     }
 
     /**

+ 1 - 0
src/Composer/Util/Filesystem.php

@@ -665,6 +665,7 @@ class Filesystem
          * Stat cache should be cleared before to avoid accidentally reading wrong information from previous installs.
          */
         clearstatcache(true, $junction);
+        clearstatcache(false);
         $stat = lstat($junction);
 
         return !($stat['mode'] & 0xC000);