当我想通过作曲家安装一些库时,只需编写:
composer require vendor/library
和作曲家从github下载它。没有必要为composer.json的每个“vendor / library”提供url。 Composer“内部”完成。但是,当我想添加一些来自例如bitbucket,我必须创建这个composer.json:
{
"require": {
"vendor/my-private-repo1": "dev-master",
"vendor/my-private-repo2": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "git@bitbucket.org:vendor/my-private-repo1.git"
},
{
"type": "vcs",
"url": "git@bitbucket.org:vendor/my-private-repo2.git"
}
]
}
我必须指定我要安装的每个库的URL,即使它们来自同一个项目。有没有办法缩短它?我可以这样做:
{
"require": {
"vendor/my-private-repo1": "dev-master",
"vendor/my-private-repo2": "dev-master",
"vendor/my-private-repo3": "dev-master",
"vendor/my-private-repo4": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "git@bitbucket.org:vendor/*"
}
]
}
我希望我的问题是可以理解的。谢谢。