【发布时间】:2017-01-04 03:13:45
【问题描述】:
我正在尝试使用私有 Bitbucket 存储库设置项目。应用程序包含核心,核心随后将包含其他核心。该应用程序将来应该能够包含更多内容。
现在,我在与 Satis 一起工作时使用它,但对于我自己来说,我只想使用 Bitbucket,因为我认为它应该可以工作。我关注了 Bitbucket 的 Set up SSH for Git 并阅读了 Git alternatives 上的 Composer 手册。
我在设置上尝试了很多变化,但无法解决。
我的项目composer.json
"require": {
"php": "^5.6 || ^7.0",
"rkeet/yc-core": "*"
},
"repositories": [
{
"type": "git",
"url": "git@bitbucket.org:rkeet/yc-core.git"
}
],
"autoload": {
"psr-4": {
"Application\\": "module/Application/src/"
}
}
YC 核心composer.json
"name": "rkeet/yc-core",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^5.6 || ^7.0",
"zendframework/zendframework": "2.5.*",
"doctrine/doctrine-module": "~1.0",
"doctrine/orm": "v2.5.*",
"rwoverdijk/assetmanager": "1.*",
"rkeet/yc-account": "*"
},
"require-dev": {
"ghislainf/zf2-whoops": "dev-master"
},
"repositories": [
{
"type": "git",
"url": "git@bitbucket.org:rkeet/yc-account.git"
}
],
"autoload": {
"psr-4": {
"YC\\Core\\": "src/"
},
"classmap": [
"./Module.php"
]
}
最后,yc 帐户composer.json
"name": "rkeet/yc-account",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^5.6 || ^7.0",
"bjyoungblood/bjy-authorize": "~1.4",
"zf-commons/zfc-user-doctrine-orm": "~1.0",
"rkeet/yc-core": "*"
},
"repositories": [
{
"type": "git",
"url": "git@bitbucket.org:rkeet/yc-core.git"
}
],
"autoload": {
"psr-4": {
"YC\\Account\\": "src/"
},
"classmap": [
"./Module.php"
]
}
composer 对象中还有一些与存储库无关的其他变量,例如description、type、authors 等等,我省略了那些可能相关的变量。
使用composer update 命令时收到的结果如下:
?[37;41mYour requirements could not be resolved to an installable set of packages.?[39;49m
Problem 1
- rkeet/yc-core dev-develop requires rkeet/yc-account * -> no matching package found.
- rkeet/yc-core dev-master requires rkeet/yc-account * -> no matching package found.
- rkeet/yc-core dev-develop requires rkeet/yc-account * -> no matching package found.
- rkeet/yc-core dev-develop requires rkeet/yc-account * -> no matching package found.
- Installation request for rkeet/yc-core * -> satisfiable by rkeet/yc-core[dev-develop, dev-master].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
希望你们能帮助我。
【问题讨论】:
-
注意,也看过this answer,但对我没有用。
-
存在循环依赖。你需要
yc-core这需要yc-account这需要yc-core... -
在没有这种依赖的情况下也试过了,不过会再试一次并发布结果
-
因为 composer 已经发现 yc-core 需要 yc-account 你第一次连接到 bitbucket 是成功的。也许您可以尝试将
{ "type": "git", "url": "git@bitbucket.org:rkeet/yc-account.git" }添加到应用程序的存储库部分。
标签: git ssh composer-php