因此,我听了Saldeak对this question的回答。我想在仓库的项目中使用自己的fork,但是在安装过程中遇到了相互矛盾的要求。
$ composer update zfcampus/zf-content-validation
Loading composer repositories with package information Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- zfcampus/zf-apigility-admin 1.6.0 requires zfcampus/zf-content-validation ^1.4 -> satisfiable by zfcampus/zf-content-validation[1.7.x-dev, 1.6.x-dev].
- zfcampus/zf-apigility-admin 1.6.0 requires zfcampus/zf-content-validation ^1.4 -> satisfiable by zfcampus/zf-content-validation[1.7.x-dev, 1.6.x-dev].
- zfcampus/zf-apigility-admin 1.6.0 requires zfcampus/zf-content-validation ^1.4 -> satisfiable by zfcampus/zf-content-validation[1.7.x-dev, 1.6.x-dev].
- Can only install one of: zfcampus/zf-content-validation[1.7.x-dev, dev-alias-and-remove-empty-data].
- Can only install one of: zfcampus/zf-content-validation[1.6.x-dev, dev-alias-and-remove-empty-data].
- Can only install one of: zfcampus/zf-content-validation[1.7.x-dev, dev-alias-and-remove-empty-data].
- Can only install one of: zfcampus/zf-content-validation[1.6.x-dev, dev-alias-and-remove-empty-data].
- Installation request for zfcampus/zf-content-validation dev-alias-and-remove-empty-data -> satisfiable by zfcampus/zf-content-validation[dev-alias-and-remove-empty-data].
- Installation request for zfcampus/zf-apigility-admin (locked at 1.6.0, required as ^1.5.9) -> satisfiable by zfcampus/zf-apigility-admin[1.6.0].
在composer.json
中,我需要这样做:
"zfcampus/zf-content-validation": "dev-alias-and-remove-empty-data",
回购已添加到列表中:
{
"type": "vcs",
"url": "git@github.com:rkeet/zf-content-validation.git"
}
我试图
composer remove zfcampus/zf-content-validation
composer require zfcampus/zf-content-validation:dev-alias-and-remove-empty-data
和
composer remove zfcampus/zf-content-validation
composer update zfcampus/zf-content-validation
但是每次这都回到上面的错误。
注意:
composer.lock
不能安装最新的所有东西;除了已针对已安装版本进行测试的这一要求以外,还有更多要求答案 0 :(得分:1)
您需要将新分支别名为常规数字分支,以便将其用于解决其他依赖项的需求。
"zfcampus/zf-content-validation": "dev-alias-and-remove-empty-data as 1.7.x-dev",
在此Composer将您的分支视为1.7
行之后,它应该与^1.4
约束相匹配。
请参阅文档中的Require inline alias部分。