remove mirrors in composer.lock
Packagist.org is slow in some countries, so we always use mirrors.
But mirrors changes composer.lock
, such as:
{
"name": "laravel/framework",
"version": "v6.3.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "80914c430fb5e49f492812d704ba6aeec03d80a2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/80914c430fb5e49f492812d704ba6aeec03d80a2",
"reference": "80914c430fb5e49f492812d704ba6aeec03d80a2",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}
}
If we submit this to Git, composer will run slower from other countries, such as CI(circleci.com, travis-ci.com) and other developers developers around the world.
So we need to remove mirrors in composer.lock
before submit. I have wrote remove-composer-mirrors.php to do this, just run:
php -i remove-composer-mirrors.php