瀏覽代碼

Fix solving issue when provide provides a platform package that is already installed, fixes #1171

Jordi Boggiano 12 年之前
父節點
當前提交
ead17b2680
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      src/Composer/Installer.php

+ 8 - 1
src/Composer/Installer.php

@@ -333,7 +333,14 @@ class Installer
 
 
             $constraint = new VersionConstraint('=', $package->getVersion());
             $constraint = new VersionConstraint('=', $package->getVersion());
             $constraint->setPrettyString($package->getPrettyVersion());
             $constraint->setPrettyString($package->getPrettyVersion());
-            $request->install($package->getName(), $constraint);
+
+            if (!($package->getRepository() instanceof PlatformRepository)
+                || !($provided = $this->package->getProvides())
+                || !isset($provided[$package->getName()])
+                || !$provided[$package->getName()]->getConstraint()->matches($constraint)
+            ) {
+                $request->install($package->getName(), $constraint);
+            }
         }
         }
 
 
         // if the updateWhitelist is enabled, packages not in it are also fixed
         // if the updateWhitelist is enabled, packages not in it are also fixed