From e6c9a31c54e9da1d57315e7d7eae3dbd1e359d62 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 1 Jun 2011 16:26:21 +0000 Subject: [PATCH] Implemented FR #54561 (Expose ICU Version & ICU Data Version info). --- NEWS | 1 + ext/intl/php_intl.c | 4 ++++ ext/intl/tests/intl_icu_version_constant.phpt | 10 ++++++++++ 3 files changed, 15 insertions(+) create mode 100644 ext/intl/tests/intl_icu_version_constant.phpt diff --git a/NEWS b/NEWS index 34b2c8b9bf..8dae6c4b7d 100644 --- 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 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-- + +--FILE-- + +--EXPECT-- +bool(true) -- 2.40.0