Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer 下载原理及代理 #10

Open
wilon opened this issue Oct 10, 2017 · 0 comments
Open

Composer 下载原理及代理 #10

wilon opened this issue Oct 10, 2017 · 0 comments

Comments

@wilon
Copy link
Owner

wilon commented Oct 10, 2017

Composer 下载原理

  1. 根目录,https://packagist.org/packages.json
    按年月向下查找

  2. 二级目录,https://packagist.org/p/provider-2017-10$%hash%.json
    如:https://packagist.org/p/provider-2017-10%248c8ac8b33544311faf5cd700f5d4d8aebe75b0e0fb0f3e58bd235ba660e4096c.json
    可找到包名

  3. 包地址,https://packagist.org/p/%包名%$%包hash%.json
    如:https://packagist.org/p/1fabiosoares/sculptor%243e9ab8a4914758e436420b783fc94e659e6790570b5d8f92f45a41211d1d2542.json
    可以看到包的详细信息,版本下载地址等等。

dist -> url 即包的下载地址。

Composer 代理

代理服务就是将上面域名换成自己的,下载链接再改成内网链接,服务端缓存好包,这样不用连外网也可以用 composer。

代理项目:https://toranproxy.com/

docker快速搭建代理:https://github.com/cedvan/docker-toran-proxy

若是希望下载包不认证而后天管理需认证,修改项目app.php:https://gist.github.com/wilon/aaf8e444cd081a48f25dd15f5d2c43fa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant