diff --git a/src/Composer/Command/InstallCommand.php b/src/Composer/Command/InstallCommand.php index dd18d98f7..7bf90709e 100644 --- a/src/Composer/Command/InstallCommand.php +++ b/src/Composer/Command/InstallCommand.php @@ -32,7 +32,7 @@ class InstallCommand extends Command ->setDefinition(array( 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('install-recommends', null, InputOption::VALUE_NONE, 'Also install recommended packages (ignored when installing from an existing lock file).'), + new InputOption('no-install-recommends', null, InputOption::VALUE_NONE, 'Do not install recommended packages (ignored when installing from an existing lock file).'), new InputOption('install-suggests', null, InputOption::VALUE_NONE, 'Also install suggested packages (ignored when installing from an existing lock file).'), )) ->setHelp(<<setDryRun($input->getOption('dry-run')) ->setVerbose($input->getOption('verbose')) ->setPreferSource($input->getOption('prefer-source')) - ->setInstallRecommends($input->getOption('install-recommends')) + ->setInstallRecommends(!$input->getOption('no-install-recommends')) ->setInstallSuggests($input->getOption('install-suggests')) ; diff --git a/src/Composer/Command/UpdateCommand.php b/src/Composer/Command/UpdateCommand.php index c1b75b5e9..e7c581174 100644 --- a/src/Composer/Command/UpdateCommand.php +++ b/src/Composer/Command/UpdateCommand.php @@ -31,7 +31,7 @@ class UpdateCommand extends Command ->setDefinition(array( 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('install-recommends', null, InputOption::VALUE_NONE, 'Also install recommended packages.'), + new InputOption('no-install-recommends', null, InputOption::VALUE_NONE, 'Do not install recommended packages.'), new InputOption('install-suggests', null, InputOption::VALUE_NONE, 'Also install suggested packages.'), )) ->setHelp(<<setDryRun($input->getOption('dry-run')) ->setVerbose($input->getOption('verbose')) ->setPreferSource($input->getOption('prefer-source')) - ->setInstallRecommends($input->getOption('install-recommends')) + ->setInstallRecommends(!$input->getOption('no-install-recommends')) ->setInstallSuggests($input->getOption('install-suggests')) ->setUpdate(true) ; diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index ece3c5fdb..4af678d6d 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -75,12 +75,12 @@ class Installer */ protected $eventDispatcher; - protected $preferSource; - protected $dryRun; - protected $verbose; - protected $installRecommends; - protected $installSuggests; - protected $update; + protected $preferSource = false; + protected $dryRun = false; + protected $verbose = false; + protected $installRecommends = true; + protected $installSuggests = false; + protected $update = false; /** * @var RepositoryInterface @@ -358,9 +358,9 @@ class Installer } /** - * also install recommend packages + * install recommend packages * - * @param boolean $installRecommends + * @param boolean $noInstallRecommends * @return Installer */ public function setInstallRecommends($installRecommends=true)