【问题标题】:Composer - No Matching Package FoundComposer - 未找到匹配的包
【发布时间】:2015-04-18 12:17:33
【问题描述】:

我已经构建了一个 PHP 框架,我正在尝试将所有内容分成不同的存储库并在 composer 中进行设置,以使我的生活更轻松。

基本上,我有 3 个有问题的存储库:一个用于作为集合数据类型基类的集合类(“liftkit/collection”),另一个是输入变量的包装器(“liftkit/input”,这取决于集合 repo),第三个用于核心(“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"
        }
    ]
}

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

【问题讨论】:

    标签: git composer-php


    【解决方案1】:

    看起来作曲家不会递归地解析存储库。来自文档:

    存储库不是递归解析的。您只能将它们添加到 你的主要 composer.json。依赖关系的存储库声明' composer.jsons 被忽略。

    所以我想我运气不好。我必须在每个 repo 中指定存储库。

    【讨论】:

    • 非常感谢瑞恩! getcomposer.org/doc/faqs/… 另外,对于未来的你们,我从递归 composer.json 中获取了我的 VCS 位置并包含在我的根目录中,并且它们确实加载了。
    猜你喜欢
    • 2018-04-09
    • 2016-11-21
    • 1970-01-01
    • 1970-01-01
    • 2012-12-30
    • 1970-01-01
    • 2014-08-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多