From b1de2c52a3b969b03d258ba15fa68c8b0e7c0e2c Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Wed, 27 Jan 2016 00:48:17 +0100 Subject: [PATCH] Add --no-plugins option to remove/require --- src/Composer/Command/RemoveCommand.php | 3 ++- src/Composer/Command/RequireCommand.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Composer/Command/RemoveCommand.php b/src/Composer/Command/RemoveCommand.php index 869720718..e9bd610b4 100644 --- a/src/Composer/Command/RemoveCommand.php +++ b/src/Composer/Command/RemoveCommand.php @@ -37,6 +37,7 @@ class RemoveCommand extends Command ->setDefinition(array( new InputArgument('packages', InputArgument::IS_ARRAY, 'Packages that should be removed.'), new InputOption('dev', null, InputOption::VALUE_NONE, 'Removes a package from the require-dev section.'), + new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies.'), new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'), @@ -92,7 +93,7 @@ EOT } // Update packages - $composer = $this->getComposer(); + $composer = $this->getComposer(true, $input->getOption('no-plugins')); $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress')); $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'remove', $input, $output); diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index bbdf15681..cd62bbc5a 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -42,6 +42,7 @@ class RequireCommand extends InitCommand new InputOption('dev', null, InputOption::VALUE_NONE, 'Add requirement to require-dev.'), new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'), new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'), + new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies.'), new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'), @@ -93,7 +94,7 @@ EOT $composerDefinition = $json->read(); $composerBackup = file_get_contents($json->getPath()); - $composer = $this->getComposer(); + $composer = $this->getComposer(true, $input->getOption('no-plugins')); $repos = $composer->getRepositoryManager()->getRepositories(); $platformOverrides = $composer->getConfig()->get('platform') ?: array(); @@ -143,7 +144,7 @@ EOT // Update packages $this->resetComposer(); - $composer = $this->getComposer(); + $composer = $this->getComposer(true, $input->getOption('no-plugins')); $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress')); $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'require', $input, $output);