Composer - 找不到匹配的软件包

13

我有一个自己构建的PHP框架,现在我想将所有东西分开到不同的存储库中,并将其设置在composer中以使我的工作更轻松。

基本上,我有三个相关的存储库:一个是用作收集数据类型基类的集合类(“liftkit / collection”),另一个是输入变量的包装器(“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"
        }
    ]
}

任何帮助都非常感激。谢谢。

1个回答

19

看起来composer不能递归解析存储库。从文档中可以得知:

存储库没有被递归解析。你只能将它们添加到你的主要 composer.json 中。依赖项的 composer.json 的存储库声明将被忽略。

所以我想我没办法了。我必须在每个仓库中指定存储库。


非常感谢你,Ryan!此外,对于将来的人们,我从递归的composer.json中获取了我的VCS位置,并将其包含在我的根目录中,它们确实加载了。 - camdixon

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接