我想安装一个具有以下依赖项的 bundle:

 "require": {
    "symfony/symfony": ">=2.4",
    "simplesamlphp/simplesamlphp": "dev-master"
},

当我尝试执行 composer require hslavich/simplesamlphp-bundle dev-master 时,我得到以下信息:
Your requirements could not be resolved to an installable set of packages.
Problem 1
    - simplesamlphp/simplesamlphp v1.13.2 requires openid/php-openid dev-master#ee669c6a9d4d95b58ecd9b6945627276807694fb as 2.2.2 -> no matching package found.
    - simplesamlphp/simplesamlphp v1.13.1 requires openid/php-openid dev-master#ee669c6a9d4d95b58ecd9b6945627276807694fb as 2.2.2 -> no matching package found.
    - simplesamlphp/simplesamlphp v1.13.0 requires openid/php-openid dev-master#ee669c6a9d4d95b58ecd9b6945627276807694fb as 2.2.2 -> no matching package found.
    - simplesamlphp/simplesamlphp v1.12.0 requires openid/php-openid dev-master#ee669c6a9d4d95b58ecd9b6945627276807694fb as 2.2.2 -> no matching package found.
    - hslavich/simplesamlphp-bundle dev-master requires simplesamlphp/simplesamlphp dev-master -> no matching package found.
    - hslavich/simplesamlphp-bundle dev-master requires simplesamlphp/simplesamlphp * -> satisfiable by simplesamlphp/simplesamlphp[v1.12.0, v1.13.0, v1.13.1, v1.13.2].
    - Installation request for hslavich/simplesamlphp-bundle dev-master -> satisfiable by hslavich/simplesamlphp-bundle[dev-master].

但是如果我先做 composer require simplesamlphp/simplesamlphp dev-master 然后 composer require hslavich/simplesamlphp-bundle dev-master 一切都好。

应该如何修改 bundles composer.json 文件,以便我不需要单独的 require simplesamlphp dev-master

最佳答案

hslavich/simplesamlphp-bundle v1.13 需要 simplesamlphp/simplesamlphp 1.13

但是 simplesamlphp/simplesamlphp v1.13.2 需要 openid/php-openid: dev-master#ee669c6a9d4d95b58ecd9b6945627276807694fb as 2.2.2

在你的 composer.json 中添加:

"hslavich/simplesamlphp-bundle": "1.*",
"openid/php-openid": "dev-master#ee669c6a9d4d95b58ecd9b6945627276807694fb"

最后一行是必需的,因为 openid/php-openid dev-master 不稳定。

供您引用,penid/php-openid 需要 gmp PHP 扩展。

关于symfony - Composer 无法解析 simplesamlphp 的依赖,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33432525/

10-12 21:32