dialogik
dialogik

Reputation: 9552

Using forked Symfony bundle via composer fails

I'm trying to install the hslavich/SimplesamlphpBundle. As this bundle has dependency problems with simplesamlphp/simplesamlphp v1.13.2, I forked the repository and require dev-master instead.

Now I modified my Symfony2's project composer.json accordingly, in order to require my forked bundle instead of the original one:

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

But I still get the same error message as if no fork used:

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].

What do I have to modify in my composer.json in order to require my fork?

Upvotes: 1

Views: 224

Answers (3)

Alexandru Guzinschi
Alexandru Guzinschi

Reputation: 5726

You need to lower your minimum stability from stable to dev in order to install unstable versions, like dev-master.

Change your composer.json:

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

Also you need to enable prefer-stable to tell composer that you want stable packages when it is possible.

Upvotes: 1

dialogik
dialogik

Reputation: 9552

A (pretty ugly) workaround is to submit the fork to packagist and to directly require the fork instead of the original bundle.

Plus: I had to require the dev-master of simplesamlphp/simplesamlphp in my Symfony composer.json as well – although this requirement has already been defined in my forked bundle composer file.

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

Upvotes: 0

Kévin Dunglas
Kévin Dunglas

Reputation: 3024

Try to delete the composer.lock file and the whole vendor/ directory. Then run composer update --prefer-source to fully refresh the dependencies.

Upvotes: 0

Related Questions