1
0
Fork 0

Use ReflectionExtension to read ext versions

pull/1/head
Jordi Boggiano 2011-06-08 11:41:52 +02:00
parent 3524d0388a
commit ae922eaf4c
1 changed files with 9 additions and 2 deletions

View File

@ -36,8 +36,15 @@ class PlatformRepository extends ArrayRepository
if (in_array($ext, array('standard', 'Core'))) {
continue;
}
// TODO maybe we could parse versions from phpinfo(INFO_MODULES)
$ext = new MemoryPackage('ext/'.strtolower($ext), '0', 'stable');
$reflExt = new \ReflectionExtension($ext);
try {
$version = BasePackage::parseVersion($reflExt->getVersion());
} catch (\UnexpectedValueException $e) {
$version = array('version' => '0', 'type' => 'stable');
}
$ext = new MemoryPackage('ext/'.strtolower($ext), $version['version'], $version['type']);
$this->addPackage($ext);
}
}