我已经构建了一个PHP框架,并且我试图将所有内容分成不同的回购,然后在作曲家中设置它以使我的生活更轻松。
基本上,我有3个repos:一个用于集合类,用作集合数据类型的基类(" liftkit / collection"),另一个是输入变量的包装器(& #34; liftkit / input",这取决于集合回购),第三个用于核心(" liftkit / core",这取决于输入包装。
当我在" liftkit / input"上运行composer update
时,它会安装" liftkit / collection"并且工作正常,但当我在" liftkit / core"它给了我以下错误:
问题1 - liftkit / input @dev的安装请求 - >可通过liftkit / input [dev-master]来满足。 - liftkit / input dev-master需要liftkit / collection dev-master - >找不到匹配的包。
这是我的composer.json文件:
{
"name": "liftkit/collection",
"description": "LiftKit base class for collections",
"license": "LGP-2.1",
"autoload": {
"psr-4": {
"LiftKit\\": "src/"
}
},
"require": {
},
"require-dev": {
"phpunit/phpunit": "4.5.*"
}
}
{
"name": "liftkit/input",
"description": "LiftKit input wrappers",
"license": "LGP-2.1",
"autoload": {
"psr-4": {
"LiftKit\\": "src/"
}
},
"require": {
"liftkit/collection": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "4.5.*"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/liftkit/collection"
}
]
}
{
"name": "liftkit/core",
"description": "LiftKit Core Libraries",
"license": "LGP-2.1",
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"LiftKit\\": "src/"
}
},
"require": {
"liftkit/input": "dev-master",
"liftkit/dependency-injection": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "4.5.*"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/liftkit/input"
},
{
"type": "git",
"url": "https://github.com/liftkit/dependency-injection"
}
]
}
非常感谢任何帮助。感谢。
答案 0 :(得分:11)
看起来composer不会递归地解析存储库。来自文档:
未以递归方式解析存储库。您只能将它们添加到 你的主要composer.json。依赖项的存储库声明' composer.jsons被忽略。
所以我想我运气不好。我必须在每个仓库中指定存储库。