diff options
author | Nikita Popov <nikic@php.net> | 2015-04-01 12:31:21 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2015-04-01 12:34:28 +0200 |
commit | cf0ffa8e4c0bb92bfae60963a6e4c0dea00bd003 (patch) | |
tree | 5af5359afdfd36b395d72097a0f673ce07439529 /ext/intl | |
parent | acfc31c0f803601f49a4d512d73968f50924a68c (diff) | |
download | php-git-cf0ffa8e4c0bb92bfae60963a6e4c0dea00bd003.tar.gz |
Remove datefmt_set_timezone_id and OO variant
Diffstat (limited to 'ext/intl')
-rw-r--r-- | ext/intl/dateformat/dateformat_attrcpp.cpp | 14 | ||||
-rw-r--r-- | ext/intl/dateformat/dateformat_attrcpp.h | 2 | ||||
-rw-r--r-- | ext/intl/dateformat/dateformat_class.c | 1 | ||||
-rw-r--r-- | ext/intl/doc/datefmt_api.php | 12 | ||||
-rw-r--r-- | ext/intl/php_intl.c | 1 | ||||
-rw-r--r-- | ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt | 22 | ||||
-rw-r--r-- | ext/intl/tests/dateformat_set_timezone_id2.phpt | 4 | ||||
-rw-r--r-- | ext/intl/tests/dateformat_set_timezone_id3.phpt | 4 | ||||
-rw-r--r-- | ext/intl/tests/ut_common.inc | 2 |
9 files changed, 6 insertions, 56 deletions
diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index 1b9716eceb..8320904b63 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 54536f21fa..c8e4e5b702 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 afdde13dec..3b1345f2c9 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 2084e1a2c8..6beb243863 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 e20816e34e..12bd9fdc74 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 5ee5b94d24..0000000000 --- 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 d59c8045e4..a706ee763b 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 b3968f9ac0..e25b9bfd7e 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 9f72bacae4..1b82cfa56c 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 ) { |