diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index 1e680e3b5..6d6e04d2f 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -158,15 +158,10 @@ class PlatformRepository extends ArrayRepository break; case 'imagick': - $reflector = new \ReflectionExtension('imagick'); - - ob_start(); - $reflector->info(); - $output = ob_get_clean(); - - preg_match('/^(Imagick using ImageMagick library version|ImageMagick version) => ImageMagick ([\d.]+)-(\d+)/m', $output, $matches); + $imagick = new \Imagick(); + $imageMagickVersion = $imagick->getVersion(); + preg_match('/^ImageMagick ([\d.]+)-(\d+)/', $imageMagickVersion['versionString'], $matches); $prettyVersion = "{$matches[1]}.{$matches[2]}"; - break; case 'libxml':