dflydev / dflydev-doctrine-orm-service-provider

Doctrine ORM Service Provider
MIT License
209 stars 59 forks source link

How do I install this? #47

Closed mrkrstphr closed 9 years ago

mrkrstphr commented 9 years ago

I can't get this provider to install with Silex:

$ composer require silex/silex dflydev/doctrine-orm-service-provider
Using version ~1.2 for silex/silex
Using version ~2.0 for dflydev/doctrine-orm-service-provider
./composer.json has been updated
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
    - Conclusion: don't install pimple/pimple v1.1.1
    - Conclusion: don't install silex/silex v1.2.3
    - Conclusion: don't install silex/silex v1.2.2
    - Conclusion: don't install silex/silex v1.2.1
    - Installation request for silex/silex ~1.2 -> satisfiable by silex/silex[v1.2.0, v1.2.1, v1.2.2, v1.2.3].
    - Conclusion: don't install pimple/pimple v3.0.0
    - Conclusion: don't install pimple/pimple v1.0.1|install pimple/pimple v3.0.0
    - Installation request for dflydev/doctrine-orm-service-provider ~2.0 -> satisfiable by dflydev/doctrine-orm-service-provider[v2.0.0].
    - Conclusion: don't install pimple/pimple v1.0.2|install pimple/pimple v3.0.0
    - dflydev/doctrine-orm-service-provider v2.0.0 requires pimple/pimple >=2.1,<4 -> satisfiable by pimple/pimple[v2.1.0, v2.1.1, v3.0.0].
    - Can only install one of: pimple/pimple[v2.1.0, 1.0.0].
    - Can only install one of: pimple/pimple[v2.1.1, 1.0.0].
    - silex/silex v1.2.0 requires pimple/pimple ~1.0 -> satisfiable by pimple/pimple[1.0.0, v1.0.1, v1.0.2, v1.1.0, v1.1.1].
    - Conclusion: don't install pimple/pimple v1.1.0|install pimple/pimple v3.0.0

What am I doing wrong?

simensen commented 9 years ago

This is an interesting Composer problem and I'm not certain that it is behaving as users might expect. The problem is that requiring a package without a version number defaults to the "most recent stable semantic version." In the case of silex/silex, that is ~1.2. In the case of the ORM provider, that is ~2.0. It looks like it decides on these independent from each other.

The problem is that the 2.0.x version of the ORM provider only works with Silex 2. However, there are no stable versions of silex/silex available for 2.0.x.

You have to decide if you want stable silex ( ~1.2 ) or if you want to use the most recent silex ( ~2.0@dev ). If you want stable silex, then you need to specify an older version of the ORM provider. If you want the mot recent silex, you need to allow for @dev stability for silex.

# Stable Silex and an older stable version of the ORM provider.
$ composer require silex/silex dflydev/doctrine-orm-service-provider:~1.0

# Unstable version fo Silex and the most recent version of the ORM provider.
$ composer require silex/silex:~2.0@dev dflydev/doctrine-orm-service-provider
mrkrstphr commented 9 years ago

That's what I ended up doing to install it. It's a bummer that Composer doesn't figure which stable versions work together for you.

Thanks for the tip!