- provides php-phar
- update systzdata patch to v10, timezone are case insensitive
This commit is contained in:
parent
7b3ec71507
commit
334be7f743
@ -2,6 +2,7 @@ Add support for use of the system timezone database, rather
|
|||||||
than embedding a copy. Discussed upstream but was not desired.
|
than embedding a copy. Discussed upstream but was not desired.
|
||||||
|
|
||||||
History:
|
History:
|
||||||
|
r10 : make timezone case insensitive
|
||||||
r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
|
r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
|
||||||
r8: fix compile error without --with-system-tzdata configured
|
r8: fix compile error without --with-system-tzdata configured
|
||||||
r7: improve check for valid timezone id to exclude directories
|
r7: improve check for valid timezone id to exclude directories
|
||||||
@ -18,7 +19,7 @@ r1: initial revision
|
|||||||
|
|
||||||
--- a/ext/date/lib/parse_tz.c
|
--- a/ext/date/lib/parse_tz.c
|
||||||
+++ b/ext/date/lib/parse_tz.c
|
+++ b/ext/date/lib/parse_tz.c
|
||||||
@@ -24,6 +24,16 @@
|
@@ -20,6 +20,16 @@
|
||||||
|
|
||||||
#include "timelib.h"
|
#include "timelib.h"
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ r1: initial revision
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef HAVE_LOCALE_H
|
#ifdef HAVE_LOCALE_H
|
||||||
@@ -35,7 +45,12 @@
|
@@ -31,7 +41,12 @@
|
||||||
#else
|
#else
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
@ -48,7 +49,7 @@ r1: initial revision
|
|||||||
|
|
||||||
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
|
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
|
||||||
# if defined(__LITTLE_ENDIAN__)
|
# if defined(__LITTLE_ENDIAN__)
|
||||||
@@ -55,9 +70,14 @@
|
@@ -51,9 +66,14 @@
|
||||||
|
|
||||||
static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
|
static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||||
{
|
{
|
||||||
@ -66,7 +67,7 @@ r1: initial revision
|
|||||||
/* read BC flag */
|
/* read BC flag */
|
||||||
tz->bc = (**tzf == '\1');
|
tz->bc = (**tzf == '\1');
|
||||||
*tzf += 1;
|
*tzf += 1;
|
||||||
@@ -260,7 +280,397 @@ void timelib_dump_tzinfo(timelib_tzinfo
|
@@ -256,7 +276,405 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +81,7 @@ r1: initial revision
|
|||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
+/* System timezone database pointer. */
|
+/* System timezone database pointer. */
|
||||||
+static const timelib_tzdb *timezonedb_system = NULL;
|
+static const timelib_tzdb *timezonedb_system;
|
||||||
+
|
+
|
||||||
+/* Hash table entry for the cache of the zone.tab mapping table. */
|
+/* Hash table entry for the cache of the zone.tab mapping table. */
|
||||||
+struct location_info {
|
+struct location_info {
|
||||||
@ -98,13 +99,14 @@ r1: initial revision
|
|||||||
+ * prevent too many collisions. */
|
+ * prevent too many collisions. */
|
||||||
+#define LOCINFO_HASH_SIZE (1021)
|
+#define LOCINFO_HASH_SIZE (1021)
|
||||||
+
|
+
|
||||||
|
+/* Compute a case insensitive hash of str */
|
||||||
+static uint32_t tz_hash(const char *str)
|
+static uint32_t tz_hash(const char *str)
|
||||||
+{
|
+{
|
||||||
+ const unsigned char *p = (const unsigned char *)str;
|
+ const unsigned char *p = (const unsigned char *)str;
|
||||||
+ uint32_t hash = 5381;
|
+ uint32_t hash = 5381;
|
||||||
+ int c;
|
+ int c;
|
||||||
+
|
+
|
||||||
+ while ((c = *p++) != '\0') {
|
+ while ((c = tolower(*p++)) != '\0') {
|
||||||
+ hash = (hash << 5) ^ hash ^ c;
|
+ hash = (hash << 5) ^ hash ^ c;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -442,6 +444,13 @@ r1: initial revision
|
|||||||
+ return NULL;
|
+ return NULL;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
+ if (system_location_table) {
|
||||||
|
+ const struct location_info *li;
|
||||||
|
+ if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
|
||||||
|
+ /* Use the stored name to avoid case issue */
|
||||||
|
+ timezone = li->name;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
|
+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
|
||||||
+
|
+
|
||||||
+ fd = open(fname, O_RDONLY);
|
+ fd = open(fname, O_RDONLY);
|
||||||
@ -465,7 +474,7 @@ r1: initial revision
|
|||||||
{
|
{
|
||||||
int left = 0, right = tzdb->index_size - 1;
|
int left = 0, right = tzdb->index_size - 1;
|
||||||
#ifdef HAVE_SETLOCALE
|
#ifdef HAVE_SETLOCALE
|
||||||
@@ -299,36 +709,128 @@ static int seek_to_tz_position(const uns
|
@@ -295,36 +713,135 @@
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,7 +546,14 @@ r1: initial revision
|
|||||||
+ struct stat st;
|
+ struct stat st;
|
||||||
+
|
+
|
||||||
+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
|
+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
|
||||||
+ return 0;
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (system_location_table) {
|
||||||
|
+ if (find_zone_info(system_location_table, timezone) != NULL) {
|
||||||
|
+ /* found in cache */
|
||||||
|
+ return 1;
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
|
+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
|
9
php.spec
9
php.spec
@ -52,7 +52,7 @@
|
|||||||
Summary: PHP scripting language for creating dynamic web sites
|
Summary: PHP scripting language for creating dynamic web sites
|
||||||
Name: php
|
Name: php
|
||||||
Version: 5.4.7
|
Version: 5.4.7
|
||||||
Release: 10%{?dist}
|
Release: 11%{?dist}
|
||||||
License: PHP
|
License: PHP
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
URL: http://www.php.net/
|
URL: http://www.php.net/
|
||||||
@ -87,7 +87,7 @@ Patch23: php-5.4.7-fpm.patch
|
|||||||
# Functional changes
|
# Functional changes
|
||||||
Patch40: php-5.4.0-dlopen.patch
|
Patch40: php-5.4.0-dlopen.patch
|
||||||
Patch41: php-5.4.0-easter.patch
|
Patch41: php-5.4.0-easter.patch
|
||||||
Patch42: php-5.3.1-systzdata-v9.patch
|
Patch42: php-5.3.1-systzdata-v10.patch
|
||||||
# See http://bugs.php.net/53436
|
# See http://bugs.php.net/53436
|
||||||
Patch43: php-5.4.0-phpize.patch
|
Patch43: php-5.4.0-phpize.patch
|
||||||
# Use system libzip instead of bundled one
|
# Use system libzip instead of bundled one
|
||||||
@ -214,6 +214,7 @@ Provides: php-libxml, php-libxml%{?_isa}
|
|||||||
Provides: php-openssl, php-openssl%{?_isa}
|
Provides: php-openssl, php-openssl%{?_isa}
|
||||||
Provides: php-pecl-phar = %{pharver}, php-pecl-phar%{?_isa} = %{pharver}
|
Provides: php-pecl-phar = %{pharver}, php-pecl-phar%{?_isa} = %{pharver}
|
||||||
Provides: php-pecl(phar) = %{pharver}, php-pecl(phar)%{?_isa} = %{pharver}
|
Provides: php-pecl(phar) = %{pharver}, php-pecl(phar)%{?_isa} = %{pharver}
|
||||||
|
Provides: php-phar, php-phar%{?_isa}
|
||||||
Provides: php-pcre, php-pcre%{?_isa}
|
Provides: php-pcre, php-pcre%{?_isa}
|
||||||
Provides: php-reflection, php-reflection%{?_isa}
|
Provides: php-reflection, php-reflection%{?_isa}
|
||||||
Provides: php-session, php-session%{?_isa}
|
Provides: php-session, php-session%{?_isa}
|
||||||
@ -1315,6 +1316,10 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Oct 5 2012 Remi Collet <remi@fedoraproject.org> 5.4.7-11
|
||||||
|
- provides php-phar
|
||||||
|
- update systzdata patch to v10, timezone are case insensitive
|
||||||
|
|
||||||
* Mon Oct 1 2012 Remi Collet <remi@fedoraproject.org> 5.4.7-10
|
* Mon Oct 1 2012 Remi Collet <remi@fedoraproject.org> 5.4.7-10
|
||||||
- fix typo in systemd macro
|
- fix typo in systemd macro
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user