Kaynağa Gözat

Merge branch '1.2'

Jordi Boggiano 8 yıl önce
ebeveyn
işleme
41c3307fc5
1 değiştirilmiş dosya ile 10 ekleme ve 0 silme
  1. 10 0
      src/Composer/Command/RemoveCommand.php

+ 10 - 0
src/Composer/Command/RemoveCommand.php

@@ -61,6 +61,7 @@ EOT
     protected function execute(InputInterface $input, OutputInterface $output)
     {
         $packages = $input->getArgument('packages');
+        $packages = array_map('strtolower', $packages);
 
         $file = Factory::getComposerFile();
 
@@ -78,6 +79,15 @@ EOT
             $io->writeError('<warning>You are using the deprecated option "update-with-dependencies". This is now default behaviour. The --no-update-with-dependencies option can be used to remove a package without its dependencies.</warning>');
         }
 
+        // make sure name checks are done case insensitively
+        foreach (array('require', 'require-dev') as $linkType) {
+            if (isset($composer[$linkType])) {
+                foreach ($composer[$linkType] as $name => $version) {
+                    $composer[$linkType][strtolower($name)] = $version;
+                }
+            }
+        }
+
         foreach ($packages as $package) {
             if (isset($composer[$type][$package])) {
                 $json->removeLink($type, $package);