瀏覽代碼

added no-custom-installers option to install/update command

Johannes M. Schmitt 13 年之前
父節點
當前提交
ec74e422f4
共有 2 個文件被更改,包括 10 次插入0 次删除
  1. 5 0
      src/Composer/Command/InstallCommand.php
  2. 5 0
      src/Composer/Command/UpdateCommand.php

+ 5 - 0
src/Composer/Command/InstallCommand.php

@@ -33,6 +33,7 @@ class InstallCommand extends Command
                 new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
                 new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'),
                 new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of dev-require packages.'),
+                new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'Disables all custom installers.'),
                 new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
             ))
             ->setHelp(<<<EOT
@@ -61,6 +62,10 @@ EOT
             ->setRunScripts(!$input->getOption('no-scripts'))
         ;
 
+        if ($input->getOption('no-custom-installers')) {
+            $install->disableCustomInstallers();
+        }
+
         return $install->run() ? 0 : 1;
     }
 }

+ 5 - 0
src/Composer/Command/UpdateCommand.php

@@ -33,6 +33,7 @@ class UpdateCommand extends Command
                 new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
                 new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'),
                 new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of dev-require packages.'),
+                new InputOption('no-custom-installers', null, Input::VALUE_NONE, 'Disables all custom installers.'),
                 new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
             ))
             ->setHelp(<<<EOT
@@ -67,6 +68,10 @@ EOT
             ->setUpdateWhitelist($input->getArgument('packages'))
         ;
 
+        if ($input->getOption('no-custom-installers')) {
+            $install->disableCustomInstallers();
+        }
+
         return $install->run() ? 0 : 1;
     }
 }