示例#1
0
 protected function getIntlExtensionIcuVersion()
 {
     if (isset(self::$icuVersion)) {
         return self::$icuVersion;
     }
     if (!$this->isIntlExtensionLoaded()) {
         throw new \RuntimeException('The intl extension is not available');
     }
     ob_start();
     phpinfo(INFO_MODULES);
     $output = ob_get_clean();
     preg_match('/^ICU version => (.*)$/m', $output, $matches);
     self::$icuVersion = $matches[1];
     return self::$icuVersion;
 }
示例#2
0
 protected function getIntlExtensionIcuVersion()
 {
     if (isset(self::$icuVersion)) {
         return self::$icuVersion;
     }
     if (!$this->isIntlExtensionLoaded()) {
         throw new \RuntimeException('The intl extension is not available');
     }
     if (defined('INTL_ICU_VERSION')) {
         return INTL_ICU_VERSION;
     }
     $reflector = new \ReflectionExtension('intl');
     ob_start();
     $reflector->info();
     $output = ob_get_clean();
     preg_match('/^ICU version => (.*)$/m', $output, $matches);
     self::$icuVersion = $matches[1];
     return self::$icuVersion;
 }