]> granicus.if.org Git - php/commitdiff
Implemented FR #54561 (Expose ICU Version & ICU Data Version info).
authorIlia Alshanetsky <iliaa@php.net>
Wed, 1 Jun 2011 16:26:21 +0000 (16:26 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 1 Jun 2011 16:26:21 +0000 (16:26 +0000)
NEWS
ext/intl/php_intl.c
ext/intl/tests/intl_icu_version_constant.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 34b2c8b9bf0a581e14b55def1462b3dfdf8a3ad9..8dae6c4b7d44997971c9f81a9b7bfee6095f0a08 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -90,6 +90,7 @@ PHP                                                                        NEWS
 - intl extension:
   . Implemented FR #54540 (Allow loading of arbitrary resource bundles when
     fallback is disabled). (David Zuelke, Stas)
+  . Implemented FR #54561 (Expose ICU version info). (David Zuelke, Ilia)
 
 - json extension:
   . Fixed bug #54484 (Empty string in json_decode doesn't reset 
index a9bfefd14ca1f52014ad38ed3b9f57c4a8175d19..1b2b0c69dcf48386e92e59417baa713e647fb77f 100755 (executable)
@@ -543,6 +543,10 @@ PHP_MINIT_FUNCTION( intl )
        REGISTER_INI_ENTRIES();
 
        REGISTER_LONG_CONSTANT("INTL_MAX_LOCALE_LEN", INTL_MAX_LOCALE_LEN, CONST_CS);
+       REGISTER_STRING_CONSTANT("INTL_ICU_VERSION", U_ICU_VERSION, CONST_PERSISTENT | CONST_CS);
+#ifdef U_ICU_DATA_VERSION
+       REGISTER_STRING_CONSTANT("INTL_ICU_DATA_VERSION", U_ICU_DATA_VERSION, CONST_PERSISTENT | CONST_CS);
+#endif 
 
        /* Register 'Collator' PHP class */
        collator_register_Collator_class( TSRMLS_C );
diff --git a/ext/intl/tests/intl_icu_version_constant.phpt b/ext/intl/tests/intl_icu_version_constant.phpt
new file mode 100644 (file)
index 0000000..1316069
--- /dev/null
@@ -0,0 +1,10 @@
+--TEST--
+INTL_ICU_VERSION constant
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+var_dump(defined("INTL_ICU_VERSION"));
+?>
+--EXPECT--
+bool(true)