例如,假设您想要使用来自其他人的包,但想要做一些修改。因此,您可以在一些新分支中进行修改,并配置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.
有什么想法吗?
发布于 2012-09-02 02:52:28
您实际上应该使用VCS存储库,而不是包存储库。Package是在没有composer.json的情况下使用的,而您想要在内联中指定它。在您的例子中有一个composer.json,所以您可以使用VCS repo,如下所示:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/umpirsky/SyliusAssortmentBundle"
}
]在这种情况下,Composer将使用GitHub接口来获取分支名称,并检查版本dev-soft-deleteable-products-disabled是否存在。如果是,它将克隆存储库并签出所述分支。
希望如果你这样做是一个副作用,你的问题也会得到解决。
有关更多信息,请阅读文档chapter on repositories。
发布于 2013-04-05 02:55:10
Satis可以用作Packagist的微型版本-允许您集中控制私有存储库的作曲家依赖。
https://stackoverflow.com/questions/12229970
复制相似问题