我知道“安装”和“更新”的区别,但我找不到
composer update
和composer upgrade
之间的区别。composer update
和composer upgrade
之间的区别。它们都是同一个命令,upgrade
只是 update
的别名。
请参见 UpdateCommand 源代码:
class UpdateCommand extends BaseCommand
...
protected function configure()
{
$this
->setName('update')
->setAliases(array('u', 'upgrade'))
->setDescription('Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.')
(设置命令别名)
比较composer list调用:
$ composer list | grep '^ *\(update\|upgrade\|install\) '
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
update Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
upgrade Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
以及Composer的 composer update --help 命令:
$ composer update --help | sed -ne '1,/^$/p'
Usage:
update [options] [--] [<packages>]...
u
upgrade
(列出命令别名)
upgrade
是update
的别名。请参考 @kuba 的回答。不要将其与brew update
和brew upgrade
混淆。 - Raptor