public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Remi Collet <remi@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/php] private-php86: - Update to 7.0.8 - http://www.php.net/releases/7_0_8.php
Date: Fri, 27 Nov 2026 07:27:44 GMT [thread overview]
Message-ID: <179576446426.1.14639729215916886624.rpms-php-3920d6f792ff@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/php
Branch : private-php86
Commit : 3920d6f792ffeae67a0943204f1ad7fa5b420434
Author : Remi Collet <remi@fedoraproject.org>
Date : 2016-06-27T15:05:34+02:00
Stats : +1096/-1249 in 21 file(s)
URL : https://src.fedoraproject.org/rpms/php/c/3920d6f792ffeae67a0943204f1ad7fa5b420434?branch=private-php86
Log:
- Update to 7.0.8 - http://www.php.net/releases/7_0_8.php
- https://fedoraproject.org/wiki/Changes/php70
- drop ereg, mysql, mssql extensions
- add json extension
---
diff --git a/.gitignore b/.gitignore
index 3fbf17d..20d2a63 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,3 +74,4 @@ php-5.5.*.xz
/php-5.6.22-strip.tar.xz
/php-5.6.23RC1-strip.tar.xz
/php-5.6.23-strip.tar.xz
+/php-7.0.8.tar.xz
diff --git a/10-opcache.ini b/10-opcache.ini
new file mode 100644
index 0000000..cbd5960
--- /dev/null
+++ b/10-opcache.ini
@@ -0,0 +1,113 @@
+; Enable Zend OPcache extension module
+zend_extension=opcache.so
+
+; Determines if Zend OPCache is enabled
+opcache.enable=1
+
+; Determines if Zend OPCache is enabled for the CLI version of PHP
+;opcache.enable_cli=0
+
+; The OPcache shared memory storage size.
+opcache.memory_consumption=128
+
+; The amount of memory for interned strings in Mbytes.
+opcache.interned_strings_buffer=8
+
+; The maximum number of keys (scripts) in the OPcache hash table.
+; Only numbers between 200 and 100000 are allowed.
+opcache.max_accelerated_files=4000
+
+; The maximum percentage of "wasted" memory until a restart is scheduled.
+;opcache.max_wasted_percentage=5
+
+; When this directive is enabled, the OPcache appends the current working
+; directory to the script key, thus eliminating possible collisions between
+; files with the same name (basename). Disabling the directive improves
+; performance, but may break existing applications.
+;opcache.use_cwd=1
+
+; When disabled, you must reset the OPcache manually or restart the
+; webserver for changes to the filesystem to take effect.
+;opcache.validate_timestamps=1
+
+; How often (in seconds) to check file timestamps for changes to the shared
+; memory storage allocation. ("1" means validate once per second, but only
+; once per request. "0" means always validate)
+;opcache.revalidate_freq=2
+
+; Enables or disables file search in include_path optimization
+;opcache.revalidate_path=0
+
+; If disabled, all PHPDoc comments are dropped from the code to reduce the
+; size of the optimized code.
+;opcache.save_comments=1
+
+; If enabled, a fast shutdown sequence is used for the accelerated code
+;opcache.fast_shutdown=0
+
+; Allow file existence override (file_exists, etc.) performance feature.
+;opcache.enable_file_override=0
+
+; A bitmask, where each bit enables or disables the appropriate OPcache
+; passes
+;opcache.optimization_level=0xffffffff
+
+;opcache.inherited_hack=1
+;opcache.dups_fix=0
+
+; The location of the OPcache blacklist file (wildcards allowed).
+; Each OPcache blacklist file is a text file that holds the names of files
+; that should not be accelerated.
+opcache.blacklist_filename=/etc/php.d/opcache*.blacklist
+
+; Allows exclusion of large files from being cached. By default all files
+; are cached.
+;opcache.max_file_size=0
+
+; Check the cache checksum each N requests.
+; The default value of "0" means that the checks are disabled.
+;opcache.consistency_checks=0
+
+; How long to wait (in seconds) for a scheduled restart to begin if the cache
+; is not being accessed.
+;opcache.force_restart_timeout=180
+
+; OPcache error_log file name. Empty string assumes "stderr".
+;opcache.error_log=
+
+; All OPcache errors go to the Web server log.
+; By default, only fatal errors (level 0) or errors (level 1) are logged.
+; You can also enable warnings (level 2), info messages (level 3) or
+; debug messages (level 4).
+;opcache.log_verbosity_level=1
+
+; Preferred Shared Memory back-end. Leave empty and let the system decide.
+;opcache.preferred_memory_model=
+
+; Protect the shared memory from unexpected writing during script execution.
+; Useful for internal debugging only.
+;opcache.protect_memory=0
+
+; Allows calling OPcache API functions only from PHP scripts which path is
+; started from specified string. The default "" means no restriction
+;opcache.restrict_api=
+
+; Enables and sets the second level cache directory.
+; It should improve performance when SHM memory is full, at server restart or
+; SHM reset. The default "" disables file based caching.
+; RPM note : file cache directory must be owned by process owner
+; for mod_php, see /etc/httpd/conf.d/php.conf
+; for php-fpm, see /etc/php-fpm.d/*conf
+;opcache.file_cache=
+
+; Enables or disables opcode caching in shared memory.
+;opcache.file_cache_only=0
+
+; Enables or disables checksum validation when script loaded from file cache.
+;opcache.file_cache_consistency_checks=1
+
+
+; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
+; This should improve performance, but requires appropriate OS configuration.
+opcache.huge_code_pages=0
+
diff --git a/opcache.ini b/opcache.ini
deleted file mode 100644
index 21f16ad..0000000
--- a/opcache.ini
+++ /dev/null
@@ -1,95 +0,0 @@
-; Enable Zend OPcache extension module
-zend_extension=opcache.so
-
-; Determines if Zend OPCache is enabled
-opcache.enable=1
-
-; Determines if Zend OPCache is enabled for the CLI version of PHP
-;opcache.enable_cli=0
-
-; The OPcache shared memory storage size.
-opcache.memory_consumption=128
-
-; The amount of memory for interned strings in Mbytes.
-opcache.interned_strings_buffer=8
-
-; The maximum number of keys (scripts) in the OPcache hash table.
-; Only numbers between 200 and 100000 are allowed.
-opcache.max_accelerated_files=4000
-
-; The maximum percentage of "wasted" memory until a restart is scheduled.
-;opcache.max_wasted_percentage=5
-
-; When this directive is enabled, the OPcache appends the current working
-; directory to the script key, thus eliminating possible collisions between
-; files with the same name (basename). Disabling the directive improves
-; performance, but may break existing applications.
-;opcache.use_cwd=1
-
-; When disabled, you must reset the OPcache manually or restart the
-; webserver for changes to the filesystem to take effect.
-;opcache.validate_timestamps=1
-
-; How often (in seconds) to check file timestamps for changes to the shared
-; memory storage allocation. ("1" means validate once per second, but only
-; once per request. "0" means always validate)
-;opcache.revalidate_freq=2
-
-; Enables or disables file search in include_path optimization
-;opcache.revalidate_path=0
-
-; If disabled, all PHPDoc comments are dropped from the code to reduce the
-; size of the optimized code.
-;opcache.save_comments=1
-
-; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
-; may be always stored (save_comments=1), but not loaded by applications
-; that don't need them anyway.
-;opcache.load_comments=1
-
-; If enabled, a fast shutdown sequence is used for the accelerated code
-;opcache.fast_shutdown=0
-
-; Allow file existence override (file_exists, etc.) performance feature.
-;opcache.enable_file_override=0
-
-; A bitmask, where each bit enables or disables the appropriate OPcache
-; passes
-;opcache.optimization_level=0xffffffff
-
-;opcache.inherited_hack=1
-;opcache.dups_fix=0
-
-; The location of the OPcache blacklist file (wildcards allowed).
-; Each OPcache blacklist file is a text file that holds the names of files
-; that should not be accelerated.
-opcache.blacklist_filename=/etc/php.d/opcache*.blacklist
-
-; Allows exclusion of large files from being cached. By default all files
-; are cached.
-;opcache.max_file_size=0
-
-; Check the cache checksum each N requests.
-; The default value of "0" means that the checks are disabled.
-;opcache.consistency_checks=0
-
-; How long to wait (in seconds) for a scheduled restart to begin if the cache
-; is not being accessed.
-;opcache.force_restart_timeout=180
-
-; OPcache error_log file name. Empty string assumes "stderr".
-;opcache.error_log=
-
-; All OPcache errors go to the Web server log.
-; By default, only fatal errors (level 0) or errors (level 1) are logged.
-; You can also enable warnings (level 2), info messages (level 3) or
-; debug messages (level 4).
-;opcache.log_verbosity_level=1
-
-; Preferred Shared Memory back-end. Leave empty and let the system decide.
-;opcache.preferred_memory_model=
-
-; Protect the shared memory from unexpected writing during script execution.
-; Useful for internal debugging only.
-;opcache.protect_memory=0
-
diff --git a/php-5.4.0-dlopen.patch b/php-5.4.0-dlopen.patch
deleted file mode 100644
index c2b0e40..0000000
--- a/php-5.4.0-dlopen.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- php-5.4.0RC5/Zend/zend.h.dlopen 2012-01-18 17:10:33.972013835 +0100
-+++ php-5.4.0RC5/Zend/zend.h 2012-01-18 17:12:39.175019492 +0100
-@@ -90,11 +90,11 @@
- # endif
-
- # if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
--# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
-+# define DL_LOAD(libname) dlopen(libname, RTLD_NOW | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
- # elif defined(RTLD_DEEPBIND)
--# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
-+# define DL_LOAD(libname) dlopen(libname, RTLD_NOW | RTLD_GLOBAL | RTLD_DEEPBIND)
- # else
--# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
-+# define DL_LOAD(libname) dlopen(libname, RTLD_NOW | RTLD_GLOBAL)
- # endif
- # define DL_UNLOAD dlclose
- # if defined(DLSYM_NEEDS_UNDERSCORE)
diff --git a/php-5.6.13-systzdata-v12.patch b/php-5.6.13-systzdata-v12.patch
deleted file mode 100644
index 8981212..0000000
--- a/php-5.6.13-systzdata-v12.patch
+++ /dev/null
@@ -1,659 +0,0 @@
-Add support for use of the system timezone database, rather
-than embedding a copy. Discussed upstream but was not desired.
-
-History:
-r12: adapt for upstream changes for new zic
-r11: use canonical names to avoid more case sensitivity issues
- round lat/long from zone.tab towards zero per builtin db
-r10: make timezone case insensitive
-r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
-r8: fix compile error without --with-system-tzdata configured
-r7: improve check for valid timezone id to exclude directories
-r6: fix fd leak in r5, fix country code/BC flag use in
- timezone_identifiers_list() using system db,
- fix use of PECL timezonedb to override system db,
-r5: reverts addition of "System/Localtime" fake tzname.
- updated for 5.3.0, parses zone.tab to pick up mapping between
- timezone name, country code and long/lat coords
-r4: added "System/Localtime" tzname which uses /etc/localtime
-r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
-r2: add filesystem trawl to set up name alias index
-r1: initial revision
-
-diff -up php-5.6.13/ext/date/lib/parse_tz.c.systzdata php-5.6.13/ext/date/lib/parse_tz.c
---- php-5.6.13/ext/date/lib/parse_tz.c.systzdata 2015-09-03 02:02:45.000000000 +0200
-+++ php-5.6.13/ext/date/lib/parse_tz.c 2015-09-03 12:50:52.555576944 +0200
-@@ -20,6 +20,16 @@
-
- #include "timelib.h"
-
-+#ifdef HAVE_SYSTEM_TZDATA
-+#include <sys/mman.h>
-+#include <sys/stat.h>
-+#include <limits.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include "php_scandir.h"
-+#endif
-+
- #include <stdio.h>
-
- #ifdef HAVE_LOCALE_H
-@@ -33,7 +43,11 @@
- #endif
-
- #define TIMELIB_SUPPORTS_V2DATA
-+#ifndef HAVE_SYSTEM_TZDATA
- #include "timezonedb.h"
-+#endif
-+
-+#include <ctype.h>
-
- #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
- # if defined(__LITTLE_ENDIAN__)
-@@ -55,6 +69,10 @@ static int read_preamble(const unsigned
- {
- uint32_t version;
-
-+ if (memcmp(*tzf, "TZif", 4) == 0) {
-+ *tzf += 20;
-+ return 0;
-+ }
- /* read ID */
- version = (*tzf)[3] - '0';
- *tzf += 4;
-@@ -298,7 +316,418 @@ void timelib_dump_tzinfo(timelib_tzinfo
- }
- }
-
--static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
-+#ifdef HAVE_SYSTEM_TZDATA
-+
-+#ifdef HAVE_SYSTEM_TZDATA_PREFIX
-+#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX
-+#else
-+#define ZONEINFO_PREFIX "/usr/share/zoneinfo"
-+#endif
-+
-+/* System timezone database pointer. */
-+static const timelib_tzdb *timezonedb_system;
-+
-+/* Hash table entry for the cache of the zone.tab mapping table. */
-+struct location_info {
-+ char code[2];
-+ double latitude, longitude;
-+ char name[64];
-+ char *comment;
-+ struct location_info *next;
-+};
-+
-+/* Cache of zone.tab. */
-+static struct location_info **system_location_table;
-+
-+/* Size of the zone.tab hash table; a random-ish prime big enough to
-+ * prevent too many collisions. */
-+#define LOCINFO_HASH_SIZE (1021)
-+
-+/* Compute a case insensitive hash of str */
-+static uint32_t tz_hash(const char *str)
-+{
-+ const unsigned char *p = (const unsigned char *)str;
-+ uint32_t hash = 5381;
-+ int c;
-+
-+ while ((c = tolower(*p++)) != '\0') {
-+ hash = (hash << 5) ^ hash ^ c;
-+ }
-+
-+ return hash % LOCINFO_HASH_SIZE;
-+}
-+
-+/* Parse an ISO-6709 date as used in zone.tab. Returns end of the
-+ * parsed string on success, or NULL on parse error. On success,
-+ * writes the parsed number to *result. */
-+static char *parse_iso6709(char *p, double *result)
-+{
-+ double v, sign;
-+ char *pend;
-+ size_t len;
-+
-+ if (*p == '+')
-+ sign = 1.0;
-+ else if (*p == '-')
-+ sign = -1.0;
-+ else
-+ return NULL;
-+
-+ p++;
-+ for (pend = p; *pend >= '0' && *pend <= '9'; pend++)
-+ ;;
-+
-+ /* Annoying encoding used by zone.tab has no decimal point, so use
-+ * the length to determine the format:
-+ *
-+ * 4 = DDMM
-+ * 5 = DDDMM
-+ * 6 = DDMMSS
-+ * 7 = DDDMMSS
-+ */
-+ len = pend - p;
-+ if (len < 4 || len > 7) {
-+ return NULL;
-+ }
-+
-+ /* p => [D]DD */
-+ v = (p[0] - '0') * 10.0 + (p[1] - '0');
-+ p += 2;
-+ if (len == 5 || len == 7)
-+ v = v * 10.0 + (*p++ - '0');
-+ /* p => MM[SS] */
-+ v += (10.0 * (p[0] - '0')
-+ + p[1] - '0') / 60.0;
-+ p += 2;
-+ /* p => [SS] */
-+ if (len > 5) {
-+ v += (10.0 * (p[0] - '0')
-+ + p[1] - '0') / 3600.0;
-+ p += 2;
-+ }
-+
-+ /* Round to five decimal place, not because it's a good idea,
-+ * but, because the builtin data uses rounded data, so, match
-+ * that. */
-+ *result = trunc(v * sign * 100000.0) / 100000.0;
-+
-+ return p;
-+}
-+
-+/* This function parses the zone.tab file to build up the mapping of
-+ * timezone to country code and geographic location, and returns a
-+ * hash table. The hash table is indexed by the function:
-+ *
-+ * tz_hash(timezone-name)
-+ */
-+static struct location_info **create_location_table(void)
-+{
-+ struct location_info **li, *i;
-+ char zone_tab[PATH_MAX];
-+ char line[512];
-+ FILE *fp;
-+
-+ strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab);
-+
-+ fp = fopen(zone_tab, "r");
-+ if (!fp) {
-+ return NULL;
-+ }
-+
-+ li = calloc(LOCINFO_HASH_SIZE, sizeof *li);
-+
-+ while (fgets(line, sizeof line, fp)) {
-+ char *p = line, *code, *name, *comment;
-+ uint32_t hash;
-+ double latitude, longitude;
-+
-+ while (isspace(*p))
-+ p++;
-+
-+ if (*p == '#' || *p == '\0' || *p == '\n')
-+ continue;
-+
-+ if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t')
-+ continue;
-+
-+ /* code => AA */
-+ code = p;
-+ p[2] = 0;
-+ p += 3;
-+
-+ /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */
-+ p = parse_iso6709(p, &latitude);
-+ if (!p) {
-+ continue;
-+ }
-+ p = parse_iso6709(p, &longitude);
-+ if (!p) {
-+ continue;
-+ }
-+
-+ if (!p || *p != '\t') {
-+ continue;
-+ }
-+
-+ /* name = string */
-+ name = ++p;
-+ while (*p != '\t' && *p && *p != '\n')
-+ p++;
-+
-+ *p++ = '\0';
-+
-+ /* comment = string */
-+ comment = p;
-+ while (*p != '\t' && *p && *p != '\n')
-+ p++;
-+
-+ if (*p == '\n' || *p == '\t')
-+ *p = '\0';
-+
-+ hash = tz_hash(name);
-+ i = malloc(sizeof *i);
-+ memcpy(i->code, code, 2);
-+ strncpy(i->name, name, sizeof i->name);
-+ i->comment = strdup(comment);
-+ i->longitude = longitude;
-+ i->latitude = latitude;
-+ i->next = li[hash];
-+ li[hash] = i;
-+ /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */
-+ }
-+
-+ fclose(fp);
-+
-+ return li;
-+}
-+
-+/* Return location info from hash table, using given timezone name.
-+ * Returns NULL if the name could not be found. */
-+const struct location_info *find_zone_info(struct location_info **li,
-+ const char *name)
-+{
-+ uint32_t hash = tz_hash(name);
-+ const struct location_info *l;
-+
-+ if (!li) {
-+ return NULL;
-+ }
-+
-+ for (l = li[hash]; l; l = l->next) {
-+ if (strcasecmp(l->name, name) == 0)
-+ return l;
-+ }
-+
-+ return NULL;
-+}
-+
-+/* Filter out some non-tzdata files and the posix/right databases, if
-+ * present. */
-+static int index_filter(const struct dirent *ent)
-+{
-+ return strcmp(ent->d_name, ".") != 0
-+ && strcmp(ent->d_name, "..") != 0
-+ && strcmp(ent->d_name, "posix") != 0
-+ && strcmp(ent->d_name, "posixrules") != 0
-+ && strcmp(ent->d_name, "right") != 0
-+ && strstr(ent->d_name, ".tab") == NULL;
-+}
-+
-+static int sysdbcmp(const void *first, const void *second)
-+{
-+ const timelib_tzdb_index_entry *alpha = first, *beta = second;
-+
-+ return strcasecmp(alpha->id, beta->id);
-+}
-+
-+
-+/* Create the zone identifier index by trawling the filesystem. */
-+static void create_zone_index(timelib_tzdb *db)
-+{
-+ size_t dirstack_size, dirstack_top;
-+ size_t index_size, index_next;
-+ timelib_tzdb_index_entry *db_index;
-+ char **dirstack;
-+
-+ /* LIFO stack to hold directory entries to scan; each slot is a
-+ * directory name relative to the zoneinfo prefix. */
-+ dirstack_size = 32;
-+ dirstack = malloc(dirstack_size * sizeof *dirstack);
-+ dirstack_top = 1;
-+ dirstack[0] = strdup("");
-+
-+ /* Index array. */
-+ index_size = 64;
-+ db_index = malloc(index_size * sizeof *db_index);
-+ index_next = 0;
-+
-+ do {
-+ struct dirent **ents;
-+ char name[PATH_MAX], *top;
-+ int count;
-+
-+ /* Pop the top stack entry, and iterate through its contents. */
-+ top = dirstack[--dirstack_top];
-+ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top);
-+
-+ count = php_scandir(name, &ents, index_filter, php_alphasort);
-+
-+ while (count > 0) {
-+ struct stat st;
-+ const char *leaf = ents[count - 1]->d_name;
-+
-+ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s",
-+ top, leaf);
-+
-+ if (strlen(name) && stat(name, &st) == 0) {
-+ /* Name, relative to the zoneinfo prefix. */
-+ const char *root = top;
-+
-+ if (root[0] == '/') root++;
-+
-+ snprintf(name, sizeof name, "%s%s%s", root,
-+ *root ? "/": "", leaf);
-+
-+ if (S_ISDIR(st.st_mode)) {
-+ if (dirstack_top == dirstack_size) {
-+ dirstack_size *= 2;
-+ dirstack = realloc(dirstack,
-+ dirstack_size * sizeof *dirstack);
-+ }
-+ dirstack[dirstack_top++] = strdup(name);
-+ }
-+ else {
-+ if (index_next == index_size) {
-+ index_size *= 2;
-+ db_index = realloc(db_index,
-+ index_size * sizeof *db_index);
-+ }
-+
-+ db_index[index_next++].id = strdup(name);
-+ }
-+ }
-+
-+ free(ents[--count]);
-+ }
-+
-+ if (count != -1) free(ents);
-+ free(top);
-+ } while (dirstack_top);
-+
-+ qsort(db_index, index_next, sizeof *db_index, sysdbcmp);
-+
-+ db->index = db_index;
-+ db->index_size = index_next;
-+
-+ free(dirstack);
-+}
-+
-+#define FAKE_HEADER "1234\0??\1??"
-+#define FAKE_UTC_POS (7 - 4)
-+
-+/* Create a fake data segment for database 'sysdb'. */
-+static void fake_data_segment(timelib_tzdb *sysdb,
-+ struct location_info **info)
-+{
-+ size_t n;
-+ char *data, *p;
-+
-+ data = malloc(3 * sysdb->index_size + 7);
-+
-+ p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1);
-+
-+ for (n = 0; n < sysdb->index_size; n++) {
-+ const struct location_info *li;
-+ timelib_tzdb_index_entry *ent;
-+
-+ ent = (timelib_tzdb_index_entry *)&sysdb->index[n];
-+
-+ /* Lookup the timezone name in the hash table. */
-+ if (strcmp(ent->id, "UTC") == 0) {
-+ ent->pos = FAKE_UTC_POS;
-+ continue;
-+ }
-+
-+ li = find_zone_info(info, ent->id);
-+ if (li) {
-+ /* If found, append the BC byte and the
-+ * country code; set the position for this
-+ * section of timezone data. */
-+ ent->pos = (p - data) - 4;
-+ *p++ = '\1';
-+ *p++ = li->code[0];
-+ *p++ = li->code[1];
-+ }
-+ else {
-+ /* If not found, the timezone data can
-+ * point at the header. */
-+ ent->pos = 0;
-+ }
-+ }
-+
-+ sysdb->data = (unsigned char *)data;
-+}
-+
-+/* Returns true if the passed-in stat structure describes a
-+ * probably-valid timezone file. */
-+static int is_valid_tzfile(const struct stat *st)
-+{
-+ return S_ISREG(st->st_mode) && st->st_size > 20;
-+}
-+
-+/* To allow timezone names to be used case-insensitively, find the
-+ * canonical name for this timezone, if possible. */
-+static const char *canonical_tzname(const char *timezone)
-+{
-+ if (timezonedb_system) {
-+ timelib_tzdb_index_entry *ent, lookup;
-+
-+ lookup.id = (char *)timezone;
-+
-+ ent = bsearch(&lookup, timezonedb_system->index,
-+ timezonedb_system->index_size, sizeof lookup,
-+ sysdbcmp);
-+ if (ent) {
-+ return ent->id;
-+ }
-+ }
-+
-+ return timezone;
-+}
-+
-+/* Return the mmap()ed tzfile if found, else NULL. On success, the
-+ * length of the mapped data is placed in *length. */
-+static char *map_tzfile(const char *timezone, size_t *length)
-+{
-+ char fname[PATH_MAX];
-+ struct stat st;
-+ char *p;
-+ int fd;
-+
-+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
-+ return NULL;
-+ }
-+
-+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
-+
-+ fd = open(fname, O_RDONLY);
-+ if (fd == -1) {
-+ return NULL;
-+ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st)) {
-+ close(fd);
-+ return NULL;
-+ }
-+
-+ *length = st.st_size;
-+ p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
-+ close(fd);
-+
-+ return p != MAP_FAILED ? p : NULL;
-+}
-+
-+#endif
-+
-+static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
- {
- int left = 0, right = tzdb->index_size - 1;
- #ifdef HAVE_SETLOCALE
-@@ -337,21 +766,87 @@ static int seek_to_tz_position(const uns
- return 0;
- }
-
-+static int seek_to_tz_position(const unsigned char **tzf, char *timezone,
-+ char **map, size_t *maplen,
-+ const timelib_tzdb *tzdb)
-+{
-+#ifdef HAVE_SYSTEM_TZDATA
-+ if (tzdb == timezonedb_system) {
-+ char *orig;
-+
-+ orig = map_tzfile(timezone, maplen);
-+ if (orig == NULL) {
-+ return 0;
-+ }
-+
-+ (*tzf) = (unsigned char *)orig ;
-+ *map = orig;
-+ return 1;
-+ }
-+ else
-+#endif
-+ {
-+ return inmem_seek_to_tz_position(tzf, timezone, tzdb);
-+ }
-+}
-+
- const timelib_tzdb *timelib_builtin_db(void)
- {
-+#ifdef HAVE_SYSTEM_TZDATA
-+ if (timezonedb_system == NULL) {
-+ timelib_tzdb *tmp = malloc(sizeof *tmp);
-+
-+ tmp->version = "0.system";
-+ tmp->data = NULL;
-+ create_zone_index(tmp);
-+ system_location_table = create_location_table();
-+ fake_data_segment(tmp, system_location_table);
-+ timezonedb_system = tmp;
-+ }
-+
-+ return timezonedb_system;
-+#else
- return &timezonedb_builtin;
-+#endif
- }
-
- const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count)
- {
-+#ifdef HAVE_SYSTEM_TZDATA
-+ *count = timezonedb_system->index_size;
-+ return timezonedb_system->index;
-+#else
- *count = sizeof(timezonedb_idx_builtin) / sizeof(*timezonedb_idx_builtin);
- return timezonedb_idx_builtin;
-+#endif
- }
-
- int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
- {
- const unsigned char *tzf;
-- return (seek_to_tz_position(&tzf, timezone, tzdb));
-+
-+#ifdef HAVE_SYSTEM_TZDATA
-+ if (tzdb == timezonedb_system) {
-+ char fname[PATH_MAX];
-+ struct stat st;
-+
-+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
-+ 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", canonical_tzname(timezone));
-+
-+ return stat(fname, &st) == 0 && is_valid_tzfile(&st);
-+ }
-+#endif
-+ return (inmem_seek_to_tz_position(&tzf, timezone, tzdb));
- }
-
- static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
-@@ -376,24 +871,54 @@ static void read_64bit_header(const unsi
- timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
- {
- const unsigned char *tzf;
-+ char *memmap = NULL;
-+ size_t maplen;
- timelib_tzinfo *tmp;
- int version;
-
-- if (seek_to_tz_position(&tzf, timezone, tzdb)) {
-+ if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) {
- tmp = timelib_tzinfo_ctor(timezone);
-
- version = read_preamble(&tzf, tmp);
- read_header(&tzf, tmp);
- read_transistions(&tzf, tmp);
- read_types(&tzf, tmp);
-- if (version == 2) {
-- skip_64bit_preamble(&tzf, tmp);
-- read_64bit_header(&tzf, tmp);
-- skip_64bit_transistions(&tzf, tmp);
-- skip_64bit_types(&tzf, tmp);
-- skip_posix_string(&tzf, tmp);
-- }
-- read_location(&tzf, tmp);
-+
-+#ifdef HAVE_SYSTEM_TZDATA
-+ if (memmap) {
-+ const struct location_info *li;
-+
-+ /* TZif-style - grok the location info from the system database,
-+ * if possible. */
-+
-+ if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
-+ tmp->location.comments = strdup(li->comment);
-+ strncpy(tmp->location.country_code, li->code, 2);
-+ tmp->location.longitude = li->longitude;
-+ tmp->location.latitude = li->latitude;
-+ tmp->bc = 1;
-+ }
-+ else {
-+ strcpy(tmp->location.country_code, "??");
-+ tmp->bc = 0;
-+ tmp->location.comments = strdup("");
-+ }
-+
-+ /* Now done with the mmap segment - discard it. */
-+ munmap(memmap, maplen);
-+ } else
-+#endif
-+ {
-+ if (version == 2) {
-+ skip_64bit_preamble(&tzf, tmp);
-+ read_64bit_header(&tzf, tmp);
-+ skip_64bit_transistions(&tzf, tmp);
-+ skip_64bit_types(&tzf, tmp);
-+ skip_posix_string(&tzf, tmp);
-+ }
-+ /* PHP-style - use the embedded info. */
-+ read_location(&tzf, tmp);
-+ }
- } else {
- tmp = NULL;
- }
-diff -up php-5.6.13/ext/date/lib/timelib.m4.systzdata php-5.6.13/ext/date/lib/timelib.m4
---- php-5.6.13/ext/date/lib/timelib.m4.systzdata 2015-09-03 02:02:45.000000000 +0200
-+++ php-5.6.13/ext/date/lib/timelib.m4 2015-09-03 12:49:43.247226154 +0200
-@@ -78,3 +78,17 @@ stdlib.h
-
- dnl Check for strtoll, atoll
- AC_CHECK_FUNCS(strtoll atoll strftime)
-+
-+PHP_ARG_WITH(system-tzdata, for use of system timezone data,
-+[ --with-system-tzdata[=DIR] to specify use of system timezone data],
-+no, no)
-+
-+if test "$PHP_SYSTEM_TZDATA" != "no"; then
-+ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
-+
-+ if test "$PHP_SYSTEM_TZDATA" != "yes"; then
-+ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
-+ [Define for location of system timezone data])
-+ fi
-+fi
-+
diff --git a/php-5.6.17-libdb.patch b/php-5.6.17-libdb.patch
deleted file mode 100644
index a7bbd2e..0000000
--- a/php-5.6.17-libdb.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-diff -up php-5.6.17RC1/ext/dba/config.m4.libdb php-5.6.17RC1/ext/dba/config.m4
---- php-5.6.17RC1/ext/dba/config.m4.libdb 2015-12-10 10:42:34.643252975 +0100
-+++ php-5.6.17RC1/ext/dba/config.m4 2015-12-10 10:44:27.924729361 +0100
-@@ -312,61 +312,13 @@ if test "$PHP_DB4" != "no"; then
- dbdp4="/usr/local/BerkeleyDB.4."
- dbdp5="/usr/local/BerkeleyDB.5."
- for i in $PHP_DB4 ${dbdp5}1 ${dbdp5}0 ${dbdp4}8 ${dbdp4}7 ${dbdp4}6 ${dbdp4}5 ${dbdp4}4 ${dbdp4}3 ${dbdp4}2 ${dbdp4}1 ${dbdp}0 /usr/local /usr; do
-- if test -f "$i/db5/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/db5/db.h
-- break
-- elif test -f "$i/db4/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/db4/db.h
-- break
-- elif test -f "$i/include/db5.3/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db5.3/db.h
-- break
-- elif test -f "$i/include/db5.1/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db5.1/db.h
-- break
-- elif test -f "$i/include/db5.0/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db5.0/db.h
-- break
-- elif test -f "$i/include/db4.8/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db4.8/db.h
-- break
-- elif test -f "$i/include/db4.7/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db4.7/db.h
-- break
-- elif test -f "$i/include/db4.6/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db4.6/db.h
-- break
-- elif test -f "$i/include/db4.5/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db4.5/db.h
-- break
-- elif test -f "$i/include/db4/db.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db4/db.h
-- break
-- elif test -f "$i/include/db/db4.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db/db4.h
-- break
-- elif test -f "$i/include/db4.h"; then
-- THIS_PREFIX=$i
-- THIS_INCLUDE=$i/include/db4.h
-- break
-- elif test -f "$i/include/db.h"; then
-+ if test -f "$i/include/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db.h
- break
- fi
- done
-- PHP_DBA_DB_CHECK(4, db-5.3 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
-+ PHP_DBA_DB_CHECK(4, db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
- fi
- PHP_DBA_STD_RESULT(db4,Berkeley DB4)
-
-diff -up php-5.6.17RC1/ext/dba/dba.c.libdb php-5.6.17RC1/ext/dba/dba.c
---- php-5.6.17RC1/ext/dba/dba.c.libdb 2015-12-10 01:36:02.000000000 +0100
-+++ php-5.6.17RC1/ext/dba/dba.c 2015-12-10 10:42:34.644252979 +0100
-@@ -52,6 +52,10 @@
- #include "php_qdbm.h"
- #include "php_tcadb.h"
-
-+#ifdef DB4_INCLUDE_FILE
-+#include DB4_INCLUDE_FILE
-+#endif
-+
- /* {{{ arginfo */
- ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2)
- ZEND_ARG_INFO(0, path)
-@@ -535,6 +539,10 @@ PHP_MINFO_FUNCTION(dba)
-
- php_info_print_table_start();
- php_info_print_table_row(2, "DBA support", "enabled");
-+#ifdef DB_VERSION_STRING
-+ php_info_print_table_row(2, "libdb header version", DB_VERSION_STRING);
-+ php_info_print_table_row(2, "libdb library version", db_version(NULL, NULL, NULL));
-+#endif
- if (handlers.c) {
- smart_str_0(&handlers);
- php_info_print_table_row(2, "Supported handlers", handlers.c);
diff --git a/php-5.6.3-fixheader.patch b/php-5.6.3-fixheader.patch
deleted file mode 100644
index 7089535..0000000
--- a/php-5.6.3-fixheader.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-
-Make generated php_config.h constant across rebuilds.
-
---- php-5.4.9/configure.in.fixheader
-+++ php-5.4.9/configure.in
-@@ -1275,7 +1275,7 @@ fi
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
- EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
-
--PHP_BUILD_DATE=`date '+%Y-%m-%d'`
-+PHP_BUILD_DATE=`date '+%Y-%m-%d' -r $srcdir/NEWS`
- AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
-
- case $host_alias in
-@@ -1286,7 +1286,7 @@ case $host_alias in
- AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[hardcode for each of the cross compiler host])
- ;;
- *)
-- PHP_UNAME=`uname -a | xargs`
-+ PHP_UNAME=`uname | xargs`
- AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
- PHP_OS=`uname | xargs`
- AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
diff --git a/php-5.6.3-includedir.patch b/php-5.6.3-includedir.patch
deleted file mode 100644
index 70734cf..0000000
--- a/php-5.6.3-includedir.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- php-5.2.0/configure.in.includedir
-+++ php-5.2.0/configure.in
-@@ -1242,7 +1242,7 @@
- EXPANDED_DATADIR=$datadir
- EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
- EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"`
--INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR
-+INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR:${EXPANDED_DATADIR}/php
-
- exec_prefix=$old_exec_prefix
- libdir=$old_libdir
diff --git a/php-7.0.0-dlopen.patch b/php-7.0.0-dlopen.patch
new file mode 100644
index 0000000..4047460
--- /dev/null
+++ b/php-7.0.0-dlopen.patch
@@ -0,0 +1,30 @@
+diff -up php-7.0.0RC1/sapi/litespeed/lsapilib.c.dlopen php-7.0.0RC1/sapi/litespeed/lsapilib.c
+--- php-7.0.0RC1/sapi/litespeed/lsapilib.c.dlopen 2015-08-18 23:39:17.000000000 +0200
++++ php-7.0.0RC1/sapi/litespeed/lsapilib.c 2015-08-22 07:46:31.729721983 +0200
+@@ -582,7 +582,7 @@ static int (*fp_lve_leave)(struct liblve
+ static int (*fp_lve_jail)( struct passwd *, char *) = NULL;
+ static int lsapi_load_lve_lib()
+ {
+- s_liblve = dlopen("liblve.so.0", RTLD_LAZY);
++ s_liblve = dlopen("liblve.so.0", RTLD_NOW);
+ if (s_liblve)
+ {
+ fp_lve_is_available = dlsym(s_liblve, "lve_is_available");
+diff -up php-7.0.0RC1/Zend/zend_portability.h.dlopen php-7.0.0RC1/Zend/zend_portability.h
+--- php-7.0.0RC1/Zend/zend_portability.h.dlopen 2015-08-18 23:39:16.000000000 +0200
++++ php-7.0.0RC1/Zend/zend_portability.h 2015-08-22 07:46:31.729721983 +0200
+@@ -136,11 +136,11 @@
+ # endif
+
+ # if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
+-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
++# define DL_LOAD(libname) dlopen(libname, RTLD_NOW | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
+ # elif defined(RTLD_DEEPBIND)
+-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
++# define DL_LOAD(libname) dlopen(libname, RTLD_NOW | RTLD_GLOBAL | RTLD_DEEPBIND)
+ # else
+-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
++# define DL_LOAD(libname) dlopen(libname, RTLD_NOW | RTLD_GLOBAL)
+ # endif
+ # define DL_UNLOAD dlclose
+ # if defined(DLSYM_NEEDS_UNDERSCORE)
diff --git a/php-7.0.0-fixheader.patch b/php-7.0.0-fixheader.patch
new file mode 100644
index 0000000..771a19e
--- /dev/null
+++ b/php-7.0.0-fixheader.patch
@@ -0,0 +1,23 @@
+
+Make generated php_config.h constant across rebuilds.
+
+--- php-7.0.0/configure.in.fixheader
++++ php-7.0.0/configure.in
+@@ -1278,7 +1278,7 @@ fi
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
+ EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
+
+-PHP_BUILD_DATE=`date '+%Y-%m-%d'`
++PHP_BUILD_DATE=`date '+%Y-%m-%d' -r $srcdir/NEWS`
+ AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
+
+ case $host_alias in
+@@ -1289,7 +1289,7 @@ case $host_alias in
+ AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[hardcode for each of the cross compiler host])
+ ;;
+ *)
+- PHP_UNAME=`uname -a | xargs`
++ PHP_UNAME=`uname | xargs`
+ AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
+ PHP_OS=`uname | xargs`
+ AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
diff --git a/php-7.0.0-includedir.patch b/php-7.0.0-includedir.patch
new file mode 100644
index 0000000..2822c3f
--- /dev/null
+++ b/php-7.0.0-includedir.patch
@@ -0,0 +1,11 @@
+--- php-7.0.0/configure.in.includedir
++++ php-7.0.0/configure.in
+@@ -1245,7 +1245,7 @@
+ EXPANDED_DATADIR=$datadir
+ EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
+ EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"`
+-INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR
++INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR:${EXPANDED_DATADIR}/php
+
+ exec_prefix=$old_exec_prefix
+ libdir=$old_libdir
diff --git a/php-7.0.0-systzdata-v13.patch b/php-7.0.0-systzdata-v13.patch
new file mode 100644
index 0000000..5efc47d
--- /dev/null
+++ b/php-7.0.0-systzdata-v13.patch
@@ -0,0 +1,663 @@
+Add support for use of the system timezone database, rather
+than embedding a copy. Discussed upstream but was not desired.
+
+History:
+r13: adapt for upstream changes to use PHP allocator
+r12: adapt for upstream changes for new zic
+r11: use canonical names to avoid more case sensitivity issues
+ round lat/long from zone.tab towards zero per builtin db
+r10: make timezone case insensitive
+r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
+r8: fix compile error without --with-system-tzdata configured
+r7: improve check for valid timezone id to exclude directories
+r6: fix fd leak in r5, fix country code/BC flag use in
+ timezone_identifiers_list() using system db,
+ fix use of PECL timezonedb to override system db,
+r5: reverts addition of "System/Localtime" fake tzname.
+ updated for 5.3.0, parses zone.tab to pick up mapping between
+ timezone name, country code and long/lat coords
+r4: added "System/Localtime" tzname which uses /etc/localtime
+r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
+r2: add filesystem trawl to set up name alias index
+r1: initial revision
+
+diff -up php-7.0.0RC1/ext/date/lib/parse_tz.c.systzdata php-7.0.0RC1/ext/date/lib/parse_tz.c
+--- php-7.0.0RC1/ext/date/lib/parse_tz.c.systzdata 2015-08-18 23:39:24.000000000 +0200
++++ php-7.0.0RC1/ext/date/lib/parse_tz.c 2015-08-22 07:54:38.097258458 +0200
+@@ -20,6 +20,16 @@
+
+ #include "timelib.h"
+
++#ifdef HAVE_SYSTEM_TZDATA
++#include <sys/mman.h>
++#include <sys/stat.h>
++#include <limits.h>
++#include <fcntl.h>
++#include <unistd.h>
++
++#include "php_scandir.h"
++#endif
++
+ #include <stdio.h>
+
+ #ifdef HAVE_LOCALE_H
+@@ -32,8 +42,12 @@
+ #include <strings.h>
+ #endif
+
++#ifndef HAVE_SYSTEM_TZDATA
+ #define TIMELIB_SUPPORTS_V2DATA
+ #include "timezonedb.h"
++#endif
++
++#include <ctype.h>
+
+ #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
+ # if defined(__LITTLE_ENDIAN__)
+@@ -55,6 +69,11 @@ static int read_preamble(const unsigned
+ {
+ uint32_t version;
+
++ if (memcmp(*tzf, "TZif", 4) == 0) {
++ *tzf += 20;
++ return 0;
++ }
++
+ /* read ID */
+ version = (*tzf)[3] - '0';
+ *tzf += 4;
+@@ -298,7 +317,418 @@ void timelib_dump_tzinfo(timelib_tzinfo
+ }
+ }
+
+-static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
++#ifdef HAVE_SYSTEM_TZDATA
++
++#ifdef HAVE_SYSTEM_TZDATA_PREFIX
++#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX
++#else
++#define ZONEINFO_PREFIX "/usr/share/zoneinfo"
++#endif
++
++/* System timezone database pointer. */
++static const timelib_tzdb *timezonedb_system;
++
++/* Hash table entry for the cache of the zone.tab mapping table. */
++struct location_info {
++ char code[2];
++ double latitude, longitude;
++ char name[64];
++ char *comment;
++ struct location_info *next;
++};
++
++/* Cache of zone.tab. */
++static struct location_info **system_location_table;
++
++/* Size of the zone.tab hash table; a random-ish prime big enough to
++ * prevent too many collisions. */
++#define LOCINFO_HASH_SIZE (1021)
++
++/* Compute a case insensitive hash of str */
++static uint32_t tz_hash(const char *str)
++{
++ const unsigned char *p = (const unsigned char *)str;
++ uint32_t hash = 5381;
++ int c;
++
++ while ((c = tolower(*p++)) != '\0') {
++ hash = (hash << 5) ^ hash ^ c;
++ }
++
++ return hash % LOCINFO_HASH_SIZE;
++}
++
++/* Parse an ISO-6709 date as used in zone.tab. Returns end of the
++ * parsed string on success, or NULL on parse error. On success,
++ * writes the parsed number to *result. */
++static char *parse_iso6709(char *p, double *result)
++{
++ double v, sign;
++ char *pend;
++ size_t len;
++
++ if (*p == '+')
++ sign = 1.0;
++ else if (*p == '-')
++ sign = -1.0;
++ else
++ return NULL;
++
++ p++;
++ for (pend = p; *pend >= '0' && *pend <= '9'; pend++)
++ ;;
++
++ /* Annoying encoding used by zone.tab has no decimal point, so use
++ * the length to determine the format:
++ *
++ * 4 = DDMM
++ * 5 = DDDMM
++ * 6 = DDMMSS
++ * 7 = DDDMMSS
++ */
++ len = pend - p;
++ if (len < 4 || len > 7) {
++ return NULL;
++ }
++
++ /* p => [D]DD */
++ v = (p[0] - '0') * 10.0 + (p[1] - '0');
++ p += 2;
++ if (len == 5 || len == 7)
++ v = v * 10.0 + (*p++ - '0');
++ /* p => MM[SS] */
++ v += (10.0 * (p[0] - '0')
++ + p[1] - '0') / 60.0;
++ p += 2;
++ /* p => [SS] */
++ if (len > 5) {
++ v += (10.0 * (p[0] - '0')
++ + p[1] - '0') / 3600.0;
++ p += 2;
++ }
++
++ /* Round to five decimal place, not because it's a good idea,
++ * but, because the builtin data uses rounded data, so, match
++ * that. */
++ *result = trunc(v * sign * 100000.0) / 100000.0;
++
++ return p;
++}
++
++/* This function parses the zone.tab file to build up the mapping of
++ * timezone to country code and geographic location, and returns a
++ * hash table. The hash table is indexed by the function:
++ *
++ * tz_hash(timezone-name)
++ */
++static struct location_info **create_location_table(void)
++{
++ struct location_info **li, *i;
++ char zone_tab[PATH_MAX];
++ char line[512];
++ FILE *fp;
++
++ strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab);
++
++ fp = fopen(zone_tab, "r");
++ if (!fp) {
++ return NULL;
++ }
++
++ li = calloc(LOCINFO_HASH_SIZE, sizeof *li);
++
++ while (fgets(line, sizeof line, fp)) {
++ char *p = line, *code, *name, *comment;
++ uint32_t hash;
++ double latitude, longitude;
++
++ while (isspace(*p))
++ p++;
++
++ if (*p == '#' || *p == '\0' || *p == '\n')
++ continue;
++
++ if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t')
++ continue;
++
++ /* code => AA */
++ code = p;
++ p[2] = 0;
++ p += 3;
++
++ /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */
++ p = parse_iso6709(p, &latitude);
++ if (!p) {
++ continue;
++ }
++ p = parse_iso6709(p, &longitude);
++ if (!p) {
++ continue;
++ }
++
++ if (!p || *p != '\t') {
++ continue;
++ }
++
++ /* name = string */
++ name = ++p;
++ while (*p != '\t' && *p && *p != '\n')
++ p++;
++
++ *p++ = '\0';
++
++ /* comment = string */
++ comment = p;
++ while (*p != '\t' && *p && *p != '\n')
++ p++;
++
++ if (*p == '\n' || *p == '\t')
++ *p = '\0';
++
++ hash = tz_hash(name);
++ i = malloc(sizeof *i);
++ memcpy(i->code, code, 2);
++ strncpy(i->name, name, sizeof i->name);
++ i->comment = strdup(comment);
++ i->longitude = longitude;
++ i->latitude = latitude;
++ i->next = li[hash];
++ li[hash] = i;
++ /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */
++ }
++
++ fclose(fp);
++
++ return li;
++}
++
++/* Return location info from hash table, using given timezone name.
++ * Returns NULL if the name could not be found. */
++const struct location_info *find_zone_info(struct location_info **li,
++ const char *name)
++{
++ uint32_t hash = tz_hash(name);
++ const struct location_info *l;
++
++ if (!li) {
++ return NULL;
++ }
++
++ for (l = li[hash]; l; l = l->next) {
++ if (strcasecmp(l->name, name) == 0)
++ return l;
++ }
++
++ return NULL;
++}
++
++/* Filter out some non-tzdata files and the posix/right databases, if
++ * present. */
++static int index_filter(const struct dirent *ent)
++{
++ return strcmp(ent->d_name, ".") != 0
++ && strcmp(ent->d_name, "..") != 0
++ && strcmp(ent->d_name, "posix") != 0
++ && strcmp(ent->d_name, "posixrules") != 0
++ && strcmp(ent->d_name, "right") != 0
++ && strstr(ent->d_name, ".tab") == NULL;
++}
++
++static int sysdbcmp(const void *first, const void *second)
++{
++ const timelib_tzdb_index_entry *alpha = first, *beta = second;
++
++ return strcasecmp(alpha->id, beta->id);
++}
++
++
++/* Create the zone identifier index by trawling the filesystem. */
++static void create_zone_index(timelib_tzdb *db)
++{
++ size_t dirstack_size, dirstack_top;
++ size_t index_size, index_next;
++ timelib_tzdb_index_entry *db_index;
++ char **dirstack;
++
++ /* LIFO stack to hold directory entries to scan; each slot is a
++ * directory name relative to the zoneinfo prefix. */
++ dirstack_size = 32;
++ dirstack = malloc(dirstack_size * sizeof *dirstack);
++ dirstack_top = 1;
++ dirstack[0] = strdup("");
++
++ /* Index array. */
++ index_size = 64;
++ db_index = malloc(index_size * sizeof *db_index);
++ index_next = 0;
++
++ do {
++ struct dirent **ents;
++ char name[PATH_MAX], *top;
++ int count;
++
++ /* Pop the top stack entry, and iterate through its contents. */
++ top = dirstack[--dirstack_top];
++ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top);
++
++ count = php_scandir(name, &ents, index_filter, php_alphasort);
++
++ while (count > 0) {
++ struct stat st;
++ const char *leaf = ents[count - 1]->d_name;
++
++ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s",
++ top, leaf);
++
++ if (strlen(name) && stat(name, &st) == 0) {
++ /* Name, relative to the zoneinfo prefix. */
++ const char *root = top;
++
++ if (root[0] == '/') root++;
++
++ snprintf(name, sizeof name, "%s%s%s", root,
++ *root ? "/": "", leaf);
++
++ if (S_ISDIR(st.st_mode)) {
++ if (dirstack_top == dirstack_size) {
++ dirstack_size *= 2;
++ dirstack = realloc(dirstack,
++ dirstack_size * sizeof *dirstack);
++ }
++ dirstack[dirstack_top++] = strdup(name);
++ }
++ else {
++ if (index_next == index_size) {
++ index_size *= 2;
++ db_index = realloc(db_index,
++ index_size * sizeof *db_index);
++ }
++
++ db_index[index_next++].id = strdup(name);
++ }
++ }
++
++ free(ents[--count]);
++ }
++
++ if (count != -1) free(ents);
++ free(top);
++ } while (dirstack_top);
++
++ qsort(db_index, index_next, sizeof *db_index, sysdbcmp);
++
++ db->index = db_index;
++ db->index_size = index_next;
++
++ free(dirstack);
++}
++
++#define FAKE_HEADER "1234\0??\1??"
++#define FAKE_UTC_POS (7 - 4)
++
++/* Create a fake data segment for database 'sysdb'. */
++static void fake_data_segment(timelib_tzdb *sysdb,
++ struct location_info **info)
++{
++ size_t n;
++ char *data, *p;
++
++ data = malloc(3 * sysdb->index_size + 7);
++
++ p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1);
++
++ for (n = 0; n < sysdb->index_size; n++) {
++ const struct location_info *li;
++ timelib_tzdb_index_entry *ent;
++
++ ent = (timelib_tzdb_index_entry *)&sysdb->index[n];
++
++ /* Lookup the timezone name in the hash table. */
++ if (strcmp(ent->id, "UTC") == 0) {
++ ent->pos = FAKE_UTC_POS;
++ continue;
++ }
++
++ li = find_zone_info(info, ent->id);
++ if (li) {
++ /* If found, append the BC byte and the
++ * country code; set the position for this
++ * section of timezone data. */
++ ent->pos = (p - data) - 4;
++ *p++ = '\1';
++ *p++ = li->code[0];
++ *p++ = li->code[1];
++ }
++ else {
++ /* If not found, the timezone data can
++ * point at the header. */
++ ent->pos = 0;
++ }
++ }
++
++ sysdb->data = (unsigned char *)data;
++}
++
++/* Returns true if the passed-in stat structure describes a
++ * probably-valid timezone file. */
++static int is_valid_tzfile(const struct stat *st)
++{
++ return S_ISREG(st->st_mode) && st->st_size > 20;
++}
++
++/* To allow timezone names to be used case-insensitively, find the
++ * canonical name for this timezone, if possible. */
++static const char *canonical_tzname(const char *timezone)
++{
++ if (timezonedb_system) {
++ timelib_tzdb_index_entry *ent, lookup;
++
++ lookup.id = (char *)timezone;
++
++ ent = bsearch(&lookup, timezonedb_system->index,
++ timezonedb_system->index_size, sizeof lookup,
++ sysdbcmp);
++ if (ent) {
++ return ent->id;
++ }
++ }
++
++ return timezone;
++}
++
++/* Return the mmap()ed tzfile if found, else NULL. On success, the
++ * length of the mapped data is placed in *length. */
++static char *map_tzfile(const char *timezone, size_t *length)
++{
++ char fname[PATH_MAX];
++ struct stat st;
++ char *p;
++ int fd;
++
++ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
++ return NULL;
++ }
++
++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
++
++ fd = open(fname, O_RDONLY);
++ if (fd == -1) {
++ return NULL;
++ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st)) {
++ close(fd);
++ return NULL;
++ }
++
++ *length = st.st_size;
++ p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
++ close(fd);
++
++ return p != MAP_FAILED ? p : NULL;
++}
++
++#endif
++
++static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
+ {
+ int left = 0, right = tzdb->index_size - 1;
+ #ifdef HAVE_SETLOCALE
+@@ -337,21 +767,88 @@ static int seek_to_tz_position(const uns
+ return 0;
+ }
+
++static int seek_to_tz_position(const unsigned char **tzf, char *timezone,
++ char **map, size_t *maplen,
++ const timelib_tzdb *tzdb)
++{
++#ifdef HAVE_SYSTEM_TZDATA
++ if (tzdb == timezonedb_system) {
++ char *orig;
++
++ orig = map_tzfile(timezone, maplen);
++ if (orig == NULL) {
++ return 0;
++ }
++
++ (*tzf) = (unsigned char *)orig;
++ *map = orig;
++ return 1;
++ }
++ else
++#endif
++ {
++ return inmem_seek_to_tz_position(tzf, timezone, tzdb);
++ }
++}
++
+ const timelib_tzdb *timelib_builtin_db(void)
+ {
++#ifdef HAVE_SYSTEM_TZDATA
++ if (timezonedb_system == NULL) {
++ timelib_tzdb *tmp = malloc(sizeof *tmp);
++
++ tmp->version = "0.system";
++ tmp->data = NULL;
++ create_zone_index(tmp);
++ system_location_table = create_location_table();
++ fake_data_segment(tmp, system_location_table);
++ timezonedb_system = tmp;
++ }
++
++ return timezonedb_system;
++#else
+ return &timezonedb_builtin;
++#endif
+ }
+
+ const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count)
+ {
++#ifdef HAVE_SYSTEM_TZDATA
++ *count = timezonedb_system->index_size;
++ return timezonedb_system->index;
++#else
+ *count = sizeof(timezonedb_idx_builtin) / sizeof(*timezonedb_idx_builtin);
+ return timezonedb_idx_builtin;
++#endif
+ }
+
+ int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
+ {
+ const unsigned char *tzf;
+- return (seek_to_tz_position(&tzf, timezone, tzdb));
++
++#ifdef HAVE_SYSTEM_TZDATA
++ if (tzdb == timezonedb_system) {
++ char fname[PATH_MAX];
++ struct stat st;
++
++ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
++ 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", canonical_tzname(timezone));
++
++ return stat(fname, &st) == 0 && is_valid_tzfile(&st);
++ }
++#endif
++
++ return (inmem_seek_to_tz_position(&tzf, timezone, tzdb));
+ }
+
+ static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
+@@ -376,24 +873,54 @@ static void read_64bit_header(const unsi
+ timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
+ {
+ const unsigned char *tzf;
++ char *memmap = NULL;
++ size_t maplen;
+ timelib_tzinfo *tmp;
+ int version;
+
+- if (seek_to_tz_position(&tzf, timezone, tzdb)) {
++ if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) {
+ tmp = timelib_tzinfo_ctor(timezone);
+
+ version = read_preamble(&tzf, tmp);
+ read_header(&tzf, tmp);
+ read_transistions(&tzf, tmp);
+ read_types(&tzf, tmp);
+- if (version == 2) {
+- skip_64bit_preamble(&tzf, tmp);
+- read_64bit_header(&tzf, tmp);
+- skip_64bit_transistions(&tzf, tmp);
+- skip_64bit_types(&tzf, tmp);
+- skip_posix_string(&tzf, tmp);
+- }
+- read_location(&tzf, tmp);
++
++#ifdef HAVE_SYSTEM_TZDATA
++ if (memmap) {
++ const struct location_info *li;
++
++ /* TZif-style - grok the location info from the system database,
++ * if possible. */
++
++ if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
++ tmp->location.comments = timelib_strdup(li->comment);
++ strncpy(tmp->location.country_code, li->code, 2);
++ tmp->location.longitude = li->longitude;
++ tmp->location.latitude = li->latitude;
++ tmp->bc = 1;
++ }
++ else {
++ strcpy(tmp->location.country_code, "??");
++ tmp->bc = 0;
++ tmp->location.comments = timelib_strdup("");
++ }
++
++ /* Now done with the mmap segment - discard it. */
++ munmap(memmap, maplen);
++ } else
++#endif
++ {
++ /* PHP-style - use the embedded info. */
++ if (version == 2) {
++ skip_64bit_preamble(&tzf, tmp);
++ read_64bit_header(&tzf, tmp);
++ skip_64bit_transistions(&tzf, tmp);
++ skip_64bit_types(&tzf, tmp);
++ skip_posix_string(&tzf, tmp);
++ }
++ read_location(&tzf, tmp);
++ }
+ } else {
+ tmp = NULL;
+ }
+diff -up php-7.0.0RC1/ext/date/lib/timelib.m4.systzdata php-7.0.0RC1/ext/date/lib/timelib.m4
+--- php-7.0.0RC1/ext/date/lib/timelib.m4.systzdata 2015-08-18 23:39:24.000000000 +0200
++++ php-7.0.0RC1/ext/date/lib/timelib.m4 2015-08-22 07:47:34.854055364 +0200
+@@ -78,3 +78,17 @@ stdlib.h
+
+ dnl Check for strtoll, atoll
+ AC_CHECK_FUNCS(strtoll atoll strftime)
++
++PHP_ARG_WITH(system-tzdata, for use of system timezone data,
++[ --with-system-tzdata[=DIR] to specify use of system timezone data],
++no, no)
++
++if test "$PHP_SYSTEM_TZDATA" != "no"; then
++ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
++
++ if test "$PHP_SYSTEM_TZDATA" != "yes"; then
++ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
++ [Define for location of system timezone data])
++ fi
++fi
++
diff --git a/php-7.0.2-libdb.patch b/php-7.0.2-libdb.patch
new file mode 100644
index 0000000..f9bff95
--- /dev/null
+++ b/php-7.0.2-libdb.patch
@@ -0,0 +1,92 @@
+diff -up php-7.0.2RC1/ext/dba/config.m4.libdb php-7.0.2RC1/ext/dba/config.m4
+--- php-7.0.2RC1/ext/dba/config.m4.libdb 2015-12-27 07:54:48.669923462 +0100
++++ php-7.0.2RC1/ext/dba/config.m4 2015-12-27 07:55:03.607947034 +0100
+@@ -312,61 +312,13 @@ if test "$PHP_DB4" != "no"; then
+ dbdp4="/usr/local/BerkeleyDB.4."
+ dbdp5="/usr/local/BerkeleyDB.5."
+ for i in $PHP_DB4 ${dbdp5}1 ${dbdp5}0 ${dbdp4}8 ${dbdp4}7 ${dbdp4}6 ${dbdp4}5 ${dbdp4}4 ${dbdp4}3 ${dbdp4}2 ${dbdp4}1 ${dbdp}0 /usr/local /usr; do
+- if test -f "$i/db5/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/db5/db.h
+- break
+- elif test -f "$i/db4/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/db4/db.h
+- break
+- elif test -f "$i/include/db5.3/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db5.3/db.h
+- break
+- elif test -f "$i/include/db5.1/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db5.1/db.h
+- break
+- elif test -f "$i/include/db5.0/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db5.0/db.h
+- break
+- elif test -f "$i/include/db4.8/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db4.8/db.h
+- break
+- elif test -f "$i/include/db4.7/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db4.7/db.h
+- break
+- elif test -f "$i/include/db4.6/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db4.6/db.h
+- break
+- elif test -f "$i/include/db4.5/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db4.5/db.h
+- break
+- elif test -f "$i/include/db4/db.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db4/db.h
+- break
+- elif test -f "$i/include/db/db4.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db/db4.h
+- break
+- elif test -f "$i/include/db4.h"; then
+- THIS_PREFIX=$i
+- THIS_INCLUDE=$i/include/db4.h
+- break
+- elif test -f "$i/include/db.h"; then
++ if test -f "$i/include/db.h"; then
+ THIS_PREFIX=$i
+ THIS_INCLUDE=$i/include/db.h
+ break
+ fi
+ done
+- PHP_DBA_DB_CHECK(4, db-5.3 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
++ PHP_DBA_DB_CHECK(4, db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
+ fi
+ PHP_DBA_STD_RESULT(db4,Berkeley DB4)
+
+diff -up php-7.0.2RC1/ext/dba/dba.c.libdb php-7.0.2RC1/ext/dba/dba.c
+--- php-7.0.2RC1/ext/dba/dba.c.libdb 2015-12-22 16:19:29.000000000 +0100
++++ php-7.0.2RC1/ext/dba/dba.c 2015-12-27 07:52:30.381638216 +0100
+@@ -52,6 +52,10 @@
+ #include "php_qdbm.h"
+ #include "php_tcadb.h"
+
++#ifdef DB4_INCLUDE_FILE
++#include DB4_INCLUDE_FILE
++#endif
++
+ /* {{{ arginfo */
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2)
+ ZEND_ARG_INFO(0, path)
+@@ -552,6 +556,10 @@ PHP_MINFO_FUNCTION(dba)
+
+ php_info_print_table_start();
+ php_info_print_table_row(2, "DBA support", "enabled");
++#ifdef DB_VERSION_STRING
++ php_info_print_table_row(2, "libdb header version", DB_VERSION_STRING);
++ php_info_print_table_row(2, "libdb library version", db_version(NULL, NULL, NULL));
++#endif
+ if (handlers.s) {
+ smart_str_0(&handlers);
+ php_info_print_table_row(2, "Supported handlers", ZSTR_VAL(handlers.s));
diff --git a/php-fpm-www.conf b/php-fpm-www.conf
index 365ede0..6896dc9 100644
--- a/php-fpm-www.conf
+++ b/php-fpm-www.conf
@@ -5,6 +5,7 @@
; Per pool prefix
; It only applies on the following directives:
+; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
@@ -30,17 +31,15 @@ group = apache
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
-; 'port' - to listen on a TCP socket to all IPv4 addresses on a
-; specific port;
-; '[::]:port' - to listen on a TCP socket to all addresses
+; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /run/php-fpm/www.sock
; Set listen(2) backlog.
-; Default Value: 65535
-;listen.backlog = 65535
+; Default Value: 511
+;listen.backlog = 511
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server.
@@ -302,9 +301,13 @@ pm.max_spare_servers = 35
; %t: server time the request was received
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %u: remote user
;
; Default: "%R - %u %t \"%m %r\" %s"
@@ -375,7 +378,7 @@ slowlog = /var/log/php-fpm/www-slow.log
; exectute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
-;security.limit_extensions = .php .php3 .php4 .php5
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
@@ -411,8 +414,9 @@ php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 128M
-; Set session path to a directory owned by process user
+; Set data paths to directories owned by process user
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session
php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache
+;php_value[opcache.file_cache] = /var/lib/php/opcache
diff --git a/php.conf b/php.conf
index 9248f44..1a5d148 100644
--- a/php.conf
+++ b/php.conf
@@ -17,7 +17,7 @@ AddType text/html .php
DirectoryIndex index.php
# mod_php options
-<IfModule mod_php5.c>
+<IfModule mod_php7.c>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
@@ -40,14 +40,18 @@ DirectoryIndex index.php
php_value session.save_handler "files"
php_value session.save_path "/var/lib/php/session"
php_value soap.wsdl_cache_dir "/var/lib/php/wsdlcache"
+
+ #php_value opcache.file_cache "/var/lib/php/opcache"
</IfModule>
# Redirect to local php-fpm if mod_php is not available
<IfModule !mod_php5.c>
+ <IfModule !mod_php7.c>
# Enable http authorization headers
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
+ </IfModule>
</IfModule>
diff --git a/php.ini b/php.ini
index b462a9d..569e807 100644
--- a/php.ini
+++ b/php.ini
@@ -201,10 +201,6 @@ engine = On
; http://php.net/short-open-tag
short_open_tag = Off
-; Allow ASP-style <% %> tags.
-; http://php.net/asp-tags
-asp_tags = Off
-
; The number of significant digits displayed in floating point numbers.
; http://php.net/precision
precision = 14
@@ -293,20 +289,17 @@ serialize_precision = 17
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
-; or per-virtualhost web server configuration file. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
;open_basedir =
; This directive allows you to disable certain functions for security reasons.
-; It receives a comma-delimited list of function names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions =
; This directive allows you to disable certain classes for security reasons.
-; It receives a comma-delimited list of class names. This directive is
-; *NOT* affected by whether Safe Mode is turned On or Off.
+; It receives a comma-delimited list of class names.
; http://php.net/disable-classes
disable_classes =
@@ -611,13 +604,13 @@ html_errors = On
; http://php.net/variables-order
variables_order = "GPCS"
-; This directive determines which super global data (G,P,C,E & S) should
-; be registered into the super global array REQUEST. If so, it also determines
-; the order in which that data is registered. The values for this directive are
-; specified in the same manner as the variables_order directive, EXCEPT one.
-; Leaving this value empty will cause PHP to use the value set in the
-; variables_order directive. It does not mean it will leave the super globals
-; array REQUEST empty.
+; This directive determines which super global data (G,P & C) should be
+; registered into the super global array REQUEST. If so, it also determines
+; the order in which that data is registered. The values for this directive
+; are specified in the same manner as the variables_order directive,
+; EXCEPT one. Leaving this value empty will cause PHP to use the value set
+; in the variables_order directive. It does not mean it will leave the super
+; globals array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
@@ -678,7 +671,7 @@ auto_append_file =
; http://php.net/default-mimetype
default_mimetype = "text/html"
-; PHP's default character set is set to empty.
+; PHP's default character set is set to UTF-8.
; http://php.net/default-charset
default_charset = "UTF-8"
@@ -688,22 +681,17 @@ default_charset = "UTF-8"
;internal_encoding =
; PHP input character encoding is set to empty.
+; If empty, default_charset is used.
; http://php.net/input-encoding
;input_encoding =
; PHP output character encoding is set to empty.
+; If empty, default_charset is used.
; mbstring or iconv output handler is used.
; See also output_buffer.
; http://php.net/output-encoding
;output_encoding =
-; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
-; to disable this feature and it will be removed in a future version.
-; If post reading is disabled through enable_post_data_reading,
-; $HTTP_RAW_POST_DATA is *NOT* populated.
-; http://php.net/always-populate-raw-post-data
-;always_populate_raw_post_data = -1
-
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -951,6 +939,10 @@ cli_server.color = On
; http://php.net/pcre.recursion-limit
;pcre.recursion_limit=100000
+;Enables or disables JIT compilation of patterns. This requires the PCRE
+;library to be compiled with JIT support.
+;pcre.jit=1
+
[Pdo]
; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
; http://php.net/pdo-odbc.connection-pooling
@@ -984,7 +976,7 @@ sendmail_path = /usr/sbin/sendmail -t -i
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
-; the 5th parameter to mail(), even in safe mode.
+; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
@@ -1074,64 +1066,6 @@ ibase.dateformat = "%Y-%m-%d"
; Default time format.
ibase.timeformat = "%H:%M:%S"
-[MySQL]
-; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
-; http://php.net/mysql.allow_local_infile
-mysql.allow_local_infile = On
-
-; Allow or prevent persistent links.
-; http://php.net/mysql.allow-persistent
-mysql.allow_persistent = On
-
-; If mysqlnd is used: Number of cache slots for the internal result set cache
-; http://php.net/mysql.cache_size
-mysql.cache_size = 2000
-
-; Maximum number of persistent links. -1 means no limit.
-; http://php.net/mysql.max-persistent
-mysql.max_persistent = -1
-
-; Maximum number of links (persistent + non-persistent). -1 means no limit.
-; http://php.net/mysql.max-links
-mysql.max_links = -1
-
-; Default port number for mysql_connect(). If unset, mysql_connect() will use
-; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
-; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
-; at MYSQL_PORT.
-; http://php.net/mysql.default-port
-mysql.default_port =
-
-; Default socket name for local MySQL connects. If empty, uses the built-in
-; MySQL defaults.
-; http://php.net/mysql.default-socket
-mysql.default_socket =
-
-; Default host for mysql_connect() (doesn't apply in safe mode).
-; http://php.net/mysql.default-host
-mysql.default_host =
-
-; Default user for mysql_connect() (doesn't apply in safe mode).
-; http://php.net/mysql.default-user
-mysql.default_user =
-
-; Default password for mysql_connect() (doesn't apply in safe mode).
-; Note that this is generally a *bad* idea to store passwords in this file.
-; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
-; and reveal this password! And of course, any users with read access to this
-; file will be able to reveal the password as well.
-; http://php.net/mysql.default-password
-mysql.default_password =
-
-; Maximum time (in seconds) for connect timeout. -1 means no limit
-; http://php.net/mysql.connect-timeout
-mysql.connect_timeout = 60
-
-; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
-; SQL-Errors will be displayed.
-; http://php.net/mysql.trace-mode
-mysql.trace_mode = Off
-
[MySQLi]
; Maximum number of persistent links. -1 means no limit.
@@ -1205,59 +1139,6 @@ mysqlnd.collect_memory_statistics = Off
; http://php.net/mysqlnd.net_read_buffer_size
;mysqlnd.net_read_buffer_size = 32768
-[OCI8]
-
-; Connection: Enables privileged connections using external
-; credentials (OCI_SYSOPER, OCI_SYSDBA)
-; http://php.net/oci8.privileged-connect
-;oci8.privileged_connect = Off
-
-; Connection: The maximum number of persistent OCI8 connections per
-; process. Using -1 means no limit.
-; http://php.net/oci8.max-persistent
-;oci8.max_persistent = -1
-
-; Connection: The maximum number of seconds a process is allowed to
-; maintain an idle persistent connection. Using -1 means idle
-; persistent connections will be maintained forever.
-; http://php.net/oci8.persistent-timeout
-;oci8.persistent_timeout = -1
-
-; Connection: The number of seconds that must pass before issuing a
-; ping during oci_pconnect() to check the connection validity. When
-; set to 0, each oci_pconnect() will cause a ping. Using -1 disables
-; pings completely.
-; http://php.net/oci8.ping-interval
-;oci8.ping_interval = 60
-
-; Connection: Set this to a user chosen connection class to be used
-; for all pooled server requests with Oracle 11g Database Resident
-; Connection Pooling (DRCP). To use DRCP, this value should be set to
-; the same string for all web servers running the same application,
-; the database pool must be configured, and the connection string must
-; specify to use a pooled server.
-;oci8.connection_class =
-
-; High Availability: Using On lets PHP receive Fast Application
-; Notification (FAN) events generated when a database node fails. The
-; database must also be configured to post FAN events.
-;oci8.events = Off
-
-; Tuning: This option enables statement caching, and specifies how
-; many statements to cache. Using 0 disables statement caching.
-; http://php.net/oci8.statement-cache-size
-;oci8.statement_cache_size = 20
-
-; Tuning: Enables statement prefetching and sets the default number of
-; rows that will be fetched automatically after statement execution.
-; http://php.net/oci8.default-prefetch
-;oci8.default_prefetch = 100
-
-; Compatibility. Using On means oci_close() will not close
-; oci_connect() and oci_new_connect() connections.
-; http://php.net/oci8.old-oci-close-semantics
-;oci8.old_oci_close_semantics = Off
-
[PostgreSQL]
; Allow or prevent persistent links.
; http://php.net/pgsql.allow-persistent
@@ -1286,45 +1167,6 @@ pgsql.ignore_notice = 0
; http://php.net/pgsql.log-notice
pgsql.log_notice = 0
-[Sybase-CT]
-; Allow or prevent persistent links.
-; http://php.net/sybct.allow-persistent
-sybct.allow_persistent = On
-
-; Maximum number of persistent links. -1 means no limit.
-; http://php.net/sybct.max-persistent
-sybct.max_persistent = -1
-
-; Maximum number of links (persistent + non-persistent). -1 means no limit.
-; http://php.net/sybct.max-links
-sybct.max_links = -1
-
-; Minimum server message severity to display.
-; http://php.net/sybct.min-server-severity
-sybct.min_server_severity = 10
-
-; Minimum client message severity to display.
-; http://php.net/sybct.min-client-severity
-sybct.min_client_severity = 10
-
-; Set per-context timeout
-; http://php.net/sybct.timeout
-;sybct.timeout=
-
-;sybct.packet_size
-
-; The maximum time in seconds to wait for a connection attempt to succeed before returning failure.
-; Default: one minute
-;sybct.login_timeout=
-
-; The name of the host you claim to be connecting from, for display by sp_who.
-; Default: none
-;sybct.hostname=
-
-; Allows you to define how often deadlocks are to be retried. -1 means "forever".
-; Default: 0
-;sybct.deadlock_retry_count=
-
[bcmath]
; Number of decimal digits for all bcmath functions.
; http://php.net/bcmath.scale
@@ -1579,64 +1421,27 @@ url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
; http://php.net/session.upload-progress.min-freq
;session.upload_progress.min_freq = "1"
-[MSSQL]
-; Allow or prevent persistent links.
-mssql.allow_persistent = On
-
-; Maximum number of persistent links. -1 means no limit.
-mssql.max_persistent = -1
-
-; Maximum number of links (persistent+non persistent). -1 means no limit.
-mssql.max_links = -1
-
-; Minimum error severity to display.
-mssql.min_error_severity = 10
-
-; Minimum message severity to display.
-mssql.min_message_severity = 10
-
-; Compatibility mode with old versions of PHP 3.0.
-mssql.compatibility_mode = Off
-
-; Connect timeout
-;mssql.connect_timeout = 5
-
-; Query timeout
-;mssql.timeout = 60
-
-; Valid range 0 - 2147483647. Default = 4096.
-;mssql.textlimit = 4096
-
-; Valid range 0 - 2147483647. Default = 4096.
-;mssql.textsize = 4096
-
-; Limits the number of records in each batch. 0 = all records in one batch.
-;mssql.batchsize = 0
-
-; Specify how datetime and datetim4 columns are returned
-; On => Returns data converted to SQL server settings
-; Off => Returns values as YYYY-MM-DD hh:mm:ss
-;mssql.datetimeconvert = On
-
-; Use NT authentication when connecting to the server
-mssql.secure_connection = Off
-
-; Specify max number of processes. -1 = library default
-; msdlib defaults to 25
-; FreeTDS defaults to 4096
-;mssql.max_procs = -1
-
-; Specify client character set.
-; If empty or not set the client charset from freetds.conf is used
-; This is only used when compiled with FreeTDS
-;mssql.charset = "ISO-8859-1"
-
[Assertion]
+; Switch whether to compile assertions at all (to have no overhead at run-time)
+; -1: Do not compile at all
+; 0: Jump over assertion at run-time
+; 1: Execute assertions
+; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1)
+; Default Value: 1
+; Development Value: 1
+; Production Value: -1
+; http://php.net/zend.assertions
+zend.assertions = -1
+
; Assert(expr); active by default.
; http://php.net/assert.active
;assert.active = On
-; Issue a PHP warning for each failed assertion.
+; Throw an AssertationException on failed assertions
+; http://php.net/assert.exception
+;assert.exception = On
+
+; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active)
; http://php.net/assert.warning
;assert.warning = On
@@ -1655,7 +1460,7 @@ mssql.secure_connection = Off
[mbstring]
; language for internal character representation.
-; This affects mb_send_mail() and mbstrig.detect_order.
+; This affects mb_send_mail() and mbstring.detect_order.
; http://php.net/mbstring.language
;mbstring.language = Japanese
diff --git a/php.modconf b/php.modconf
index 87f97c9..3377f72 100644
--- a/php.modconf
+++ b/php.modconf
@@ -2,7 +2,11 @@
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
-<IfModule prefork.c>
- LoadModule php5_module modules/libphp5.so
+
+# Cannot load both php5 and php7 modules
+<IfModule !mod_php5.c>
+ <IfModule prefork.c>
+ LoadModule php7_module modules/libphp7.so
+ </IfModule>
</IfModule>
diff --git a/php.spec b/php.spec
index 23915af..c838feb 100644
--- a/php.spec
+++ b/php.spec
@@ -6,29 +6,23 @@
# Please preserve changelog entries
#
# API/ABI check
-%global apiver 20131106
-%global zendver 20131226
-%global pdover 20080721
+%global apiver 20151012
+%global zendver 20151012
+%global pdover 20150127
# Extension version
-%global opcachever 7.0.6-dev
-
-# Use for first build of PHP (before pecl/zip and pecl/jsonc)
-%global php_bootstrap 0
+%global jsonver 1.4.0
# Adds -z now to the linker flags
%global _hardened_build 1
# version used for php embedded library soname
-%global embed_version 5.6
+%global embed_version 7.0
%global mysql_sock %(mysql_config --socket 2>/dev/null || echo /var/lib/mysql/mysql.sock)
# Regression tests take a long time, you can skip 'em with this
-%if %{php_bootstrap}
-%global runselftest 0
-%else
+#global runselftest 0
%{!?runselftest: %global runselftest 1}
-%endif
# Use the arch-specific mysql_config binary to avoid mismatch with the
# arch detection heuristic used by bindir/mysql_config.
@@ -69,7 +63,7 @@
Summary: PHP scripting language for creating dynamic web sites
Name: php
-Version: 5.6.23
+Version: 7.0.8
%if 0%{?rcver:1}
Release: 0.%{rpmrel}.%{rcver}%{?dist}
%else
@@ -82,10 +76,7 @@ License: PHP and Zend and BSD
Group: Development/Languages
URL: http://www.php.net/
-# Need to download official tarball and strip non-free stuff
-# wget http://www.php.net/distributions/php-%%{version}%%{?rcver}.tar.xz
-# ./strip.sh %%{version}
-Source0: php-%{version}%{?rcver}-strip.tar.xz
+Source0: http://www.php.net/distributions/php-%{version}%{?rcver}.tar.xz
Source1: php.conf
Source2: php.ini
Source3: macros.php
@@ -95,28 +86,27 @@ Source6: php-fpm.service
Source7: php-fpm.logrotate
Source9: php.modconf
Source10: php.ztsmodconf
-Source11: strip.sh
Source13: nginx-fpm.conf
Source14: nginx-php.conf
# Configuration files for some extensions
-Source50: opcache.ini
+Source50: 10-opcache.ini
Source51: opcache-default.blacklist
# Build fixes
-Patch5: php-5.6.3-includedir.patch
+Patch5: php-7.0.0-includedir.patch
Patch6: php-5.6.3-embed.patch
Patch7: php-5.3.0-recode.patch
-Patch8: php-5.6.17-libdb.patch
+Patch8: php-7.0.2-libdb.patch
# Functional changes
-Patch40: php-5.4.0-dlopen.patch
-Patch42: php-5.6.13-systzdata-v12.patch
+Patch40: php-7.0.0-dlopen.patch
+Patch42: php-7.0.0-systzdata-v13.patch
# See http://bugs.php.net/53436
Patch43: php-5.4.0-phpize.patch
# Use -lldap_r for OpenLDAP
Patch45: php-5.6.3-ldap_r.patch
# Make php_config.h constant across builds
-Patch46: php-5.6.3-fixheader.patch
+Patch46: php-7.0.0-fixheader.patch
# drop "Configure command" from phpinfo output
Patch47: php-5.6.3-phpinfo.patch
@@ -248,7 +238,6 @@ Provides: php-core = %{version}, php-core%{?_isa} = %{version}
Provides: php-ctype, php-ctype%{?_isa}
Provides: php-curl, php-curl%{?_isa}
Provides: php-date, php-date%{?_isa}
-Provides: php-ereg, php-ereg%{?_isa}
Provides: php-exif, php-exif%{?_isa}
Provides: php-fileinfo, php-fileinfo%{?_isa}
Provides: php-filter, php-filter%{?_isa}
@@ -267,9 +256,8 @@ Provides: php-sockets, php-sockets%{?_isa}
Provides: php-spl, php-spl%{?_isa}
Provides: php-standard = %{version}, php-standard%{?_isa} = %{version}
Provides: php-tokenizer, php-tokenizer%{?_isa}
-%if ! %{php_bootstrap}
-Requires: php-pecl-jsonc%{?_isa}
-%endif
+# For user experience, those extensions were part of php-common
+Requires: php-json%{?_isa} = %{version}-%{release}
%if %{with_zip}
Provides: php-zip, php-zip%{?_isa}
Obsoletes: php-pecl-zip < 1.11
@@ -288,13 +276,12 @@ Group: Development/Libraries
Summary: Files needed for building PHP extensions
Requires: php-cli%{?_isa} = %{version}-%{release}, autoconf, automake
Requires: pcre-devel%{?_isa}
+Obsoletes: php-pecl-json-devel < %{jsonver}
+Obsoletes: php-pecl-jsonc-devel < %{jsonver}
%if %{with_zts}
Provides: php-zts-devel = %{version}-%{release}
Provides: php-zts-devel%{?_isa} = %{version}-%{release}
%endif
-%if ! %{php_bootstrap}
-Requires: php-pecl-jsonc-devel%{?_isa}
-%endif
%description devel
The php-devel package contains the files needed for building PHP
@@ -307,10 +294,10 @@ Group: Development/Languages
License: PHP
Requires: php-common%{?_isa} = %{version}-%{release}
Obsoletes: php-pecl-zendopcache
-Provides: php-pecl-zendopcache = %{opcachever}
-Provides: php-pecl-zendopcache%{?_isa} = %{opcachever}
-Provides: php-pecl(opcache) = %{opcachever}
-Provides: php-pecl(opcache)%{?_isa} = %{opcachever}
+Provides: php-pecl-zendopcache = %{version}
+Provides: php-pecl-zendopcache%{?_isa} = %{version}
+Provides: php-pecl(opcache) = %{version}
+Provides: php-pecl(opcache)%{?_isa} = %{version}
%description opcache
The Zend OPcache provides faster PHP execution through opcode caching and
@@ -371,8 +358,6 @@ Group: Development/Languages
License: PHP
Requires: php-pdo%{?_isa} = %{version}-%{release}
Provides: php_database
-Provides: php-mysql = %{version}-%{release}
-Provides: php-mysql%{?_isa} = %{version}-%{release}
Provides: php-mysqli = %{version}-%{release}
Provides: php-mysqli%{?_isa} = %{version}-%{release}
Provides: php-pdo_mysql, php-pdo_mysql%{?_isa}
@@ -549,7 +534,6 @@ License: PHP
License: PHP and BSD
%endif
Requires: php-common%{?_isa} = %{version}-%{release}
-BuildRequires: t1lib-devel
%if %{with_libgd}
BuildRequires: gd-devel >= 2.1.0
%else
@@ -558,7 +542,7 @@ BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: freetype-devel
BuildRequires: libXpm-devel
-BuildRequires: libvpx-devel
+BuildRequires: libwebp-devel
%endif
%description gd
@@ -625,8 +609,8 @@ BuildRequires: libtidy-devel
The php-tidy package contains a dynamic shared object that will add
support for using the tidy library to PHP.
-%package mssql
-Summary: MSSQL database module for PHP
+%package pdo-dblib
+Summary: PDO driver Microsoft SQL Server and Sybase databases
Group: Development/Languages
# All files licensed under PHP version 3.01
License: PHP
@@ -634,11 +618,10 @@ Requires: php-pdo%{?_isa} = %{version}-%{release}
BuildRequires: freetds-devel
Provides: php-pdo_dblib, php-pdo_dblib%{?_isa}
-%description mssql
-The php-mssql package contains a dynamic shared object that will
-add MSSQL database support to PHP. It uses the TDS (Tabular
-DataStream) protocol through the freetds library, hence any
-database server which supports TDS can be accessed.
+%description pdo-dblib
+The php-pdo-dblib package contains a dynamic shared object
+that implements the PHP Data Objects (PDO) interface to enable access from
+PHP to Microsoft SQL Server and Sybase databases through the FreeTDS libary.
%package embedded
Summary: PHP library for embedding in applications
@@ -700,6 +683,24 @@ BuildRequires: enchant-devel >= 1.2.4
The php-enchant package contains a dynamic shared object that will add
support for using the enchant library to PHP.
+%package json
+Summary: JavaScript Object Notation extension for PHP
+# All files licensed under PHP version 3.0.1
+License: PHP
+Group: System Environment/Libraries
+Requires: php-common%{?_isa} = %{version}-%{release}
+Obsoletes: php-pecl-json < %{jsonver}
+Obsoletes: php-pecl-jsonc < %{jsonver}
+Provides: php-pecl(json) = %{jsonver}
+Provides: php-pecl(json)%{?_isa} = %{jsonver}
+Provides: php-pecl-json = %{jsonver}
+Provides: php-pecl-json%{?_isa} = %{jsonver}
+
+%description json
+The php-json package provides an extension that will add
+support for JavaScript Object Notation (JSON) to PHP.
+
+
%prep
%setup -q -n php-%{version}%{?rcver}
@@ -732,7 +733,6 @@ httpd -V | grep -q 'threaded:.*yes' && exit 1
# Prevent %%doc confusion over LICENSE files
cp Zend/LICENSE Zend/ZEND_LICENSE
cp TSRM/LICENSE TSRM_LICENSE
-cp ext/ereg/regex/COPYRIGHT regex_COPYRIGHT
%if ! %{with_libgd}
cp ext/gd/libgd/README libgd_README
cp ext/gd/libgd/COPYING libgd_COPYING
@@ -761,6 +761,7 @@ rm ext/date/tests/timezone_version_get_basic1.phpt
rm ext/sockets/tests/mcast_ipv?_recv.phpt
# cause stack exhausion
rm Zend/tests/bug54268.phpt
+rm Zend/tests/bug68412.phpt
# Safety check for API version change.
pver=$(sed -n '/#define PHP_VERSION /{s/.* "//;s/".*$//;p}' main/php_version.h)
@@ -792,11 +793,10 @@ if test "x${vpdo}" != "x%{pdover}"; then
exit 1
fi
-# Check for some extension version
-ver=$(sed -n '/#define PHP_ZENDOPCACHE_VERSION /{s/.* "//;s/".*$//;p}' ext/opcache/ZendAccelerator.h)
-if test "$ver" != "%{opcachever}"; then
- : Error: Upstream OPCACHE version is now ${ver}, expecting %{opcachever}.
- : Update the opcachever macro and rebuild.
+ver=$(sed -n '/#define PHP_JSON_VERSION /{s/.* "//;s/".*$//;p}' ext/json/php_json.h)
+if test "$ver" != "%{jsonver}"; then
+ : Error: Upstream JSON version is now ${ver}, expecting %{jsonver}.
+ : Update the %{jsonver} macro and rebuild.
exit 1
fi
@@ -821,6 +821,10 @@ echo "d /run/php-fpm 755 root root" >php-fpm.tmpfiles
# Some extensions have their own configuration file
cp %{SOURCE50} 10-opcache.ini
+%ifarch x86_64
+sed -e '/opcache.huge_code_pages/s/0/1/' -i 10-opcache.ini
+%endif
+
%build
# aclocal workaround - to be improved
@@ -875,7 +879,6 @@ ln -sf ../configure
--with-png-dir=%{_prefix} \
--with-xpm-dir=%{_prefix} \
--enable-gd-native-ttf \
- --with-t1lib=%{_prefix} \
--without-gdbm \
--with-jpeg-dir=%{_prefix} \
--with-openssl \
@@ -906,6 +909,7 @@ pushd build-cgi
build --libdir=%{_libdir}/php \
--enable-pcntl \
--enable-opcache \
+ --enable-opcache-file \
--enable-phpdbg \
--with-imap=shared --with-imap-ssl \
--enable-mbstring=shared \
@@ -931,7 +935,6 @@ build --libdir=%{_libdir}/php \
--with-xmlrpc=shared \
--with-ldap=shared --with-ldap-sasl \
--enable-mysqlnd=shared \
- --with-mysql=shared,mysqlnd \
--with-mysqli=shared,mysqlnd \
--with-mysql-sock=%{mysql_sock} \
--with-interbase=shared,%{_libdir}/firebird \
@@ -953,6 +956,7 @@ build --libdir=%{_libdir}/php \
--with-pdo-sqlite=shared,%{_prefix} \
--with-pdo-dblib=shared,%{_prefix} \
--with-sqlite3=shared,%{_prefix} \
+ --enable-json=shared \
%if %{with_zip}
--enable-zip=shared \
%if %{with_libzip}
@@ -965,7 +969,6 @@ build --libdir=%{_libdir}/php \
--enable-phar=shared \
--with-mcrypt=shared,%{_prefix} \
--with-tidy=shared,%{_prefix} \
- --with-mssql=shared,%{_prefix} \
--enable-sysvmsg=shared --enable-sysvshm=shared --enable-sysvsem=shared \
--enable-shmop=shared \
--enable-posix=shared \
@@ -980,6 +983,7 @@ popd
without_shared="--without-gd \
--disable-dom --disable-dba --without-unixODBC \
--disable-opcache \
+ --disable-json \
--disable-xmlreader --disable-xmlwriter \
--without-sqlite3 --disable-phar --disable-fileinfo \
--without-pspell --disable-wddx \
@@ -993,7 +997,7 @@ without_shared="--without-gd \
pushd build-apache
build --with-apxs2=%{_httpd_apxs} \
--libdir=%{_libdir}/php \
- --without-mysql \
+ --without-mysqli \
--disable-pdo \
${without_shared}
popd
@@ -1004,16 +1008,16 @@ build --enable-fpm \
--with-fpm-acl \
--with-fpm-systemd \
--libdir=%{_libdir}/php \
- --without-mysql \
+ --without-mysqli \
--disable-pdo \
${without_shared}
popd
# Build for inclusion as embedded script language into applications,
-# /usr/lib[64]/libphp5.so
+# /usr/lib[64]/libphp7.so
pushd build-embedded
build --enable-embed \
- --without-mysql --disable-pdo \
+ --without-mysqli --disable-pdo \
${without_shared}
popd
@@ -1030,6 +1034,7 @@ build --includedir=%{_includedir}/php-zts \
--with-config-file-scan-dir=%{_sysconfdir}/php-zts.d \
--enable-pcntl \
--enable-opcache \
+ --enable-opcache-file \
--with-imap=shared --with-imap-ssl \
--enable-mbstring=shared \
--enable-mbregex \
@@ -1054,7 +1059,6 @@ build --includedir=%{_includedir}/php-zts \
--with-xmlrpc=shared \
--with-ldap=shared --with-ldap-sasl \
--enable-mysqlnd=shared \
- --with-mysql=shared,mysqlnd \
--with-mysqli=shared,mysqlnd \
--with-mysql-sock=%{mysql_sock} \
--enable-mysqlnd-threading \
@@ -1077,6 +1081,7 @@ build --includedir=%{_includedir}/php-zts \
--with-pdo-sqlite=shared,%{_prefix} \
--with-pdo-dblib=shared,%{_prefix} \
--with-sqlite3=shared,%{_prefix} \
+ --enable-json=shared \
%if %{with_zip}
--enable-zip=shared \
%if %{with_libzip}
@@ -1089,7 +1094,6 @@ build --includedir=%{_includedir}/php-zts \
--enable-phar=shared \
--with-mcrypt=shared,%{_prefix} \
--with-tidy=shared,%{_prefix} \
- --with-mssql=shared,%{_prefix} \
--enable-sysvmsg=shared --enable-sysvshm=shared --enable-sysvsem=shared \
--enable-shmop=shared \
--enable-posix=shared \
@@ -1108,7 +1112,7 @@ build --with-apxs2=%{_httpd_apxs} \
--libdir=%{_libdir}/php-zts \
--enable-maintainer-zts \
--with-config-file-scan-dir=%{_sysconfdir}/php-zts.d \
- --without-mysql \
+ --without-mysqli \
--disable-pdo \
${without_shared}
popd
@@ -1172,18 +1176,18 @@ install -m 755 -d $RPM_BUILD_ROOT%{_datadir}/php
# install the DSO
install -m 755 -d $RPM_BUILD_ROOT%{_httpd_moddir}
-install -m 755 build-apache/libs/libphp5.so $RPM_BUILD_ROOT%{_httpd_moddir}
+install -m 755 build-apache/libs/libphp7.so $RPM_BUILD_ROOT%{_httpd_moddir}
%if %{with_zts}
# install the ZTS DSO
-install -m 755 build-zts/libs/libphp5.so $RPM_BUILD_ROOT%{_httpd_moddir}/libphp5-zts.so
+install -m 755 build-zts/libs/libphp7.so $RPM_BUILD_ROOT%{_httpd_moddir}/libphp7-zts.so
%endif
# Apache config fragment
# Dual config file with httpd >= 2.4 (fedora >= 18)
-install -D -m 644 %{SOURCE9} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-php.conf
+install -D -m 644 %{SOURCE9} $RPM_BUILD_ROOT%{_httpd_modconfdir}/15-php.conf
%if %{with_zts}
-cat %{SOURCE10} >>$RPM_BUILD_ROOT%{_httpd_modconfdir}/10-php.conf
+cat %{SOURCE10} >>$RPM_BUILD_ROOT%{_httpd_modconfdir}/15-php.conf
%endif
install -D -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_httpd_confdir}/php.conf
@@ -1195,6 +1199,7 @@ install -m 755 -d $RPM_BUILD_ROOT%{_sharedstatedir}/php
install -m 755 -d $RPM_BUILD_ROOT%{_sharedstatedir}/php/peclxml
install -m 700 -d $RPM_BUILD_ROOT%{_sharedstatedir}/php/session
install -m 700 -d $RPM_BUILD_ROOT%{_sharedstatedir}/php/wsdlcache
+install -m 700 -d $RPM_BUILD_ROOT%{_sharedstatedir}/php/opcache
# PHP-FPM stuff
# Log
@@ -1205,6 +1210,7 @@ install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.d
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.conf
install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.d/www.conf
mv $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.conf.default .
+mv $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.d/www.conf.default .
# tmpfiles.d
install -m 755 -d $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d
install -m 644 php-fpm.tmpfiles $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d/php-fpm.conf
@@ -1220,8 +1226,8 @@ install -D -m 644 %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d/php-fpm
install -D -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/default.d/php.conf
# Generate files lists and stub .ini files for each subpackage
-for mod in pgsql odbc ldap snmp xmlrpc imap \
- mysqlnd mysql mysqli pdo_mysql \
+for mod in pgsql odbc ldap snmp xmlrpc imap json \
+ mysqlnd mysqli pdo_mysql \
mbstring gd dom xsl soap bcmath dba xmlreader xmlwriter \
simplexml bz2 calendar ctype exif ftp gettext gmp iconv \
sockets tokenizer opcache \
@@ -1232,14 +1238,14 @@ for mod in pgsql odbc ldap snmp xmlrpc imap \
interbase pdo_firebird \
sqlite3 \
enchant phar fileinfo intl \
- mcrypt tidy pdo_dblib mssql pspell curl wddx \
+ mcrypt tidy pdo_dblib pspell curl wddx \
posix shmop sysvshm sysvsem sysvmsg recode xml \
; do
case $mod in
opcache)
# Zend extensions
ini=10-${mod}.ini;;
- pdo_*|mysql|mysqli|wddx|xmlreader|xmlrpc)
+ pdo_*|mysqli|wddx|xmlreader|xmlrpc)
# Extensions with dependencies on 20-*
ini=30-${mod}.ini;;
*)
@@ -1277,13 +1283,11 @@ cat files.dom files.xsl files.xml{reader,writer} files.wddx \
files.simplexml >> files.xml
# mysqlnd
-cat files.mysql \
- files.mysqli \
+cat files.mysqli \
files.pdo_mysql \
>> files.mysqlnd
# Split out the PDO modules
-cat files.pdo_dblib >> files.mssql
cat files.pdo_pgsql >> files.pgsql
cat files.pdo_odbc >> files.odbc
cat files.pdo_firebird >> files.interbase
@@ -1328,7 +1332,7 @@ rm -rf $RPM_BUILD_ROOT%{_libdir}/php/modules/*.a \
$RPM_BUILD_ROOT%{_libdir}/php-zts/modules/*.a \
$RPM_BUILD_ROOT%{_bindir}/{phptar} \
$RPM_BUILD_ROOT%{_datadir}/pear \
- $RPM_BUILD_ROOT%{_libdir}/libphp5.la
+ $RPM_BUILD_ROOT%{_libdir}/libphp7.la
# Remove irrelevant docs
rm -f README.{Zeus,QNX,CVS-RULES}
@@ -1347,19 +1351,20 @@ rm -f README.{Zeus,QNX,CVS-RULES}
%postun embedded -p /sbin/ldconfig
%files
-%{_httpd_moddir}/libphp5.so
+%{_httpd_moddir}/libphp7.so
%if %{with_zts}
-%{_httpd_moddir}/libphp5-zts.so
+%{_httpd_moddir}/libphp7-zts.so
%endif
%attr(0770,root,apache) %dir %{_sharedstatedir}/php/session
%attr(0770,root,apache) %dir %{_sharedstatedir}/php/wsdlcache
+%attr(0770,root,apache) %dir %{_sharedstatedir}/php/opcache
%config(noreplace) %{_httpd_confdir}/php.conf
-%config(noreplace) %{_httpd_modconfdir}/10-php.conf
+%config(noreplace) %{_httpd_modconfdir}/15-php.conf
%{_httpd_contentdir}/icons/php.gif
%files common -f files.common
%doc CODING_STANDARDS CREDITS EXTENSIONS NEWS README*
-%license LICENSE Zend/ZEND_* TSRM_LICENSE regex_COPYRIGHT
+%license LICENSE Zend/ZEND_* TSRM_LICENSE
%license libmagic_LICENSE
%license phar_LICENSE
%doc php.ini-*
@@ -1395,15 +1400,20 @@ rm -f README.{Zeus,QNX,CVS-RULES}
%doc sapi/cgi/README* sapi/cli/README
%files dbg
-%{_bindir}/phpdbg
%doc sapi/phpdbg/{README.md,CREDITS}
+%{_bindir}/phpdbg
%{_mandir}/man1/phpdbg.1*
+%if %{with_zts}
+%{_bindir}/zts-phpdbg
+%{_mandir}/man1/zts-phpdbg.1*
+%endif
%files fpm
-%doc php-fpm.conf.default
+%doc php-fpm.conf.default www.conf.default
%license fpm_LICENSE
%attr(0770,root,apache) %dir %{_sharedstatedir}/php/session
%attr(0770,root,apache) %dir %{_sharedstatedir}/php/wsdlcache
+%attr(0770,root,apache) %dir %{_sharedstatedir}/php/opcache
%config(noreplace) %{_httpd_confdir}/php.conf
%config(noreplace) %{_sysconfdir}/php-fpm.conf
%config(noreplace) %{_sysconfdir}/php-fpm.d/www.conf
@@ -1438,8 +1448,8 @@ rm -f README.{Zeus,QNX,CVS-RULES}
%{_rpmconfigdir}/macros.d/macros.php
%files embedded
-%{_libdir}/libphp5.so
-%{_libdir}/libphp5-%{embed_version}.so
+%{_libdir}/libphp7.so
+%{_libdir}/libphp7-%{embed_version}.so
%files pgsql -f files.pgsql
%files odbc -f files.odbc
@@ -1465,7 +1475,7 @@ rm -f README.{Zeus,QNX,CVS-RULES}
%files pdo -f files.pdo
%files mcrypt -f files.mcrypt
%files tidy -f files.tidy
-%files mssql -f files.mssql
+%files pdo-dblib -f files.pdo_dblib
%files pspell -f files.pspell
%files intl -f files.intl
%files process -f files.process
@@ -1476,9 +1486,16 @@ rm -f README.{Zeus,QNX,CVS-RULES}
%files opcache -f files.opcache
%config(noreplace) %{_sysconfdir}/php.d/opcache-default.blacklist
%config(noreplace) %{_sysconfdir}/php-zts.d/opcache-default.blacklist
+%files json -f files.json
%changelog
+* Wed Jun 22 2016 Remi Collet <remi@fedoraproject.org> 7.0.8-1
+- Update to 7.0.8 - http://www.php.net/releases/7_0_8.php
+- https://fedoraproject.org/wiki/Changes/php70
+- drop ereg, mysql, mssql extensions
+- add json extension
+
* Wed Jun 22 2016 Remi Collet <remi@fedoraproject.org> 5.6.23-1
- Update to 5.6.23 - http://www.php.net/releases/5_6_23.php
diff --git a/php.ztsmodconf b/php.ztsmodconf
index 54a094e..8085cbd 100644
--- a/php.ztsmodconf
+++ b/php.ztsmodconf
@@ -1,4 +1,6 @@
-<IfModule !prefork.c>
- LoadModule php5_module modules/libphp5-zts.so
-</IfModule>
+<IfModule !mod_php5.c>
+ <IfModule !prefork.c>
+ LoadModule php7_module modules/libphp7-zts.so
+ </IfModule>
+</IfModule>
diff --git a/sources b/sources
index 29c1553..55684ec 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-1653f194fb5887f1cdbe6b751ee9cd3d php-5.6.23-strip.tar.xz
+c4438583c95d3ddf746929d7fcb61045 php-7.0.8.tar.xz
diff --git a/strip.sh b/strip.sh
deleted file mode 100755
index 5939bec..0000000
--- a/strip.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-if [ -z "$1" ]; then
- echo "usage $0 version"
- exit 1;
-fi
-if [ ! -f php-$1.tar.xz ]; then
- echo "missing php-$1.tar.xz archive"
- exit 2;
-fi
-old=$(mktemp)
-new=$(mktemp)
-
-echo "Untar..."
-tar xf php-$1.tar.xz
-rm -rf php-$1/ext/json
-echo "Tar..."
-tar cJf php-$1-strip.tar.xz php-$1
-
-echo "Diff..."
-tar tf php-$1.tar.xz | sort >$old
-tar tf php-$1-strip.tar.xz | sort >$new
-diff $old $new
-
-rm -f $old $new
reply other threads:[~2026-11-27 7:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179576446426.1.14639729215916886624.rpms-php-3920d6f792ff@fedoraproject.org \
--to=remi@fedoraproject.org \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox