08月06, 2018

Composer Packagist镜像使用方法

1、国内镜像一

全局设置:

composer config -g repo.packagist composer https://packagist.phpcomposer.com

当前项目:

composer config repo.packagist composer https://packagist.phpcomposer.com


2、国内镜像二(推荐使用)

全局设置:

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

当前项目:

composer config repo.packagist composer https://mirrors.aliyun.com/composer/


3、国内镜像二已不可使用

全局设置:

composer config -g repo.packagist composer https://packagist.laravel-china.org

当前项目:

composer config repo.packagist composer https://packagist.laravel-china.org


4、取消镜像

composer config -g --unset repos.packagist

或者

composer config -g repo.packagist composer https://packagist.org


5、查看配置

composer config -gl


本文链接:https://lxyit.com/article/show/152.html

-- EOF --