[packages] php5: Add support for using the system timezone database
[packages.git] / lang / php5 / patches / 103-debian_patches_use_embedded_timezonedb.patch
1 Author: Sean Finney <seanius@debian.org>
2 Forwarded: no (upstream doesn't want it)
3 Description: Silence warnings about using the default system timezone info
4  In vanilla upstream php, this is considered an error (i.e. the user must
5  set the timezone explicitly), though with our use of the system timezonedb
6  patch, we actually feel quite comfortable using the default timezone info.
7 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571762
8 --- a/ext/date/php_date.c
9 +++ b/ext/date/php_date.c
10 @@ -878,7 +878,7 @@ static char* guess_timezone(const timeli
11                         tzid = "UTC";
12                 }
13                 
14 -               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");
15 +               // 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");
16                 return tzid;
17         }
18  #endif
19 --- a/ext/date/tests/date_default_timezone_get-1.phpt
20 +++ /dev/null
21 @@ -1,16 +0,0 @@
22 ---TEST--
23 -date_default_timezone_get() function [1]
24 ---INI--
25 -date.timezone=
26 ---FILE--
27 -<?php
28 -       putenv('TZ=');
29 -       echo date_default_timezone_get(), "\n";
30 -       echo date('e'), "\n";
31 -?>
32 ---EXPECTF--
33 -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
34 -UTC
35 -
36 -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
37 -UTC
38 --- a/ext/date/tests/date_default_timezone_get-2.phpt
39 +++ /dev/null
40 @@ -1,12 +0,0 @@
41 ---TEST--
42 -date_default_timezone_get() function [2]
43 ---INI--
44 -date.timezone=
45 ---FILE--
46 -<?php
47 -       putenv('TZ=');
48 -       echo date_default_timezone_get(), "\n";
49 -?>
50 ---EXPECTF--
51 -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
52 -UTC
53 --- a/ext/date/tests/date_default_timezone_set-1.phpt
54 +++ b/ext/date/tests/date_default_timezone_set-1.phpt
55 @@ -18,9 +18,6 @@ date.timezone=
56         echo date(DATE_ISO8601, $date4), "\n";
57  ?>
58  --EXPECTF--
59 -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
60 -
61 -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
62  America/Indiana/Knox
63  2005-01-12T03:00:00-0500
64  2005-07-12T03:00:00-0500