举例来说,您想使用其他人的捆绑包,但想做一些修改。因此,您在一些新分支中进行修改,并配置 comspoer.json,如下所示:
{
"require": {
"sylius/assortment-bundle": "dev-soft-deleteable-products-disabled"
},
"repositories": [
{
"type": "package",
"package": {
"name": "sylius/assortment-bundle",
"version": "1.0",
"autoload": { "psr-0": { "Sylius\\Bundle\\AssortmentBundle": "" } },
"target-dir": "Sylius/Bundle/AssortmentBundle",
"source": {
"url": "https://github.com/umpirsky/SyliusAssortmentBundle.git",
"type": "git",
"reference": "soft-deleteable-products-disabled"
}
}
}
]
}
这适用于主分支,但对于自定义分支,它给出:The requested package sylius/assortment-bundle dev-soft-deleteable-products-disabled could not be found.
任何想法?
您确实应该使用 VCS 存储库而不是包存储库。包适用于没有composer.json 并且您想将其内联指定的情况。在您的情况下,有一个composer.json,因此您可以使用VCS存储库,如下所示:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/umpirsky/SyliusAssortmentBundle"
}
]
在这种情况下,Composer 将使用 GitHub API 来获取分支名称并检查版本是否正确dev-soft-deleteable-products-disabled
存在。如果是,它将克隆存储库并检查所述分支。
希望如果您这样做作为副作用,您的问题也将得到解决。
有关更多信息,请阅读文档关于存储库的章节.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)