github 发布repository 通过 composer 加载
相关网站
https://github.com https://packagist.org
步骤:
1、现在上面两个网站注册账号
2、在github 创建 repository 生成后的地址为 https://github.com/RainLi/chuan
3、在packagist 提交在github上面生成的repository 地址 然后会提示 not auto-loaded
4、
Go to your GitHub repository
Click the "Settings" button
Click "integrations & Services"
Add a "Packagist" service, and configure it with your API token, plus your Packagist username
Check the "Active" box and submit the form
操作目的是与packagist 关联
5、运行如下代码
curl -XPOST -H'content-type:application/json' 'https://packagist.org/api/update-package?username=RainLi&apiToken=【packagist 的Api Token】' -d'{"repository":{"url":"【github 的repository 的地址 如: https://github.com/RainLi/chuan】"}}'
6、其他:composer 相关命令
alias composer-dist-require="composer require --prefer-dist -vvv --optimize-autoloader --profile"
alias composer-source-require="composer require --prefer-source -vvv --optimize-autoloader --profile"
alias composer-dist-update="composer update --prefer-dist -vvv --optimize-autoloader --profile"
alias composer-source-update="composer update --prefer-source -vvv --optimize-autoloader --profile"
alias composer-clear-cache="composer clear-cache -vvv --profile"
alias composer-remove="composer remove -vvv --profile"
alias composer-source-require="composer require --prefer-source -vvv --optimize-autoloader --profile"
alias composer-dist-update="composer update --prefer-dist -vvv --optimize-autoloader --profile"
alias composer-source-update="composer update --prefer-source -vvv --optimize-autoloader --profile"
alias composer-clear-cache="composer clear-cache -vvv --profile"
alias composer-remove="composer remove -vvv --profile"
//显示加载的详情
composer require rainli/test v1.0.0 --prefer-dist -vvv --optimize-autoloader --profile