Issue
I have this line in my composer.json file:
"require": {
...
"friendsofsymfony/user-bundle": "~2.0@dev",
...
},
What does the tilde ~ in ~2.0@dev exactly mean? Is that a placeholder and shall always fetch the subversions like 1.2.0, 2.2.0, 3.2.0 and so on? Doesn't make sense (and would be done by the * wildcard).
The composer.json documentation doesn't tell anything about the tilde.
I am asking because I just read about a security issue in the Symfony blog and they recommend to upgrade to version 1.3.3. But figuring out the FOSUserBundle's version isn't that easy (I couldn't find a file that contains the version).
Solution
Tilde means next significant release. In your case, it is equivalent to >= 2.0, < 3.0.
The full explanation is at Tilde Version Range docs page:
The
~operator is best explained by example:~1.2is equivalent to>=1.2 <2.0.0, while~1.2.3is equivalent to>=1.2.3 <1.3.0.Another way of looking at it is that using
~specifies a minimum version, but allows the last digit specified to go up.
Seldeak's below comment is a simple sum up explanation of the Composer documentation.
Answered By - AlterPHP Answer Checked By - David Goodson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.