better phrasing / structure + moved version testing link
parent
10b813fc40
commit
50db9393e5
|
@ -2,11 +2,12 @@
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
If you have not yet installed Composer, refer to the [Intro](00-intro.md)
|
For our basic usage introduction, we will be installing `monolog/monolog`,
|
||||||
chapter. For our basic usage introduction, we will be installing
|
a logging library. If you have not yet installed Composer, refer to the
|
||||||
`monolog/monolog`, a logging library. Note that for the sake of simplicity,
|
[Intro](00-intro.md) chapter.
|
||||||
this introduction will assume you have performed a [local](00-intro.md#locally)
|
|
||||||
install of Composer.
|
> **Note:** for the sake of simplicity, this introduction will assume you
|
||||||
|
> have performed a [local](00-intro.md#locally) install of Composer.
|
||||||
|
|
||||||
## `composer.json`: Project Setup
|
## `composer.json`: Project Setup
|
||||||
|
|
||||||
|
@ -62,36 +63,6 @@ do so using [stability flags](04-schema.md#package-links). To change that for
|
||||||
all packages instead of doing per dependency you can also use the
|
all packages instead of doing per dependency you can also use the
|
||||||
[minimum-stability](04-schema.md#minimum-stability) setting.
|
[minimum-stability](04-schema.md#minimum-stability) setting.
|
||||||
|
|
||||||
If you are using range comparisons when selecting non-stable packages, and you
|
|
||||||
specify a numeric version number (that is, no suffix indicating alpha, beta,
|
|
||||||
rc, or stable), then both non-stable and stable versions of a particular
|
|
||||||
release number will be treated as equally valid.
|
|
||||||
|
|
||||||
* `>=`/`<=` will accept non-stable releases as well as the stable release.
|
|
||||||
* `<`/`>` will reject non-stable releasese as well as the stable release.
|
|
||||||
|
|
||||||
If you wish to consider only the stable release in the comparison, add the
|
|
||||||
suffix `-stable` to the version number.
|
|
||||||
|
|
||||||
Here are some examples:
|
|
||||||
|
|
||||||
Example | Interpretation
|
|
||||||
--------------- | --------------
|
|
||||||
`>=1.0.0` | Any release, stable or non-, of 1.0.0 will be allowed
|
|
||||||
`>=1.0.0-stable` | Only the stable release of 1.0.0 will be allowed
|
|
||||||
`<2.0.0` | Neither release, stable or non-, of 2.0.0 will be allowed
|
|
||||||
`<2.0.0-stable` | Only the stable release of 2.0.0 will be disallowed; non-stable releases will be allowed
|
|
||||||
|
|
||||||
Note that the packages matched by these constraints are still checked against
|
|
||||||
the `minimum-stability` setting and each package's stability flags.
|
|
||||||
|
|
||||||
### 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.
|
|
||||||
|
|
||||||
## Installing Dependencies
|
## Installing Dependencies
|
||||||
|
|
||||||
To install the defined dependencies for your project, just run the
|
To install the defined dependencies for your project, just run the
|
||||||
|
|
|
@ -18,12 +18,18 @@ Example: `1.0.2`
|
||||||
### Range
|
### Range
|
||||||
|
|
||||||
By using comparison operators you can specify ranges of valid versions. Valid
|
By using comparison operators you can specify ranges of valid versions. Valid
|
||||||
operators are `>`, `>=`, `<`, `<=`, `!=`. <br />You can define multiple ranges.
|
operators are `>`, `>=`, `<`, `<=`, `!=`.
|
||||||
Ranges separated by a space (<code> </code>) or comma (`,`) will be treated as
|
|
||||||
a **logical AND**. A double pipe (<code>||</code>) will be treated as
|
|
||||||
a **logical OR**. AND has higher precedence than OR.
|
|
||||||
|
|
||||||
Example: `>=1.0` `>=1.0 <2.0` `>=1.0 <1.1 || >=1.2`
|
You can define multiple ranges. Ranges separated by a space (<code> </code>) or
|
||||||
|
comma (`,`) will be treated as a **logical AND**. A double pipe
|
||||||
|
(<code>||</code>) will be treated as a **logical OR**. AND has higher
|
||||||
|
precedence than OR.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
* `>=1.0`
|
||||||
|
* `>=1.0 <2.0`
|
||||||
|
* `>=1.0 <1.1 || >=1.2`
|
||||||
|
|
||||||
### Range (Hyphen)
|
### Range (Hyphen)
|
||||||
|
|
||||||
|
@ -97,3 +103,11 @@ Examples:
|
||||||
`1 - 2` | `>=1.0.0.0-dev <3.0.0.0-dev`
|
`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.3` | `>=1.3.0.0-dev <2.0.0.0-dev`
|
||||||
`1.4.*` | `>=1.4.0.0-dev <1.5.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.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue