packages/lang/php5/patches/103-debian_patches_use_embedded_timezonedb.patch
mhei 9fa6d05c32 [packages] php5: Add support for using the system timezone database
Using the systems database rather than embedding a copy has several
advantages. Its easier to keep the database up-to-date and it can
be used by multiple applications. So some bytes in the firmware image
can be saved, especially when only required timezones are installed.

Additionally, it not necessary anymore to configure the timezone
explicitly via php.ini (required since PHP 5.3). Instead OpenWRTs
system-wide settings are used.

This new approach is enabled by default, however it is possible
to deselect this feature to restore PHP's original behaviour.

The patches are taken from the Debian PHP patches.

Signed-off-by: Peter Naulls <peter@chocky.org>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>



git-svn-id: svn://svn.openwrt.org/openwrt/packages@28491 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-10-19 19:23:51 +00:00

65 lines
3.9 KiB
Diff

Author: Sean Finney <seanius@debian.org>
Forwarded: no (upstream doesn't want it)
Description: Silence warnings about using the default system timezone info
In vanilla upstream php, this is considered an error (i.e. the user must
set the timezone explicitly), though with our use of the system timezonedb
patch, we actually feel quite comfortable using the default timezone info.
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571762
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -878,7 +878,7 @@ static char* guess_timezone(const timeli
tzid = "UTC";
}
- 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");
+ // 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
--- a/ext/date/tests/date_default_timezone_get-1.phpt
+++ /dev/null
@@ -1,16 +0,0 @@
---TEST--
-date_default_timezone_get() function [1]
---INI--
-date.timezone=
---FILE--
-<?php
- putenv('TZ=');
- echo date_default_timezone_get(), "\n";
- echo date('e'), "\n";
-?>
---EXPECTF--
-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
-
-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
--- a/ext/date/tests/date_default_timezone_get-2.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-date_default_timezone_get() function [2]
---INI--
-date.timezone=
---FILE--
-<?php
- putenv('TZ=');
- echo date_default_timezone_get(), "\n";
-?>
---EXPECTF--
-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
--- a/ext/date/tests/date_default_timezone_set-1.phpt
+++ b/ext/date/tests/date_default_timezone_set-1.phpt
@@ -18,9 +18,6 @@ date.timezone=
echo date(DATE_ISO8601, $date4), "\n";
?>
--EXPECTF--
-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
-
-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