Browse Source

Remove datefmt_set_timezone_id and OO variant

pull/1213/head
Nikita Popov 11 years ago
parent
commit
cf0ffa8e4c
  1. 4
      NEWS
  2. 5
      UPGRADING
  3. 14
      ext/intl/dateformat/dateformat_attrcpp.cpp
  4. 2
      ext/intl/dateformat/dateformat_attrcpp.h
  5. 1
      ext/intl/dateformat/dateformat_class.c
  6. 12
      ext/intl/doc/datefmt_api.php
  7. 1
      ext/intl/php_intl.c
  8. 22
      ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt
  9. 4
      ext/intl/tests/dateformat_set_timezone_id2.phpt
  10. 4
      ext/intl/tests/dateformat_set_timezone_id3.phpt
  11. 2
      ext/intl/tests/ut_common.inc

4
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)

5
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().

14
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;

2
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);

1
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 )

12
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:

1
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 )

22
ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt

@ -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==

4
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
-----------

4
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
-----------

2
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 )
{

Loading…
Cancel
Save