diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2011-06-01 16:26:21 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2011-06-01 16:26:21 +0000 |
commit | e6c9a31c54e9da1d57315e7d7eae3dbd1e359d62 (patch) | |
tree | 77da17bcb726a8564177b10f2f978cdf200abb48 | |
parent | 83d01bd81b605bea1d3be624f3422d5352b39f6d (diff) | |
download | php-git-e6c9a31c54e9da1d57315e7d7eae3dbd1e359d62.tar.gz |
Implemented FR #54561 (Expose ICU Version & ICU Data Version info).
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | ext/intl/php_intl.c | 4 | ||||
-rw-r--r-- | ext/intl/tests/intl_icu_version_constant.phpt | 10 |
3 files changed, 15 insertions, 0 deletions
@@ -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 diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index a9bfefd14c..1b2b0c69dc 100755 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -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 index 0000000000..13160693c2 --- /dev/null +++ b/ext/intl/tests/intl_icu_version_constant.phpt @@ -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) |