diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index 0d408be14..13a67b550 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -111,6 +111,14 @@ To disable packagist: You can alter repositories in the global config.json file by passing in the --global option. +To add or edit suggested packages you can use: + + %command.full_name% suggest.package reason for the suggestion + +To add or edit extra properties you can use: + + %command.full_name% extra.property value + To edit the file in an external editor: %command.full_name% --editor @@ -601,6 +609,7 @@ EOT return 0; } + // handle suggest if (preg_match('/^suggest\.(.+)/', $settingKey, $matches)) { if ($input->getOption('unset')) { $this->configSource->removeProperty($settingKey); @@ -608,7 +617,14 @@ EOT return 0; } - $this->configSource->addProperty($settingKey, $values[0]); + $this->configSource->addProperty($settingKey, implode(' ', $values)); + + return 0; + } + + // handle unsetting extra/suggest + if (in_array($settingKey, array('suggest', 'extra'), true) && $input->getOption('unset')) { + $this->configSource->removeProperty($settingKey); return 0; } @@ -625,6 +641,8 @@ EOT return 0; } + + // handle unsetting platform if ($settingKey === 'platform' && $input->getOption('unset')) { $this->configSource->removeConfigSetting($settingKey);