From cf0ffa8e4c0bb92bfae60963a6e4c0dea00bd003 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 1 Apr 2015 12:31:21 +0200 Subject: [PATCH] Remove datefmt_set_timezone_id and OO variant --- NEWS | 4 ++++ UPGRADING | 5 +++++ ext/intl/dateformat/dateformat_attrcpp.cpp | 14 +----------- ext/intl/dateformat/dateformat_attrcpp.h | 2 -- ext/intl/dateformat/dateformat_class.c | 1 - ext/intl/doc/datefmt_api.php | 12 ---------- ext/intl/php_intl.c | 1 - .../dateformat_setTimeZoneID_deprecation.phpt | 22 ------------------- .../tests/dateformat_set_timezone_id2.phpt | 4 ++-- .../tests/dateformat_set_timezone_id3.phpt | 4 ++-- ext/intl/tests/ut_common.inc | 2 +- 11 files changed, 15 insertions(+), 56 deletions(-) delete mode 100644 ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt diff --git a/NEWS b/NEWS index 5e44a7938c0..1e6b646bf4d 100644 --- a/NEWS +++ b/NEWS @@ -98,6 +98,10 @@ . Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright) . Implement request #67106 (Split main fpm config). (Elan Ruusamäe, Remi) +- Intl: + . Removed deprecated aliases datefmt_set_timezone_id() and + IntlDateFormatter::setTimeZoneID(). (Nikita) + - JSON . Replace non-free JSON parser with a parser from Jsond extension, fixes #63520 (JSON extension includes a problematic license statement). (Jakub Zelenka) diff --git a/UPGRADING b/UPGRADING index b13bd709324..eca46ca8157 100644 --- a/UPGRADING +++ b/UPGRADING @@ -432,6 +432,11 @@ Other . gmp_setbit() and gmp_clrbit() now return FALSE for negative indices, making them consistent with other GMP functions. +- Intl: + . Removed deprecated aliases datefmt_set_timezone_id() and + IntlDateFormatter::setTimeZoneID(). Use datefmt_set_timezone() and + IntlDateFormatter::setTimeZone() instead. + - Mcrypt . Removed deprecated mcrypt_generic_end() alias in favor of mcrypt_generic_deinit(). diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index 1b9716eceb4..8320904b63a 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.cpp +++ b/ext/intl/dateformat/dateformat_attrcpp.cpp @@ -98,20 +98,8 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone) timezone_object_construct(tz_clone, return_value, 1); } -U_CFUNC PHP_FUNCTION(datefmt_set_timezone_id) -{ - php_error_docref0(NULL, E_DEPRECATED, - "Use datefmt_set_timezone() instead, which also accepts a plain " - "time zone identifier and for which this function is now an " - "alias"); - PHP_FN(datefmt_set_timezone)(INTERNAL_FUNCTION_PARAM_PASSTHRU); -} - /* {{{ proto boolean IntlDateFormatter::setTimeZone(mixed $timezone) - * Set formatter's timezone. }}} */ -/* {{{ proto boolean datefmt_set_timezone_id(IntlDateFormatter $mf, $timezone_id) - * Set formatter timezone_id. - */ + * Set formatter's timezone. */ U_CFUNC PHP_FUNCTION(datefmt_set_timezone) { zval *timezone_zv; diff --git a/ext/intl/dateformat/dateformat_attrcpp.h b/ext/intl/dateformat/dateformat_attrcpp.h index 54536f21fa8..c8e4e5b702c 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.h +++ b/ext/intl/dateformat/dateformat_attrcpp.h @@ -19,8 +19,6 @@ PHP_FUNCTION(datefmt_get_timezone_id); -PHP_FUNCTION(datefmt_set_timezone_id); - PHP_FUNCTION(datefmt_get_timezone); PHP_FUNCTION(datefmt_set_timezone); diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c index afdde13dece..3b1345f2c90 100644 --- a/ext/intl/dateformat/dateformat_class.c +++ b/ext/intl/dateformat/dateformat_class.c @@ -167,7 +167,6 @@ static zend_function_entry IntlDateFormatter_class_functions[] = { PHP_NAMED_FE( getCalendarObject, ZEND_FN( datefmt_get_calendar_object ), arginfo_intldateformatter_getdatetype ) PHP_NAMED_FE( setCalendar, ZEND_FN( datefmt_set_calendar ), arginfo_intldateformatter_setcalendar ) PHP_NAMED_FE( getTimeZoneId, ZEND_FN( datefmt_get_timezone_id ), arginfo_intldateformatter_getdatetype ) - PHP_NAMED_FE( setTimeZoneId, ZEND_FN( datefmt_set_timezone_id ), arginfo_intldateformatter_settimezoneid ) PHP_NAMED_FE( getTimeZone, ZEND_FN( datefmt_get_timezone ), arginfo_intldateformatter_getdatetype ) PHP_NAMED_FE( setTimeZone, ZEND_FN( datefmt_set_timezone ), arginfo_intldateformatter_settimezoneid ) PHP_NAMED_FE( setPattern, ZEND_FN( datefmt_set_pattern ), arginfo_intldateformatter_setpattern ) diff --git a/ext/intl/doc/datefmt_api.php b/ext/intl/doc/datefmt_api.php index 2084e1a2c87..6beb2438635 100644 --- a/ext/intl/doc/datefmt_api.php +++ b/ext/intl/doc/datefmt_api.php @@ -365,18 +365,6 @@ class DateFormatter { function datefmt_get_timezone_id($fmt) {} - /** - * Sets the time zone to use - * @param DateFormatter $fmt The date formatter resource - * @param string $zone zone ID string of the time zone to use. - * if null or the empty string, the default time zone for - * the runtime is used. - * @return boolean 'true' on successful setting of the time zone, 'false' - * if an error occurred (such as the time zone wasn't recognized). - */ - function datefmt_set_timezone_id($fmt , $zone) {} - - /** * Sets the calendar used to the appropriate calendar, which must be * one of the constants defined above. Some examples include: diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index e20816e34e9..12bd9fdc74f 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -715,7 +715,6 @@ zend_function_entry intl_functions[] = { PHP_FE( datefmt_set_calendar, arginfo_datefmt_set_calendar ) PHP_FE( datefmt_get_locale, arginfo_msgfmt_get_locale ) PHP_FE( datefmt_get_timezone_id, arginfo_msgfmt_get_locale ) - PHP_FE( datefmt_set_timezone_id, arginfo_datefmt_set_timezone ) PHP_FE( datefmt_get_timezone, arginfo_msgfmt_get_locale ) PHP_FE( datefmt_set_timezone, arginfo_datefmt_set_timezone ) PHP_FE( datefmt_get_pattern, arginfo_msgfmt_get_locale ) diff --git a/ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt b/ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt deleted file mode 100644 index 5ee5b94d244..00000000000 --- a/ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -IntlDateFormatter: setTimeZoneID() deprecation ---SKIPIF-- -setTimeZoneId('Europe/Madrid'); - -?> -==DONE== ---EXPECTF-- - -Deprecated: IntlDateFormatter::setTimeZoneId(): Use datefmt_set_timezone() instead, which also accepts a plain time zone identifier and for which this function is now an alias in %s on line %d -==DONE== diff --git a/ext/intl/tests/dateformat_set_timezone_id2.phpt b/ext/intl/tests/dateformat_set_timezone_id2.phpt index d59c8045e4a..a706ee763b9 100644 --- a/ext/intl/tests/dateformat_set_timezone_id2.phpt +++ b/ext/intl/tests/dateformat_set_timezone_id2.phpt @@ -60,9 +60,9 @@ ut_run(); ?> --EXPECTF-- -Warning: IntlDateFormatter::setTimeZoneId(): datefmt_set_timezone: no such time zone: 'CN' in %s on line %d +Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: no such time zone: 'CN' in %s on line %d -Warning: datefmt_set_timezone_id(): datefmt_set_timezone: no such time zone: 'CN' in %s on line %d +Warning: datefmt_set_timezone(): datefmt_set_timezone: no such time zone: 'CN' in %s on line %d After creation of the dateformatter : timezone_id= US/Pacific ----------- diff --git a/ext/intl/tests/dateformat_set_timezone_id3.phpt b/ext/intl/tests/dateformat_set_timezone_id3.phpt index b3968f9ac01..e25b9bfd7ec 100644 --- a/ext/intl/tests/dateformat_set_timezone_id3.phpt +++ b/ext/intl/tests/dateformat_set_timezone_id3.phpt @@ -58,9 +58,9 @@ include_once( 'ut_common.inc' ); ut_run(); ?> --EXPECTF-- -Warning: IntlDateFormatter::setTimeZoneId(): datefmt_set_timezone: no such time zone: 'CN' in %sut_common.inc on line %d +Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: no such time zone: 'CN' in %sut_common.inc on line %d -Warning: datefmt_set_timezone_id(): datefmt_set_timezone: no such time zone: 'CN' in %sut_common.inc on line %d +Warning: datefmt_set_timezone(): datefmt_set_timezone: no such time zone: 'CN' in %sut_common.inc on line %d After creation of the dateformatter : timezone_id= US/Pacific ----------- diff --git a/ext/intl/tests/ut_common.inc b/ext/intl/tests/ut_common.inc index 9f72bacae4d..1b82cfa56c3 100644 --- a/ext/intl/tests/ut_common.inc +++ b/ext/intl/tests/ut_common.inc @@ -363,7 +363,7 @@ function ut_datefmt_get_timezone_id( $fmt ) } function ut_datefmt_set_timezone_id( $fmt ,$timezone_id ) { - return $GLOBALS['oo-mode'] ? $fmt->setTimeZoneId( $timezone_id ) : datefmt_set_timezone_id( $fmt ,$timezone_id); + return $GLOBALS['oo-mode'] ? $fmt->setTimeZone( $timezone_id ) : datefmt_set_timezone( $fmt ,$timezone_id); } function ut_datefmt_get_pattern( $fmt ) {