com php-src: Remove datefmt_set_timezone_id and OO variant: NEWS UPGRADING ext/intl/dateformat/dateformat _attrcpp.cpp
ext/intl/dateformat/dateformat_attrcpp.h ext/intl/dateformat/dateformat_class.c ext/intl/doc/da tefmt_api.php ext/intl/php_intl.c ext/intl/tests/da
teformat_setTimeZoneID_deprecation.phpt ext/intl/tests/ dateformat_set_timezone_id2.phpt ext/intl/tests/dat eformat_set_timezone_id3.phpt
ext/intl/tests/ut_c ommon.inc
| From: | Nikita Popov | Date: | Wed, 01 Apr 2015 10:34:28 +0000 |
| Subject: | com php-src: Remove datefmt_set_timezone_id and OO variant: NEWS UPGRADING ext/intl/dateformat/dateformat _attrcpp.cpp ext/intl/dateformat/dateformat_attrcpp.h ext/intl/dateformat/dateformat_class.c ext/intl/doc/da tefmt_api.php ext/intl/php_intl.c ext/intl/tests/da teformat_setTimeZoneID_deprecation.phpt ext/intl/tests/ dateformat_set_timezone_id2.phpt ext/intl/tests/dat eformat_set_timezone_id3.phpt ext/intl/tests/ut_c ommon.inc |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86014@lists.php.net to get a copy of this message | ||
Commit: cf0ffa8e4c0bb92bfae60963a6e4c0dea00bd003
Author: Nikita Popov <nikic@php.net> Wed, 1 Apr 2015 12:31:21 +0200
Parents: acfc31c0f803601f49a4d512d73968f50924a68c
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cf0ffa8e4c0bb92bfae60963a6e4c0dea00bd003
Log:
Remove datefmt_set_timezone_id and OO variant
Changed paths:
M NEWS
M UPGRADING
M ext/intl/dateformat/dateformat_attrcpp.cpp
M ext/intl/dateformat/dateformat_attrcpp.h
M ext/intl/dateformat/dateformat_class.c
M ext/intl/doc/datefmt_api.php
M ext/intl/php_intl.c
D ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt
M ext/intl/tests/dateformat_set_timezone_id2.phpt
M ext/intl/tests/dateformat_set_timezone_id3.phpt
M ext/intl/tests/ut_common.inc
diff --git a/NEWS b/NEWS index 5e44a79..1e6b646 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 b13bd70..eca46ca 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 1b9716e..8320904 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 54536f2..c8e4e5b 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 afdde13..3b1345f 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 2084e1a..6beb243 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 e20816e..12bd9fd 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 5ee5b94..0000000 --- a/ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -IntlDateFormatter: setTimeZoneID() deprecation ---SKIPIF-- -<?php -if (!extension_loaded('intl')) - die('skip intl extension not enabled'); ---FILE-- -<?php -ini_set("intl.error_level", E_WARNING); -ini_set("intl.default_locale", "pt_PT"); -ini_set("date.timezone", 'Atlantic/Azores'); - -$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk'); - -$df->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 d59c804..a706ee7 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 b3968f9..e25b9bf 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 9f72bac..1b82cfa 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 ) {
diff --git a/NEWS b/NEWS index 5e44a79..1e6b646 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 b13bd70..eca46ca 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 1b9716e..8320904 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 54536f2..c8e4e5b 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 afdde13..3b1345f 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 2084e1a..6beb243 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 e20816e..12bd9fd 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 5ee5b94..0000000 --- a/ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -IntlDateFormatter: setTimeZoneID() deprecation ---SKIPIF-- -<?php -if (!extension_loaded('intl')) - die('skip intl extension not enabled'); ---FILE-- -<?php -ini_set("intl.error_level", E_WARNING); -ini_set("intl.default_locale", "pt_PT"); -ini_set("date.timezone", 'Atlantic/Azores'); - -$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk'); - -$df->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 d59c804..a706ee7 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 b3968f9..e25b9bf 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 9f72bac..1b82cfa 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 ) {