composer config -g repo.packagist composer https://packagist.phpcomposer.com
composer install --no-progress --profile --prefer-dist -vvv
[112.8MiB/410.35s] Memory usage: 112.82MiB (peak: 294.7MiB), time: 410.35s (共72个包。如果能显示安装了多少包就好了)
还是慢。伤心。
[104.0MiB/156.06s] Downloading https://repo.packagist.org/p/sebastian/environment.json
[104.2MiB/157.16s] Writing C:/Users/Administrator/AppData/Local/Composer/repo/https---packagist.phpcomposer.com/provider-sebastian$environment.json into cache
[104.0MiB/157.17s] Reading C:/Users/Administrator/AppData/Local/Composer/repo/https---packagist.phpcomposer.com/provider-sebastian$exporter.json from cache
[104.1MiB/157.71s] Downloading https://repo.packagist.org/p/sebastian/exporter.json
[104.1MiB/158.83s] Reading C:/Users/Administrator/AppData/Local/Composer/repo/https---packagist.phpcomposer.com/provider-sebastian$global-state.json from cache
[104.1MiB/159.38s] Downloading https://repo.packagist.org/p/sebastian/global-state.json
[104.1MiB/161.24s] Reading C:/Users/Administrator/AppData/Local/Composer/repo/https---packagist.phpcomposer.com/provider-sebastian$object-enumerator.json from cache
为什么设置了国内镜像,还去repo.packagist.org下载?
镜像原理:
一般情况下,安装包的数据(主要是 zip 文件)一般是从github.com
上下载的,安装包的元数据是从packagist.org
上下载的。然而,由于众所周知的原因,国外的网站连接速度很慢,并且随时可能被“墙”甚至“不存在”。
“Packagist 中国全量镜像”所做的就是缓存所有安装包和元数据到国内的机房并通过国内的 CDN 进行加速,这样就不必再去向国外的网站发起请求,从而达到加速
composer install
以及composer update
的过程,并且更加快速、稳定。因此,即使packagist.org
、github.com
发生故障(主要是连接速度太慢和被墙),你仍然可以下载、更新安装包。
请问这个意思是不是可以不用访问packagist和github了?
应该是镜像站不供应了吧。
https://pkg.phpcomposer.com/ 不行了。
https://developer.aliyun.com/... 只镜像packagist。
https://php.cnpkg.org/ 去dl.laravel-china.org下载zip不成,跳转到codeload.github.com。
github因为国内原因经常卡吧。。
就这样。