浏览代码

Respect --no-plugins flag when firing pre-command-run event

Jordi Boggiano 7 年之前
父节点
当前提交
d73aef5c8a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/Composer/Command/BaseCommand.php

+ 2 - 1
src/Composer/Command/BaseCommand.php

@@ -127,7 +127,8 @@ abstract class BaseCommand extends Command
     protected function initialize(InputInterface $input, OutputInterface $output)
     {
         // initialize a plugin-enabled Composer instance, either local or global
-        $composer = $this->getComposer(false, false);
+        $disablePlugins = $input->hasParameterOption('--no-plugins');
+        $composer = $this->getComposer(false, $disablePlugins);
         if (null === $composer) {
             $composer = Factory::createGlobal($this->getIO(), false);
         }