鲍成龙
美丽的东西存在于世上,这一点本身就值得感谢了。
鲍成龙

1. self-update 命令官方文档

版本号:https://getcomposer.org/download

中文网:https://docs.phpcomposer.com/03-cli.html#self-update

英文网:https://getcomposer.org/doc/03-cli.md#self-update-selfupdate-

 

2. 版本更新使用示例

查看当前composr版本(大写的V)

composer -V

 

当前composer更新为最新版

composer self-update

 

更新到指定版本

composer self-update 1.10.1

 

3. 版本回滚

回滚到安装的上一个版本

composer self-update --rollback

 

4. 版本更新并删除旧版本的备份

composer self-update --clean-backups

 

 

其他相关命令

composer list 显示所有命令
composer show 显示所有包信息
composer install 在 composer.json 配置中添加依赖库之后运行此命令安装
composer create-project laravel/laravel Laravel –prefer-dist “5.1.*” 创建项目
composer search packagename 搜索包
composer update 更新所有包
composer update monolog/monolog 更新指定包
composer remove monolog/monolog 移除指定的包
composer require monolog/monolog 添加指定包
composer require monolog/monolog:1.19 添加指定包和版本
composer require monolog/monolog=1.19
composer require monolog/monolog 1.19