【发布时间】:2020-07-01 13:33:10
【问题描述】:
我正在尝试在 yii2-app-advanced 的安装中使用我的 yiisoft/yii2 的分叉版本。
我关注了this wiki。
我创建了一个名为 custom 的分支并将其推送到我的 yii2 fork。
在我的 fork 的 composer.json 中,我有以下内容(重要吗?):
...
"extra": {
"branch-alias": {
"dev-custom": "2.0.x-dev"
}
...
然后在我的yii2-app-advanced 安装中,我有以下composer.json:
{
"name": "yiisoft/yii2-app-advanced",
...
"minimum-stability": "stable",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/david-it/yii2"
}
],
"require": {
"php": ">=5.6.0",
"yiisoft/yii2": "dev-custom",
"yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0",
"yiisoft/yii2-bootstrap4": "~2.0.6"
},
...
}
当我运行 composer update 时,我收到以下错误:
Problem 1
- The requested package yiisoft/yii2 dev-custom exists as yiisoft/yii2[2.0.0, 2.0.0-alpha, 2.0.0-beta, 2.0.0-rc, 2.0.1, 2.0.10, 2.0.11, 2.0.11.1, 2.0.11.2, 2.0.12, 2.0.12.1, 2.0.12.2, 2.0.13, 2.0.13.1, 2.0.13.2, 2.0.13.3, 2.0.14, 2.0.14.1, 2.0.14.2, 2.0.15, 2.0.15.1, 2.0.16, 2.0.16.1, 2.0.17, 2.0.18, 2.0.19, 2.0.2, 2.0.20, 2.0.21, 2.0.22, 2.0.23, 2.0.24, 2.0.25, 2.0.26, 2.0.27, 2.0.28, 2.0.29, 2.0.3, 2.0.30, 2.0.31, 2.0.32, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.1.x-dev, 3.0.x-dev, dev-master, 2.0.x-dev] but these are rejected by your constraint.
命令composer why-not yiisoft/yii2 dev-custom(如果在这里有用的话)显示了这个:
yiisoft/yii2-bootstrap4 2.0.8 requires yiisoft/yii2 (~2.0)
yiisoft/yii2-debug 2.1.13 requires yiisoft/yii2 (~2.0.13)
yiisoft/yii2-faker 2.0.4 requires yiisoft/yii2 (~2.0.0)
yiisoft/yii2-gii 2.1.4 requires yiisoft/yii2 (~2.0.14)
yiisoft/yii2-swiftmailer 2.1.2 requires yiisoft/yii2 (>=2.0.4)
我不确定我错过了什么。我环顾四周,包括 this 和 this 问题,但没有运气。
编辑 1
Composer 1.9.3 (2020-02-04 12:58:49) 在 Linux / 4.15.0-91-generic 上使用 PHP 7.2.24-0ubuntu0.18.04.3
编辑 2
根据需要选择 dev-master 可以工作,但会下载原始文件(不是 fork 中的文件)。
"require": {
...
"yiisoft/yii2": "dev-master",
...
}
我还尝试了this answer 的所有提示,但没有成功。
【问题讨论】:
标签: github yii2 composer-php fork