diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index ef33e8cfc..c796f43ce 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -70,6 +70,7 @@ class PlatformRepository extends ArrayRepository // Doing it this way to know that functions or constants exist before // relying on them. foreach ($loadedExtensions as $name) { + $prettyVersion = null; switch ($name) { case 'curl': $curlVersion = curl_version(); @@ -80,6 +81,23 @@ class PlatformRepository extends ArrayRepository $prettyVersion = ICONV_VERSION; break; + case 'intl': + $name = 'ICU'; + if (defined('INTL_ICU_VERSION')) { + $prettyVersion = INTL_ICU_VERSION; + } else { + $reflector = new \ReflectionExtension('intl'); + + ob_start(); + $reflector->info(); + $output = ob_get_clean(); + + preg_match('/^ICU version => (.*)$/m', $output, $matches); + $prettyVersion = $matches[1]; + } + + break; + case 'libxml': $prettyVersion = LIBXML_DOTTED_VERSION; break;