- # 显示所有已经安装的包
- composer show
-
- # 移除指定的依赖包package_name
- composer remove package_name
-
- # 搜索包名为package_name的信息
- composer search package_name
-
- # 添加一个指定的包(不需要手动在 composer.json 里添加依赖信息)
- # composer 会先找到合适的版本,然后更新composer.json文件,在 require 那添加 package_name 包的相关信息,
- # 再把相关的依赖下载下来进行安装,最后更新 composer.lock 文件并生成 php 的自动加载文件。
- composer require package_name
-
- # 更新所有依赖包
- composer update
-
- # 更新指定的包package_name
- composer update package_name
-
- # 更新指定的多个包package_name1、package_name2
- composer update package_name1 package_name2
-
- # 通过通配符匹配包更新
- composer update vendor/*