Merge "(bug 43801) add a getter for ICU version to ICUCollation"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 6 Feb 2013 19:35:36 +0000 (19:35 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 6 Feb 2013 19:35:36 +0000 (19:35 +0000)
includes/Collation.php

index 7c2c05e..7879ebe 100644 (file)
@@ -392,4 +392,20 @@ class IcuCollation extends Collation {
                }
                return false;
        }
+
+       /**
+        * Return the version of ICU library used by PHP's intl extension,
+        * or false when the extension is not installed of the version
+        * can't be determined.
+        *
+        * The constant INTL_ICU_VERSION this function refers to isn't really
+        * documented. It is available since PHP 5.3.7 (see PHP bug 54561).
+        * This function will return false on older PHPs.
+        *
+        * @since 1.21
+        * @return string|false
+        */
+       static function getICUVersion() {
+               return defined( 'INTL_ICU_VERSION' ) ? INTL_ICU_VERSION : false;
+       }
 }