推送
composer.json
在项目根目录下新建composer.json,里面进行如下配置
{
"repositories": [
{
"type": "composer",
"url": "http://172.28.118.19:8100/repository/rcd_composer_local/"
}
]
}
其中url是hosted私库的url
打包成zip
composer archive --format=zip
如果不出问题,会生成__root__-1.0.0+no-version-set.zip
推送
curl -v --user admin:<PASSWORD> --upload-file __root__-1.0.0+no-version-set.zip http://172.28.118.19:8100/repository/rcd_composer_local/packages/upload/<AUTHOR>/<PACKAGENAME>/<VERSION>
url是:hosted库的url/packeages/upload/AUTHOR/PACKAGENAME/VERSION
拉取
composer.json
以vendor/cmtest为例,vendor对应推送中的
拉取该composer,可以如下配置composer.json
{
"config": {
"secure-http": false
},
"repositories": [
{
"type": "composer",
"url": "http://172.28.118.19:8100/repository/rcd_composer_group/"
},
{
"packagist.org": false
}
],
"require": {
"vendor/cmtest":"1.0.0"
}
}
url为group库的url
拉取
composer install
评论区