sniper          Wed Oct 19 07:18:16 2005 EDT

  Modified files:              
    /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:
  - Fixed error messages and tests
  
http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.64&r2=1.65&ty=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.64 php-src/ext/date/php_date.c:1.65
--- php-src/ext/date/php_date.c:1.64    Wed Oct 19 03:21:35 2005
+++ php-src/ext/date/php_date.c Wed Oct 19 07:18:13 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.64 2005/10/19 07:21:35 derick Exp $ */
+/* $Id: php_date.c,v 1.65 2005/10/19 11:18:13 sniper Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -228,6 +228,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)
 {
@@ -328,7 +333,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
@@ -347,7 +352,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 */
@@ -361,14 +366,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";
 }
 
@@ -380,7 +385,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) {
@@ -860,7 +865,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) {
@@ -870,7 +875,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.3&r2=1.4&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.3 
php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.4
--- php-src/ext/date/tests/date_default_timezone_get-1.phpt:1.3 Sat Oct  1 
11:07:20 2005
+++ php-src/ext/date/tests/date_default_timezone_get-1.phpt     Wed Oct 19 
07:18:16 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.3&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.3
--- 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:16 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.2&r2=1.3&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.2 
php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.3
--- php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.2 Sat Oct  1 
11:07:20 2005
+++ php-src/ext/date/tests/date_default_timezone_set-1.phpt     Wed Oct 19 
07:18:16 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

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to