浏览代码

Merge pull request #2883 from dzuelke/dev-suggestions

Only print suggestions in dev mode
Jordi Boggiano 11 年之前
父节点
当前提交
abc34cc62a
共有 1 个文件被更改,包括 10 次插入8 次删除
  1. 10 8
      src/Composer/Installer.php

+ 10 - 8
src/Composer/Installer.php

@@ -223,16 +223,18 @@ class Installer
         }
         $this->installationManager->notifyInstalls();
 
-        // output suggestions
-        foreach ($this->suggestedPackages as $suggestion) {
-            $target = $suggestion['target'];
-            foreach ($installedRepo->getPackages() as $package) {
-                if (in_array($target, $package->getNames())) {
-                    continue 2;
+        // output suggestions if we're in dev mode
+        if (!$this->devMode) {
+            foreach ($this->suggestedPackages as $suggestion) {
+                $target = $suggestion['target'];
+                foreach ($installedRepo->getPackages() as $package) {
+                    if (in_array($target, $package->getNames())) {
+                        continue 2;
+                    }
                 }
-            }
 
-            $this->io->write($suggestion['source'].' suggests installing '.$suggestion['target'].' ('.$suggestion['reason'].')');
+                $this->io->write($suggestion['source'].' suggests installing '.$suggestion['target'].' ('.$suggestion['reason'].')');
+            }
         }
 
         if (!$this->dryRun) {