Mirrors of Packagist (Composer)

The PHP Package Repository

Website - Official

Mirrors from Composer中文网

方法一:修改全局配置

composer config -g repo.packagist composer http://packagist.cdn.mirrors.shareany.com

方法二:项目根目录执行命令

composer config repo.packagist composer http://packagist.cdn.mirrors.shareany.com

方法三:在composer.json的根节点中添加如下代码:

"repositories": {
    "packagist": {
        "type": "composer",
        "url": "http://packagist.cdn.mirrors.shareany.com"
    }
}

Mirrors in Mainland China

Composer中文网