Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer: how to install `dev` packages in Symfony 2.3?

Trying to install the KnpGaufretteBundle in a Symfony 2.3 project, I'm having no luck. The problem is:

  1. minimum-stability:stable (in composer.json);
  2. the bundle I require is dev-master version still.

Reading this in the Symfony docs was frustrating:

If you know of a cool bundle or PHP library that still requires a dev minimum stability, talk to the lead developer and convince him to tag a stable release.

I'm not changing the minimum stability of the whole project to dev, as it would certainly make a huge mess - I mean, can't I use stable packages and dev packages side by side?

Am I missing something about composer maybe?


Edit (14 August 2013)

According to Sven's answer below, I've edited my composer.json (you can find it here) and it started to work. Anyway, this is a partial solution, because inline aliases do not work for dependencies - so in my case I'd have to specify all dependencies of "less-than-stable" packages first, and alias them one by one.

like image 505
Paolo Stefan Avatar asked Aug 13 '13 16:08

Paolo Stefan


2 Answers

just use

"knplabs/knp-gaufrette-bundle": "dev-master@dev" 

if you need the latest dev version

you can also change minimum-stability to dev and add "prefer-stable": true like this:

"minimum-stability": "dev",
"prefer-stable": true,

then composer will always try to find a stable version and if nothing found install dev, so your symfony packages will be still stable. But in your case composer will install v0.1.4 (latest stable of knplabs/knp-gaufrette-bundle), so you need dev-master@dev anyway. prefer-stable is just a hint for you.

like image 161
Lazy Ants Avatar answered Nov 10 '22 17:11

Lazy Ants


Have a look at aliases: http://getcomposer.org/doc/articles/aliases.md

They are supposed to allow you to address a branch (which by definition is always in development, because you can only access the latest commit) in a way that that branch should be the logical extension of a version tag.

For a yet untagged project, a proper assumed tag version would be like "0.0.0".

You should try the inline alias for the bundle.

like image 1
Sven Avatar answered Nov 10 '22 19:11

Sven