/** * Resets the internal state. */ private static function reset() { self::$currencyBundle = null; self::$languageBundle = null; self::$localeBundle = null; self::$regionBundle = null; self::$icuVersion = false; self::$icuDataVersion = false; self::$entryReader = null; }
/** * Returns the version of the installed ICU library. * * @return null|string The ICU version or NULL if it could not be determined. */ public static function getIcuVersion() { if (false === self::$icuVersion) { if (!self::isExtensionLoaded()) { self::$icuVersion = self::getIcuStubVersion(); } elseif (defined('INTL_ICU_VERSION')) { self::$icuVersion = INTL_ICU_VERSION; } else { try { $reflector = new \ReflectionExtension('intl'); ob_start(); $reflector->info(); $output = strip_tags(ob_get_clean()); preg_match('/^ICU version (?:=>)?(.*)$/m', $output, $matches); self::$icuVersion = trim($matches[1]); } catch (\ReflectionException $e) { self::$icuVersion = null; } } } return self::$icuVersion; }