1
0
Fork 0

Use new version parser in PlatformRepository

pull/19/head
Jordi Boggiano 2011-09-21 23:03:59 +02:00
parent cd80f22781
commit e700e6fcd9
1 changed files with 5 additions and 3 deletions

View File

@ -25,10 +25,12 @@ class PlatformRepository extends ArrayRepository
{ {
parent::initialize(); parent::initialize();
$versionParser = new VersionParser();
try { try {
$version = BasePackage::parseVersion(PHP_VERSION); $version = $versionParser->parse(PHP_VERSION);
} catch (\UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {
$version = BasePackage::parseVersion(preg_replace('#^(.+?)(-.+)?$#', '$1', PHP_VERSION)); $version = $versionParser->parse(preg_replace('#^(.+?)(-.+)?$#', '$1', PHP_VERSION));
} }
$php = new MemoryPackage('php', $version['version'], $version['type']); $php = new MemoryPackage('php', $version['version'], $version['type']);
@ -41,7 +43,7 @@ class PlatformRepository extends ArrayRepository
$reflExt = new \ReflectionExtension($ext); $reflExt = new \ReflectionExtension($ext);
try { try {
$version = BasePackage::parseVersion($reflExt->getVersion()); $version = $versionParser->parse($reflExt->getVersion());
} catch (\UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {
$version = array('version' => '0', 'type' => 'stable'); $version = array('version' => '0', 'type' => 'stable');
} }