“composer 更新”和“composer 升级”有什么区别?

Mah*_*our 3 php package-managers dependency-management composer-php

我知道“安装”和“更新”之间的区别,但我找不到composer update和之间的区别composer upgrade

kub*_*uba 6

它们都是相同的命令,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.')
Run Code Online (Sandbox Code Playgroud)

(设置命令别名)

比较作曲家列表调用:

$ 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.
Run Code Online (Sandbox Code Playgroud)

(描述相同)

和作曲家作曲家更新 --help调用:

$ composer update --help | sed -ne '1,/^$/p'
Usage:
  update [options] [--] [<packages>]...
  u
  upgrade

Run Code Online (Sandbox Code Playgroud)

(列出命令别名)