先直接配置composer源到国内全量源:阿里/腾讯,这样可以在后续的操作中加速
阿里源:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
腾讯源:
composer config -g repo.packagist composer https://mirrors.cloud.tencent.com/composer/
composer self-update
composer clear
composer global require slince/composer-registry-manager
阿里源
composer repo:use aliyun
腾讯源
composer repo:use tencent
composer global require hirak/prestissimo
在完成了上述所有步骤后理论上composer下载将能达到最佳状态,可以通过一条命令(创建一个laravel项目)来测试一下:
composer create-project laravel/laravel laravel_test --no-progress --profile --prefer-dist
composer repo:ls
composer repo:ls --location China
composer repo:use
composer repo:use aliyun
composer repo:reset
composer repo:add
composer repo:remove