通过composer使用forked Symfony bundle失败

时间:2015-09-01 07:10:19

标签: git symfony github composer-php

我正在尝试安装hslavich/SimplesamlphpBundle。由于此捆绑包具有simplesamlphp/simplesamlphp v1.13.2的依赖性问题,我forked the repository并且需要dev-master

现在我相应地修改了我的Symfony2的项目composer.json,以便需要我的分叉包而不是原始的包:

{
    ...
    "require": {
        ...
        "hslavich/simplesamlphp-bundle": "dev-master"
    },
    ...
    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:saxid/SimplesamlphpBundle.git"
        }
    ]
}

但我仍然得到相同的错误消息,就像没有使用fork一样:

Loading composer repositories with package information
Updating dependencies (including require-dev)
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.
    - hslavich/simplesamlphp-bundle dev-master requires simplesamlphp/simplesamlphp ~1.13 -> satisfiable by simplesamlphp/simplesamlphp[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.json中修改什么才能要求我的叉子?

3 个答案:

答案 0 :(得分:1)

您需要将最低稳定性从stable降低到dev才能安装不稳定版本,例如dev-master

更改你的composer.json:

"require": {
    "hslavich/simplesamlphp-bundle": "dev-master"
},
"repositories": [
    {
        "type": "vcs",
        "url": "git@github.com:saxid/SimplesamlphpBundle.git"
    }
],
"minimum-stability": "dev",
"prefer-stable": true

此外,您需要启用prefer-stable,以便在可能的情况下告诉作曲家您想要稳定的套餐。

答案 1 :(得分:0)

尝试删除composer.lock文件和整个vendor/目录。然后运行composer update --prefer-source以完全刷新依赖项。

答案 2 :(得分:0)

一个(非常丑陋)的解决方法是将fork提交到packagist并直接需要fork而不是原始bundle。

另外:我必须在我的Symfony dev-master中要求simplesamlphp/simplesamlphp composer.json - 尽管此要求已在我的分叉捆绑编辑器文件中定义。

"require": {
    ...
    "saxid/simplesamlphp-bundle": "dev-master",
    "simplesamlphp/simplesamlphp": "dev-master"
},