我尝试使用私人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-account 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"
]
}
作曲家对象中还有其他一些与存储库无关的变量,例如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.
希望你们中的一个能帮助我。
答案 0 :(得分:4)
您需要将yc-account的存储库添加到基础包中。
在解析包存储库路径时,composer仅使用存储在根包中的信息。它将扫描所有必需包的composer.json,但不使用存储库定义。
但是,您可能仍然需要私有存储库,这需要其他私有存储库,但您还需要将这些存储库添加到根节中的存储库部分。其中一个原因是,否则你的依赖关系可能会从你下载其他软件包的地方乱七八糟 - 你可能不想要它。
请参阅此处以获取进一步说明Composer won't load private repository within private repository?
并且如上所述,应始终避免循环依赖,它可能在安装后工作,但即使这样,它也会在某个时刻中断,并且构建它的时间越长,清理它就越多。