cvs: php-src(PHP_5_1) /ext/date php_date.c /ext/date/tests date_default_timezone_get-1.phpt date_default_timezone_get-2.phpt
date_default_timezone_set-1.phpt
| From: | Jani Taskinen | Date: | Wed, 19 Oct 2005 11:18:51 +0000 |
| Subject: | cvs: php-src(PHP_5_1) /ext/date php_date.c /ext/date/tests date_default_timezone_get-1.phpt date_default_timezone_get-2.phpt date_default_timezone_set-1.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-34680@lists.php.net to get a copy of this message | ||
sniper Wed Oct 19 07:18:51 2005 EDT
Modified files: (Branch: PHP_5_1)
/php-src/ext/date php_date.c
/php-src/ext/date/tests date_default_timezone_get-1.phpt
date_default_timezone_get-2.phpt
date_default_timezone_set-1.phpt
Log:
MFH: Fixed error messages and tests
http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.43.2.18&r2=1.43.2.19&ty=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.18 php-src/ext/date/php_date.c:1.43.2.19 --- php-src/ext/date/php_date.c:1.43.2.18 Wed Oct 19 03:22:20 2005 +++ php-src/ext/date/php_date.c Wed Oct 19 07:18:51 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.43.2.18 2005/10/19 07:22:20 derick Exp $ */ +/* $Id: php_date.c,v 1.43.2.19 2005/10/19 11:18:51 sniper Exp $ */ #include "php.h" #include "php_streams.h" @@ -226,6 +226,11 @@ #define DATE_FORMAT_RFC1123 "D, d M Y H:i:s T" #define DATE_FORMAT_RFC2822 "D, d M Y H:i:s O" +#define DATE_TZ_ERRMSG \ + "It is not safe to rely on the system's timezone settings. Please use " \ + "the date.timezone setting, the TZ environment variable or the " \ + "date_default_timezone_set() function. " + /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(date) { @@ -326,7 +331,7 @@ tzid = "UTC"; } - php_error_docref(NULL TSRMLS_CC, E_STRICT, "It is not safe to rely on the system's timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We select '%s' for '%s/%.1f/%s' instead.", tzid, ta->tm_zone, (float) (ta->tm_gmtoff / 3600), ta->tm_isdst ? "DST" : "no DST"); + php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%s/%.1f/%s' instead", tzid, ta->tm_zone, (float) (ta->tm_gmtoff / 3600), ta->tm_isdst ? "DST" : "no DST"); return tzid; } #endif @@ -345,7 +350,7 @@ if (! tzid) { tzid = "UTC"; } - php_error_docref(NULL TSRMLS_CC, E_STRICT, "It is not safe to rely on the system's timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We select '%s' for '%.1f/no DST' instead.", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0)); + php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/no DST' instead", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0)); break; /* DST in effect */ @@ -359,14 +364,14 @@ if (! tzid) { tzid = "UTC"; } - php_error_docref(NULL TSRMLS_CC, E_STRICT, "It is not safe to rely on the system's timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We select '%s' for '%.1f/DST' instead.", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0)); + php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/DST' instead", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0)); break; } return tzid; } #endif /* Fallback to UTC */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "It is not safe to rely on the system's timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We have to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm"); return "UTC"; } @@ -378,7 +383,7 @@ tz = guess_timezone(TSRMLS_C); tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC); if (! tzi) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone."); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone"); tzi = php_date_parse_tzfile("UTC", DATE_TIMEZONEDB TSRMLS_CC); if (! tzi) { @@ -746,7 +751,7 @@ now->h = hou; break; default: - php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead."); + php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead"); } /* Update the timestamp */ if (gmt) { @@ -756,7 +761,7 @@ } /* Support for the deprecated is_dst parameter */ if (dst != -1) { - php_error_docref(NULL TSRMLS_CC, E_STRICT, "The is_dst parameter is deprecated."); + php_error_docref(NULL TSRMLS_CC, E_STRICT, "The is_dst parameter is deprecated"); if (gmt) { /* GMT never uses DST */ if (dst == 1) { http://cvs.php.net/diff.php/php-src/ext/date/tests/date_default_timezone_get-1.phpt?r1=1.2.2.1&r2=1.2.2.2&ty=u Index: php-src/ext/date/tests/date_default_timezone_get-1.phpt diff -u php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.2.2.1 php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.2.2.2 --- php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.2.2.1 Sat Oct 1 11:04:07 2005 +++ php-src/ext/date/tests/date_default_timezone_get-1.phpt Wed Oct 19 07:18:51 2005 @@ -9,8 +9,8 @@ echo date('e'), "\n"; ?> --EXPECTF-- -Strict Standards: date_default_timezone_get(): It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'Europe/London' for 'UTC/0.0/no DST' instead. in %sdate_default_timezone_get-1.php on line 3 +Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 3 Europe/London -Strict Standards: date(): It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'Europe/London' for 'UTC/0.0/no DST' instead. in %sdate_default_timezone_get-1.php on line 4 +Strict Standards: date(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 4 Europe/London http://cvs.php.net/diff.php/php-src/ext/date/tests/date_default_timezone_get-2.phpt?r1=1.2&r2=1.2.2.1&ty=u Index: php-src/ext/date/tests/date_default_timezone_get-2.phpt diff -u php-src/ext/date/tests/date_default_timezone_get-2.phpt:1.2 php-src/ext/date/tests/date_default_timezone_get-2.phpt:1.2.2.1 --- php-src/ext/date/tests/date_default_timezone_get-2.phpt:1.2 Wed Jul 20 06:06:10 2005 +++ php-src/ext/date/tests/date_default_timezone_get-2.phpt Wed Oct 19 07:18:51 2005 @@ -8,5 +8,5 @@ echo date_default_timezone_get(), "\n"; ?> --EXPECTF-- -Notice: date_default_timezone_get(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone. in %sdate_default_timezone_get-2.php on line 3 +Notice: date_default_timezone_get(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in %sdate_default_timezone_get-2.php on line 3 UTC http://cvs.php.net/diff.php/php-src/ext/date/tests/date_default_timezone_set-1.phpt?r1=1.1.2.1&r2=1.1.2.2&ty=u Index: php-src/ext/date/tests/date_default_timezone_set-1.phpt diff -u php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.1.2.1 php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.1.2.2 --- php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.1.2.1 Sat Oct 1 11:04:07 2005 +++ php-src/ext/date/tests/date_default_timezone_set-1.phpt Wed Oct 19 07:18:51 2005 @@ -18,9 +18,9 @@ echo date(DATE_ISO8601, $date4), "\n"; ?> --EXPECTF-- -Strict Standards: strtotime(): It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'Europe/London' for 'UTC/0.0/no DST' instead. in %sdate_default_timezone_set-1.php on line 3 +Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3 -Strict Standards: strtotime(): It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'Europe/London' for 'UTC/0.0/no DST' instead. in %sdate_default_timezone_set-1.php on line 4 +Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 4 America/Indiana/Knox 2005-01-12T03:00:00-0500 2005-07-12T02:00:00-0500
http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.43.2.18&r2=1.43.2.19&ty=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.18 php-src/ext/date/php_date.c:1.43.2.19 --- php-src/ext/date/php_date.c:1.43.2.18 Wed Oct 19 03:22:20 2005 +++ php-src/ext/date/php_date.c Wed Oct 19 07:18:51 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.43.2.18 2005/10/19 07:22:20 derick Exp $ */ +/* $Id: php_date.c,v 1.43.2.19 2005/10/19 11:18:51 sniper Exp $ */ #include "php.h" #include "php_streams.h" @@ -226,6 +226,11 @@ #define DATE_FORMAT_RFC1123 "D, d M Y H:i:s T" #define DATE_FORMAT_RFC2822 "D, d M Y H:i:s O" +#define DATE_TZ_ERRMSG \ + "It is not safe to rely on the system's timezone settings. Please use " \ + "the date.timezone setting, the TZ environment variable or the " \ + "date_default_timezone_set() function. " + /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(date) { @@ -326,7 +331,7 @@ tzid = "UTC"; } - php_error_docref(NULL TSRMLS_CC, E_STRICT, "It is not safe to rely on the system's timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We select '%s' for '%s/%.1f/%s' instead.", tzid, ta->tm_zone, (float) (ta->tm_gmtoff / 3600), ta->tm_isdst ? "DST" : "no DST"); + php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%s/%.1f/%s' instead", tzid, ta->tm_zone, (float) (ta->tm_gmtoff / 3600), ta->tm_isdst ? "DST" : "no DST"); return tzid; } #endif @@ -345,7 +350,7 @@ if (! tzid) { tzid = "UTC"; } - php_error_docref(NULL TSRMLS_CC, E_STRICT, "It is not safe to rely on the system's timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We select '%s' for '%.1f/no DST' instead.", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0)); + php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/no DST' instead", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0)); break; /* DST in effect */ @@ -359,14 +364,14 @@ if (! tzid) { tzid = "UTC"; } - php_error_docref(NULL TSRMLS_CC, E_STRICT, "It is not safe to rely on the system's timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We select '%s' for '%.1f/DST' instead.", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0)); + php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/DST' instead", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0)); break; } return tzid; } #endif /* Fallback to UTC */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "It is not safe to rely on the system's timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We have to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm"); return "UTC"; } @@ -378,7 +383,7 @@ tz = guess_timezone(TSRMLS_C); tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC); if (! tzi) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone."); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone"); tzi = php_date_parse_tzfile("UTC", DATE_TIMEZONEDB TSRMLS_CC); if (! tzi) { @@ -746,7 +751,7 @@ now->h = hou; break; default: - php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead."); + php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead"); } /* Update the timestamp */ if (gmt) { @@ -756,7 +761,7 @@ } /* Support for the deprecated is_dst parameter */ if (dst != -1) { - php_error_docref(NULL TSRMLS_CC, E_STRICT, "The is_dst parameter is deprecated."); + php_error_docref(NULL TSRMLS_CC, E_STRICT, "The is_dst parameter is deprecated"); if (gmt) { /* GMT never uses DST */ if (dst == 1) { http://cvs.php.net/diff.php/php-src/ext/date/tests/date_default_timezone_get-1.phpt?r1=1.2.2.1&r2=1.2.2.2&ty=u Index: php-src/ext/date/tests/date_default_timezone_get-1.phpt diff -u php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.2.2.1 php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.2.2.2 --- php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.2.2.1 Sat Oct 1 11:04:07 2005 +++ php-src/ext/date/tests/date_default_timezone_get-1.phpt Wed Oct 19 07:18:51 2005 @@ -9,8 +9,8 @@ echo date('e'), "\n"; ?> --EXPECTF-- -Strict Standards: date_default_timezone_get(): It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'Europe/London' for 'UTC/0.0/no DST' instead. in %sdate_default_timezone_get-1.php on line 3 +Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 3 Europe/London -Strict Standards: date(): It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'Europe/London' for 'UTC/0.0/no DST' instead. in %sdate_default_timezone_get-1.php on line 4 +Strict Standards: date(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 4 Europe/London http://cvs.php.net/diff.php/php-src/ext/date/tests/date_default_timezone_get-2.phpt?r1=1.2&r2=1.2.2.1&ty=u Index: php-src/ext/date/tests/date_default_timezone_get-2.phpt diff -u php-src/ext/date/tests/date_default_timezone_get-2.phpt:1.2 php-src/ext/date/tests/date_default_timezone_get-2.phpt:1.2.2.1 --- php-src/ext/date/tests/date_default_timezone_get-2.phpt:1.2 Wed Jul 20 06:06:10 2005 +++ php-src/ext/date/tests/date_default_timezone_get-2.phpt Wed Oct 19 07:18:51 2005 @@ -8,5 +8,5 @@ echo date_default_timezone_get(), "\n"; ?> --EXPECTF-- -Notice: date_default_timezone_get(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone. in %sdate_default_timezone_get-2.php on line 3 +Notice: date_default_timezone_get(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in %sdate_default_timezone_get-2.php on line 3 UTC http://cvs.php.net/diff.php/php-src/ext/date/tests/date_default_timezone_set-1.phpt?r1=1.1.2.1&r2=1.1.2.2&ty=u Index: php-src/ext/date/tests/date_default_timezone_set-1.phpt diff -u php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.1.2.1 php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.1.2.2 --- php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.1.2.1 Sat Oct 1 11:04:07 2005 +++ php-src/ext/date/tests/date_default_timezone_set-1.phpt Wed Oct 19 07:18:51 2005 @@ -18,9 +18,9 @@ echo date(DATE_ISO8601, $date4), "\n"; ?> --EXPECTF-- -Strict Standards: strtotime(): It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'Europe/London' for 'UTC/0.0/no DST' instead. in %sdate_default_timezone_set-1.php on line 3 +Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3 -Strict Standards: strtotime(): It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'Europe/London' for 'UTC/0.0/no DST' instead. in %sdate_default_timezone_set-1.php on line 4 +Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 4 America/Indiana/Knox 2005-01-12T03:00:00-0500 2005-07-12T02:00:00-0500