Merge remote-tracking branch 'origin/master'

main
Jordi Boggiano 11 years ago
commit f8be812a49

@ -58,31 +58,31 @@ smaller decoupled parts.
### Package Versions ### Package Versions
We are requiring version `1.0.*` of monolog. This means any version in the `1.0` In the previous example we were requiring version `1.0.*` of monolog. This
development branch. It would match `1.0.0`, `1.0.2` or `1.0.20`. means any version in the `1.0` development branch. It would match `1.0.0`,
`1.0.2` or `1.0.20`.
Version constraints can be specified in a few different ways. Version constraints can be specified in a few different ways.
* **Exact version:** You can specify the exact version of a package, for Name | Example | Description
example `1.0.2`. -------------- | --------------------- | -----------
Exact version | `1.0.2` | You can specify the exact version of a package.
* **Range:** By using comparison operators you can specify ranges of valid Range | `>=1.0` `>=1.0,<2.0` `>=1.0,<1.1 | >=1.2` | By using comparison operators you can specify ranges of valid versions. Valid operators are `>`, `>=`, `<`, `<=`, `!=`. <br />You can define multiple ranges, separated by a comma, which will be treated as a **logical AND**. A pipe symbol `|` will be treated as a **logical OR**. <br />AND has higher precedence than OR.
versions. Valid operators are `>`, `>=`, `<`, `<=`, `!=`. An example range Wildcard | `1.0.*` | You can specify a pattern with a `*` wildcard. `1.0.*` is the equivalent of `>=1.0,<1.1`.
would be `>=1.0`. You can define multiple ranges, separated by a comma: Tilde Operator | `~1.2` | Very useful for projects that follow semantic versioning. `~1.2` is equivalent to `>=1.2,<2.0`. For more details, read the next section below.
`>=1.0,<2.0`.
### Next Significant Release (Tilde Operator)
* **Wildcard:** You can specify a pattern with a `*` wildcard. `1.0.*` is the
equivalent of `>=1.0,<1.1`. The `~` operator is best explained by example: `~1.2` is equivalent to
`>=1.2,<2.0`, while `~1.2.3` is equivalent to `>=1.2.3,<1.3`. As you can see
* **Next Significant Release (Tilde Operator):** The `~` operator is best it is mostly useful for projects respecting [semantic
explained by example: `~1.2` is equivalent to `>=1.2,<2.0`, while `~1.2.3` is versioning](http://semver.org/). A common usage would be to mark the minimum
equivalent to `>=1.2.3,<1.3`. As you can see it is mostly useful for projects minor version you depend on, like `~1.2` (which allows anything up to, but not
respecting [semantic versioning](http://semver.org/). A common usage would be including, 2.0). Since in theory there should be no backwards compatibility
to mark the minimum minor version you depend on, like `~1.2` (which allows breaks until 2.0, that works well. Another way of looking at it is that using
anything up to, but not including, 2.0). Since in theory there should be no `~` specifies a minimum version, but allows the last digit specified to go up.
backwards compatibility breaks until 2.0, that works well. Another way of
looking at it is that using `~` specifies a minimum version, but allows the ### Stability
last digit specified to go up.
By default only stable releases are taken into consideration. If you would like By default only stable releases are taken into consideration. If you would like
to also get RC, beta, alpha or dev versions of your dependencies you can do to also get RC, beta, alpha or dev versions of your dependencies you can do

@ -144,5 +144,19 @@ class PlatformRepository extends ArrayRepository
$lib->setDescription('The '.$name.' PHP library'); $lib->setDescription('The '.$name.' PHP library');
parent::addPackage($lib); parent::addPackage($lib);
} }
if (defined('HPHP_VERSION')) {
try {
$prettyVersion = HPHP_VERSION;
$version = $versionParser->normalize($prettyVersion);
} catch (\UnexpectedValueException $e) {
$prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', HPHP_VERSION);
$version = $versionParser->normalize($prettyVersion);
}
$hhvm = new CompletePackage('hhvm', $version, $prettyVersion);
$hhvm->setDescription('The HHVM Runtime (64bit)');
parent::addPackage($hhvm);
}
} }
} }

@ -38,7 +38,7 @@ class ErrorHandlerTest extends TestCase
*/ */
public function testErrorHandlerCaptureWarning() public function testErrorHandlerCaptureWarning()
{ {
$this->setExpectedException('\ErrorException', 'array_merge(): Argument #2 is not an array'); $this->setExpectedException('\ErrorException', 'array_merge');
ErrorHandler::register(); ErrorHandler::register();

@ -192,6 +192,6 @@ class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
); );
$context = StreamContextFactory::getContext('http://example.org', $options); $context = StreamContextFactory::getContext('http://example.org', $options);
$ctxoptions = stream_context_get_options($context); $ctxoptions = stream_context_get_options($context);
$this->assertEquals(join("\n", $ctxoptions['http']['header']), join("\n", $expectedOptions['http']['header'])); $this->assertEquals(end($ctxoptions['http']['header']), end($expectedOptions['http']['header']));
} }
} }

Loading…
Cancel
Save