全局配置
更换到 阿里镜像
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
取消配置
composer config -g --unset repos.packagist
项目配置
将当前项目更换到阿里云镜像
composer config repo.packagist composer https://mirrors.aliyun.com/composer/
取消配置
composer config --unset repos.packagist
其他操作
更新到最新版本
composer self-update
执行诊断命令
composer diagnose
清除缓存
composer clear
若项目之前已通过其他源安装,则需要更新 composer.lock 文件,执行命令
composer update --lock
composer 命令增加 -vvv 可输出详细的信息
composer -vvv require alibabacloud/sdk
查看已安装的包
composer show
composer show -t
查找相关的包
composer show 'symfony/*'
symfony 为要查找的关键字