Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
trying to document stabilities clearly in the versions article
  • Loading branch information
alcohol committed Jun 30, 2015
1 parent 5b377a3 commit 20b35db
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions doc/articles/versions.md
Expand Up @@ -4,13 +4,6 @@

# Versions

## Test version constraints

You can test version constraints using [semver.mwl.be](http://semver.mwl.be).
Fill in a package name and it will autofill the default version constraint
which Composer would add to your `composer.json` file. You can adjust the
version constraint and the tool will highlight all releases that match.

## Basic Constraints

### Exact
Expand Down Expand Up @@ -86,3 +79,33 @@ break backwards compatibility. For pre-1.0 versions it also acts with safety
in mind and treats `^0.3` as `>=0.3.0 <0.4.0`.

Example: `^1.2.3`

### Stability

If you are using a constraint that does not explicitly define a stability,
Composer will default interally to `-dev` or `-stable`, depending on the
operator(s) used. This happens transparently.

If you wish to explicitly consider only the stable release in the comparison,
add the suffix `-stable`.

Examples:

Constraint | Internally
----------------------------------------------
`1.2.3` | `=1.2.3.0-stable`
`>1.2` | `>1.2.0.0-stable`
`>=1.2` | `>=1.2.0.0-dev`
`>=1.2-stable` | `>=1.2.0.0-stable`
`<1.3` | `<1.3.0.0-dev`
`<=1.3` | `<=1.3.0.0-stable`
`1 - 2` | `>=1.0.0.0-dev <3.0.0.0-dev`
`~1.3` | `>=1.3.0.0-dev <2.0.0.0-dev`
`1.4.*` | `>=1.4.0.0-dev <1.5.0.0-dev`

## Test version constraints

You can test version constraints using [semver.mwl.be](http://semver.mwl.be).
Fill in a package name and it will autofill the default version constraint
which Composer would add to your `composer.json` file. You can adjust the
version constraint and the tool will highlight all releases that match.

0 comments on commit 20b35db

Please sign in to comment.