比如说你想要使用别人的捆绑包,但想做一些修改.所以你在一些新的分支中进行修改,并配置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"
}
}
}
]
}
这适用于master分支,但是使用自定义分支,它提供:无法找到请求的包sylius / assortment-bundle dev-soft-deleteable-products-disabled.
任何想法?
解决方法:
您应该使用VCS存储库而不是包存储库.包没有composer.json,而你想要内联指定它.在你的情况下有一个composer.json,所以你可以使用VCS repo,如下所示:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/umpirsky/SyliusAssortmentBundle"
}
]
在这种情况下,Composer将使用GitHub API来获取分支名称,并检查是否存在版本dev-soft-deleteable-products-disabled.如果是,它将克隆存储库并检查所述分支.
希望如果您这样做是副作用,您的问题也将得到解决.
标签:php,symfony,composer-php
来源: https://codeday.me/bug/20191004/1853782.html