]> granicus.if.org Git - php/commitdiff
- MFH: Elevate no-tz set warning from E_STRICT to E_WARNING.
authorDerick Rethans <derick@php.net>
Tue, 27 Jan 2009 13:48:10 +0000 (13:48 +0000)
committerDerick Rethans <derick@php.net>
Tue, 27 Jan 2009 13:48:10 +0000 (13:48 +0000)
#- [DOC]

ext/date/php_date.c
ext/date/tests/date_default_timezone_get-1.phpt
ext/date/tests/date_default_timezone_get-2.phpt
ext/date/tests/date_default_timezone_set-1.phpt
ext/date/tests/timestamp-in-dst.phpt

index 4f9ff25e4a2ddb26583bd2c6e306d06cf1ba75bd..bc8b03db6d664d8075b9544d29040d285b469177 100644 (file)
@@ -707,8 +707,8 @@ PHP_RSHUTDOWN_FUNCTION(date)
 #define DATE_FORMAT_ISO8601  "Y-m-d\\TH:i:sO"
 
 #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 " \
+       "It is not safe to rely on the system's timezone settings. You are " \
+       "*required* to use the date.timezone setting or the " \
        "date_default_timezone_set() function. In case you used any of those " \
        "methods and you are still getting this warning, you most likely " \
        "misspelled the timezone identifier. "
@@ -845,7 +845,7 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
                        tzid = "UTC";
                }
                
-               php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%s/%.1f/%s' instead", tzid, ta ? ta->tm_zone : "Unknown", ta ? (float) (ta->tm_gmtoff / 3600) : 0, ta ? (ta->tm_isdst ? "DST" : "no DST") : "Unknown");
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected '%s' for '%s/%.1f/%s' instead", tzid, ta ? ta->tm_zone : "Unknown", ta ? (float) (ta->tm_gmtoff / 3600) : 0, ta ? (ta->tm_isdst ? "DST" : "no DST") : "Unknown");
                return tzid;
        }
 #endif
@@ -864,7 +864,7 @@ php_win_std_time:
                                if (! tzid) {
                                        tzid = "UTC";
                                }
-                               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));
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/no DST' instead", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0));
                                break;
 
                        /* DST in effect */
@@ -878,7 +878,7 @@ php_win_std_time:
                                if (! tzid) {
                                        tzid = "UTC";
                                }
-                               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));
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/DST' instead", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0));
                                break;
                }
                return tzid;
index b6494658e4d7c44eec637b090f51fdc49c787aab..383394a955a73cc23f47ba780ad1b88314e56a1a 100644 (file)
@@ -9,8 +9,8 @@ date.timezone=
        echo date('e'), "\n";
 ?>
 --EXPECTF--
-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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 3
+Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 3
 UTC
 
-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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 4
+Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 4
 UTC
index 5859eeb4048b1d9947954d7f55caeb43fc0fb85e..50297fd680b757c53f537463820099ad6d36552b 100644 (file)
@@ -6,5 +6,5 @@ date_default_timezone_get() function [2]
        echo date_default_timezone_get(), "\n";
 ?>
 --EXPECTF--
-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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-2.php on line 3
+Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-2.php on line 3
 UTC
index 5af34d643f1fd5b96618e9261c5738f68d18050b..4600177bf29fec9538176b313642a3cfc8f3b0c6 100644 (file)
@@ -16,9 +16,9 @@ date_default_timezone_set() function [1]
        echo date(DATE_ISO8601, $date4), "\n";
 ?>
 --EXPECTF--
-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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3
+Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' 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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 4
+Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' 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-12T03:00:00-0500
index 5b66351e1f5cf754369f202e2013222cbcfa6bb7..bef18eec8db134ccfc925850bd53e0fc42719f93 100644 (file)
@@ -4,7 +4,7 @@ Format timestamp in DST test
 date.timezone=CEST
 --FILE--
 <?php
-error_reporting(E_ALL); // hide e_strict warning about timezones
+error_reporting(E_ALL & ~E_WARNING); // hide e_warning warning about timezones
 var_dump( date_create( '@1202996091' )->format( 'c' ) );
 ?>
 --EXPECT--