onspli/composer-inject-repositories
最新稳定版本:v0.1.0
Composer 安装命令:
composer require onspli/composer-inject-repositories
包简介
Plugin loads repository definitions from external files and injects them to composer.json.
README 文档
README
This Composer plugin allows loading repository definitions from external files and injecting them to composer.json. Files with additional repositories can be stored locally or fetched from remote locations (http, git).
Usage
You have several composer packages stored in private Github repositories (and thus not available on public packagist.org repository), and you want to use the packages in several composer projects.
Install plugin globally.
composer global require onspli/composer-inject-repositories
Create file repos.json listing all the repositories you want to use (as described on https://getcomposer.org/doc/05-repositories.md)
{
"repositories": [
{
"type": "git",
"url": "git@github.com:onspli/private-package-1.git"
},
{
"type": "git",
"url": "git@github.com:onspli/private-package-2.git"
},
{
"type": "git",
"url": "git@github.com:onspli/private-package-3.git"
}
]
}
Add extra option inject-repositories to composer.json of your project.
{
"name": "onspli/project-using-private-repos",
"type": "project",
"extra": {
"inject-repositories": [
{
"type": "local",
"path": "/path/to/repos.json"
},
{
"type": "remote",
"url": "https://my-domain.cz/repos.json"
},
{
"type": "git",
"url": "git@github.com:onspli/private-repos.git",
"file": "repos.json"
}
]
},
"require": {
"onspli/private-package-2": "dev-main"
}
}
The plugin reads repos.json file and injects repositories to composer.json of the project, so during composer invocations it effectively looks like:
{
"name": "onspli/project-using-private-repost",
"type": "project",
"require": {
"onspli/private-package-2": "dev-main"
},
"repositories": [
{
"type": "git",
"url": "git@github.com:onspli/private-package-1.git"
},
{
"type": "git",
"url": "git@github.com:onspli/private-package-2.git"
},
{
"type": "git",
"url": "git@github.com:onspli/private-package-3.git"
}
]
}
Verbose mode
See what files and repositories are injected using composer verbose mode:
composer install --verbose
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-13