Composer无法解决simplesamlphp的依赖关系

时间:2015-10-30 09:22:37

标签: symfony composer-php simplesamlphp

我想安装具有以下依赖项的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一切正常。

如何修改bundle composer.json文件,以便我不需要simplesamlphp dev-master的单独需求?

2 个答案:

答案 0 :(得分:1)

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

但simplesamlphp / simplesamlphp v1.13.2需要openid / php-openid:dev-master#ee669c6a9d4d95b58ecd9b6945627276807694fb为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扩展。

答案 1 :(得分:1)

如果您需要其他软件包,需要另一个不稳定的(dev-master)软件包,您需要在composer.json中提及 it

"require": {
    "hslavich/simplesamlphp-bundle": "~1.13",
    "simplesamlphp/simplesamlphp": "dev-master"
}

然后运行:

composer update