This commit is contained in:
Denis Silakov 2018-09-20 15:47:28 +03:00
commit 0708035f91
45 changed files with 5964 additions and 0 deletions

2
.abf.yml Normal file
View file

@ -0,0 +1,2 @@
sources:
php-7.3.0RC1.tar.xz: 60d0942021f6d26d416da655d42f06e264a78077

17
create_data_file.php Normal file
View file

@ -0,0 +1,17 @@
/* This is a generated file, do not modify */
/* Usage: php create_data_file.php /path/to/magic.mgc > data_file.c */
<?php
$dta = file_get_contents( $argv[1] );
$dta_l = strlen($dta);
$j = 0;
echo "const unsigned char php_magic_database[$dta_l] = {\n";
for ($i = 0; $i < $dta_l; $i++) {
printf("0x%02X, ", ord($dta[$i]));
if ($j % 16 == 15) {
echo "\n";
}
$j++;
}
echo "};\n";
?>

11
maxlifetime Normal file
View file

@ -0,0 +1,11 @@
#!/bin/bash -e
max=1440
cur=$(sed -n -e 's/^[[:space:]]*session.gc_maxlifetime[[:space:]]*=[[:space:]]*\([0-9]\+\).*$/\1/p' /etc/php.d/*_session.ini 2>/dev/null || true);
[ -z "$cur" ] && cur=0
[ "$cur" -gt "$max" ] && max=$cur
echo $(($max/60))
exit 0

View file

@ -0,0 +1,11 @@
--- ext/enchant/config.m4 2004-03-08 21:12:12.000000000 +0100
+++ ext/enchant/config.m4.oden 2009-03-27 12:50:12.000000000 +0100
@@ -27,7 +27,7 @@
AC_MSG_ERROR(Cannot find enchant)
fi
- ENCHANT_LIBDIR=$ENCHANT_DIR/lib
+ ENCHANT_LIBDIR=$ENCHANT_DIR/$PHP_LIBNAME
AC_DEFINE(HAVE_ENCHANT,1,[ ])
PHP_SUBST(ENCHANT_SHARED_LIBADD)

View file

@ -0,0 +1,11 @@
--- ext/xmlrpc/config.m4 2009-06-11 22:04:26.000000000 +0200
+++ ext/xmlrpc/config.m4.oden 2009-06-11 22:17:31.000000000 +0200
@@ -116,7 +116,7 @@
fi
PHP_ADD_INCLUDE($XMLRPC_DIR)
- PHP_ADD_LIBRARY_WITH_PATH(xmlrpc,,XMLRPC_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(xmlrpc-epi,,XMLRPC_SHARED_LIBADD)
PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c, $ext_shared)
PHP_SUBST(XMLRPC_SHARED_LIBADD)
XMLRPC_MODULE_TYPE=external

11
php-5.3.8-bdb-5.2.diff Normal file
View file

@ -0,0 +1,11 @@
--- php-7.0.3/ext/dba/config.m4.bdb-5.2.droplet 2016-02-04 13:33:43.649310979 +0100
+++ php-7.0.3/ext/dba/config.m4 2016-02-04 13:34:20.573508825 +0100
@@ -366,7 +366,7 @@ if test "$PHP_DB4" != "no"; then
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-6.1 db-6.0 db-5.3 db-5.2 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)])
fi
PHP_DBA_STD_RESULT(db4,Berkeley DB4)

View file

@ -0,0 +1,83 @@
--- php-7.0.1/sapi/fpm/php-fpm.conf.in.fpmmdv.droplet 2015-12-16 11:41:54.000000000 +0100
+++ php-7.0.1/sapi/fpm/php-fpm.conf.in 2015-12-29 00:32:32.641437818 +0100
@@ -14,14 +14,14 @@
; Pid file
; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@
; Default Value: none
-;pid = run/php-fpm.pid
+pid = /run/php-fpm/php-fpm.pid
; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; into a local file.
; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@
; Default Value: log/php-fpm.log
-;error_log = log/php-fpm.log
+error_log = /var/log/php-fpm.log
; syslog_facility is used to specify what type of program is logging the
; message. This lets syslogd specify that messages from different facilities
--- php-7.0.1/sapi/fpm/www.conf.in.fpmmdv.droplet 2015-12-29 00:33:15.685147449 +0100
+++ php-7.0.1/sapi/fpm/www.conf.in 2015-12-29 00:34:56.491559636 +0100
@@ -33,7 +33,7 @@ group = @php_fpm_group@
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
-listen = 127.0.0.1:9000
+listen = /run/php-fpm/php-fpm.sock
; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
@@ -104,22 +104,22 @@ pm = dynamic
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
-pm.max_children = 5
+pm.max_children = 35
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
-pm.start_servers = 2
+pm.start_servers = 20
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
-pm.min_spare_servers = 1
+pm.min_spare_servers = 5
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
-pm.max_spare_servers = 3
+pm.max_spare_servers = 35
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
@@ -130,7 +130,7 @@ pm.max_spare_servers = 3
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
-;pm.max_requests = 500
+pm.max_requests = 10000
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
@@ -314,7 +314,7 @@ pm.max_spare_servers = 3
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
-;slowlog = log/$pool.log.slow
+slowlog = /var/log/$pool.log.slow
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
@@ -386,6 +386,7 @@ pm.max_spare_servers = 3
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
+env[PATH] = $PATH
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the

View file

@ -0,0 +1,21 @@
--- php-7.0.1/sapi/fpm/config.m4.shared-fpm.droplet 2015-12-29 00:22:54.122668064 +0100
+++ php-7.0.1/sapi/fpm/config.m4 2015-12-29 00:25:26.130145446 +0100
@@ -718,7 +718,7 @@ if test "$PHP_FPM" != "no"; then
BUILD_FPM="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_FASTCGI_OBJS:.lo=.o) \$(PHP_FPM_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)"
;;
*)
- BUILD_FPM="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_FASTCGI_OBJS) \$(PHP_FPM_OBJS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)"
+ BUILD_FPM="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) libphp\$(PHP_MAJOR_VERSION)_common.la \$(PHP_BINARY_OBJS) \$(PHP_FASTCGI_OBJS) \$(PHP_FPM_OBJS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)"
;;
esac
--- php-7.0.1/sapi/fpm/Makefile.frag.shared-fpm.droplet 2015-12-29 00:22:54.122668064 +0100
+++ php-7.0.1/sapi/fpm/Makefile.frag 2015-12-29 00:26:16.331407285 +0100
@@ -1,6 +1,6 @@
fpm: $(SAPI_FPM_PATH)
-$(SAPI_FPM_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_FASTCGI_OBJS) $(PHP_FPM_OBJS)
+$(SAPI_FPM_PATH): libphp$(PHP_MAJOR_VERSION)_common.la $(PHP_BINARY_OBJS) $(PHP_FASTCGI_OBJS) $(PHP_FPM_OBJS)
$(BUILD_FPM)
install-fpm: $(SAPI_FPM_PATH)

12
php-5.5.6-db-6.0.patch Normal file
View file

@ -0,0 +1,12 @@
diff -up php-7.3.0RC1/ext/dba/config.m4.db60~ php-7.3.0RC1/ext/dba/config.m4
--- php-7.3.0RC1/ext/dba/config.m4.db60~ 2018-09-13 22:48:02.122654318 +0200
+++ php-7.3.0RC1/ext/dba/config.m4 2018-09-13 22:48:47.222861935 +0200
@@ -277,7 +277,7 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
]])],[
AC_EGREP_CPP(yes,[
#include "$THIS_INCLUDE"
-#if DB_VERSION_MAJOR == $1 || ($1 == 4 && DB_VERSION_MAJOR == 5)
+#if DB_VERSION_MAJOR == $1 || ($1 == 4 && DB_VERSION_MAJOR >= 5)
yes
#endif
],[

View file

@ -0,0 +1,11 @@
--- php-7.0.1/Zend/zend_portability.h.omv~ 2015-12-29 03:38:23.186894098 +0100
+++ php-7.0.1/Zend/zend_portability.h 2015-12-29 03:38:48.437952703 +0100
@@ -183,7 +183,7 @@ char *alloca();
# define ZEND_ATTRIBUTE_MALLOC
#endif
-#if ZEND_GCC_VERSION >= 4003 || __has_attribute(alloc_size)
+#if (ZEND_GCC_VERSION >= 4003 && !defined(__clang__)) || __has_attribute(alloc_size)
# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) __attribute__ ((alloc_size(X)))
# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) __attribute__ ((alloc_size(X,Y)))
#else

View file

@ -0,0 +1,97 @@
--- php-7.2.0/ext/date/php_date.c.omv~ 2017-11-29 13:24:17.183364915 +0100
+++ php-7.2.0/ext/date/php_date.c 2017-11-29 13:24:28.970391388 +0100
@@ -664,7 +664,7 @@ static zval *date_period_read_property(z
static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot);
/* {{{ Module struct */
-zend_module_entry date_module_entry = {
+__attribute__((visibility("default"))) zend_module_entry date_module_entry = {
STANDARD_MODULE_HEADER_EX,
NULL,
NULL,
--- php-7.2.0/ext/libxml/libxml.c.omv~ 2017-11-29 13:29:29.380067310 +0100
+++ php-7.2.0/ext/libxml/libxml.c 2017-11-29 13:29:45.521103681 +0100
@@ -135,7 +135,7 @@ static const zend_function_entry libxml_
PHP_FE_END
};
-zend_module_entry libxml_module_entry = {
+__attribute__((visibility("default"))) zend_module_entry libxml_module_entry = {
STANDARD_MODULE_HEADER,
"libxml", /* extension name */
libxml_functions, /* extension function list */
--- php-7.2.0/ext/pcre/php_pcre.c.omv~ 2017-11-29 13:29:59.452135074 +0100
+++ php-7.2.0/ext/pcre/php_pcre.c 2017-11-29 13:30:04.050145437 +0100
@@ -2715,7 +2715,7 @@ static const zend_function_entry pcre_fu
PHP_FE_END
};
-zend_module_entry pcre_module_entry = {
+__attribute__((visibility("default"))) zend_module_entry pcre_module_entry = {
STANDARD_MODULE_HEADER,
"pcre",
pcre_functions,
--- php-7.2.0/ext/reflection/php_reflection.c.omv~ 2017-11-29 13:30:13.372166447 +0100
+++ php-7.2.0/ext/reflection/php_reflection.c 2017-11-29 13:30:34.731214591 +0100
@@ -6830,7 +6830,7 @@ PHP_MINFO_FUNCTION(reflection) /* {{{ */
php_info_print_table_end();
} /* }}} */
-zend_module_entry reflection_module_entry = { /* {{{ */
+__attribute__((visibility("default"))) zend_module_entry reflection_module_entry = { /* {{{ */
STANDARD_MODULE_HEADER,
"Reflection",
reflection_ext_functions,
--- php-7.2.0/ext/simplexml/simplexml.c.omv~ 2017-11-29 13:31:10.373294945 +0100
+++ php-7.2.0/ext/simplexml/simplexml.c 2017-11-29 13:31:14.562304390 +0100
@@ -2676,7 +2676,7 @@ static const zend_module_dep simplexml_d
};
/* }}} */
-zend_module_entry simplexml_module_entry = { /* {{{ */
+__attribute__((visibility("default"))) zend_module_entry simplexml_module_entry = { /* {{{ */
STANDARD_MODULE_HEADER_EX, NULL,
simplexml_deps,
"SimpleXML",
--- php-7.2.0/ext/spl/php_spl.c.omv~ 2017-11-29 13:30:51.564252538 +0100
+++ php-7.2.0/ext/spl/php_spl.c 2017-11-29 13:31:00.361272372 +0100
@@ -1015,7 +1015,7 @@ PHP_RSHUTDOWN_FUNCTION(spl) /* {{{ */
/* {{{ spl_module_entry
*/
-zend_module_entry spl_module_entry = {
+__attribute__((visibility("default"))) zend_module_entry spl_module_entry = {
STANDARD_MODULE_HEADER,
"SPL",
spl_functions,
--- php-7.2.0/ext/standard/basic_functions.c.omv~ 2017-11-29 13:31:35.333351228 +0100
+++ php-7.2.0/ext/standard/basic_functions.c 2017-11-29 13:31:39.891361507 +0100
@@ -3422,7 +3422,7 @@ static const zend_module_dep standard_de
};
/* }}} */
-zend_module_entry basic_functions_module = { /* {{{ */
+__attribute__((visibility("default"))) zend_module_entry basic_functions_module = { /* {{{ */
STANDARD_MODULE_HEADER_EX,
NULL,
standard_deps,
--- php-7.2.0/Zend/zend_signal.c.omv~ 2017-11-29 13:31:58.788404124 +0100
+++ php-7.2.0/Zend/zend_signal.c 2017-11-29 13:32:19.265450309 +0100
@@ -377,7 +377,7 @@ static void zend_signal_globals_ctor(zen
}
/* }}} */
-void zend_signal_init(void) /* {{{ */
+__attribute__((visibility("default"))) void zend_signal_init(void) /* {{{ */
{
int signo;
struct sigaction sa;
@@ -399,7 +399,7 @@ void zend_signal_init(void) /* {{{ */
/* {{{ zend_signal_startup
* alloc zend signal globals */
-void zend_signal_startup(void)
+__attribute__((visibility("default"))) void zend_signal_startup(void)
{
#ifdef ZTS

View file

@ -0,0 +1,27 @@
diff -up php-7.2.5/ext/gd/config.m4.omv~ php-7.2.5/ext/gd/config.m4
--- php-7.2.5/ext/gd/config.m4.omv~ 2018-05-09 00:44:24.799260377 +0200
+++ php-7.2.5/ext/gd/config.m4 2018-05-09 00:45:22.108945925 +0200
@@ -185,21 +185,8 @@ AC_DEFUN([PHP_GD_XPM],[
AC_DEFUN([PHP_GD_FREETYPE2],[
if test "$PHP_FREETYPE_DIR" != "no"; then
-
- for i in $PHP_FREETYPE_DIR /usr/local /usr; do
- if test -f "$i/bin/freetype-config"; then
- FREETYPE2_DIR=$i
- FREETYPE2_CONFIG="$i/bin/freetype-config"
- break
- fi
- done
-
- if test -z "$FREETYPE2_DIR"; then
- AC_MSG_ERROR([freetype-config not found.])
- fi
-
- FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
- FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
+ FREETYPE2_CFLAGS=`pkg-config --cflags freetype2`
+ FREETYPE2_LIBS=`pkg-config --libs freetype2`
PHP_EVAL_INCLINE($FREETYPE2_CFLAGS)
PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD)

View file

@ -0,0 +1,15 @@
diff -up php-7.3.0RC1/sapi/apache2handler/php_functions.c.omv~ php-7.3.0RC1/sapi/apache2handler/php_functions.c
--- php-7.3.0RC1/sapi/apache2handler/php_functions.c.omv~ 2018-09-13 23:54:45.499115056 +0200
+++ php-7.3.0RC1/sapi/apache2handler/php_functions.c 2018-09-13 23:55:15.453241974 +0200
@@ -225,10 +225,7 @@ PHP_FUNCTION(apache_get_output_filters)
WRONG_PARAM_COUNT;
}
- if(array_init(return_value) != SUCCESS)
- {
- RETURN_NULL();
- }
+ array_init(return_value);
ctx = SG(server_context);

17
php-bug43221.diff Normal file
View file

@ -0,0 +1,17 @@
diff -u -3 -p -r1.151.2.22.2.35 -r1.151.2.22.2.36
--- ext/simplexml/simplexml.c 31 Jul 2007 15:40:49 -0000 1.151.2.22.2.35
+++ ext/simplexml/simplexml.c 12 Nov 2007 18:59:26 -0000 1.151.2.22.2.36
@@ -1635,6 +1635,13 @@ SXE_METHOD(addAttribute)
localname = xmlSplitQName2((xmlChar *)qname, &prefix);
if (localname == NULL) {
+ if (nsuri_len > 0) {
+ if (prefix != NULL) {
+ xmlFree(prefix);
+ }
+ php_error_docref(NULL, E_WARNING, "Attribute requires prefix for namespace");
+ return;
+ }
localname = xmlStrdup((xmlChar *)qname);
}

11
php-bug43589.diff Normal file
View file

@ -0,0 +1,11 @@
--- ext/bz2/bz2_filter.c 9 Aug 2007 23:27:22 -0000 1.3.2.2.2.5
+++ ext/bz2/bz2_filter.c 16 Dec 2007 17:22:31 -0000 1.3.2.2.2.6
@@ -132,6 +132,8 @@ static php_stream_filter_status_t php_bz
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
+ } else if (status == BZ_OK) {
+ break;
}
}
}

18
php-cxx.diff Normal file
View file

@ -0,0 +1,18 @@
--- php-5.4.1RC2/aclocal.m4.cxx.droplet 2012-04-17 21:11:51.000000000 +0200
+++ php-5.4.1RC2/aclocal.m4 2012-04-17 21:12:43.372215983 +0200
@@ -758,14 +758,7 @@ AC_DEFUN([PHP_BUILD_THREAD_SAFE],[
dnl
dnl PHP_REQUIRE_CXX
dnl
-AC_DEFUN([PHP_REQUIRE_CXX],[
- if test -z "$php_cxx_done"; then
- AC_PROG_CXX
- AC_PROG_CXXCPP
- PHP_ADD_LIBRARY(stdc++)
- php_cxx_done=yes
- fi
-])
+AC_DEFUN([PHP_REQUIRE_CXX])
dnl
dnl PHP_BUILD_SHARED

12
php-dba-link.patch Normal file
View file

@ -0,0 +1,12 @@
diff -up php-7.3.0RC1/ext/dba/config.m4.dba-link.droplet php-7.3.0RC1/ext/dba/config.m4
--- php-7.3.0RC1/ext/dba/config.m4.dba-link.droplet 2018-09-13 22:49:02.287930835 +0200
+++ php-7.3.0RC1/ext/dba/config.m4 2018-09-13 23:19:59.940775252 +0200
@@ -282,6 +282,8 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
#endif
],[
THIS_LIBS=$LIB
+ LDFLAGS=$old_LDFLAGS
+ LIBS=$old_LIBS
lib_found=1
])
],[])

17
php-dlopen.diff Normal file
View file

@ -0,0 +1,17 @@
--- php-7.1.3/Zend/zend_portability.h.dlopen.droplet 2017-03-15 01:29:44.168736658 +0100
+++ php-7.1.3/Zend/zend_portability.h 2017-03-15 01:30:29.179707854 +0100
@@ -146,11 +146,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) && !defined(__SANITIZE_ADDRESS__)
-# 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)

View file

@ -0,0 +1,11 @@
--- php-7.2.0/ext/exif/exif.c.exif_nesting_level.droplet 2017-11-29 12:55:33.396697427 +0100
+++ php-7.2.0/ext/exif/exif.c 2017-11-29 12:55:51.777730539 +0100
@@ -89,7 +89,7 @@ typedef unsigned char uchar;
#define EFREE_IF(ptr) if (ptr) efree(ptr)
-#define MAX_IFD_NESTING_LEVEL 150
+#define MAX_IFD_NESTING_LEVEL 250
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO(arginfo_exif_tagname, 0)

14
php-filter-shared.diff Normal file
View file

@ -0,0 +1,14 @@
--- ext/filter/config.m4 2006-12-06 00:51:30.000000000 +0100
+++ ext/filter/config.m4.oden 2007-06-20 12:26:17.000000000 +0200
@@ -10,10 +10,7 @@
if test "$PHP_FILTER" != "no"; then
dnl Check if configure is the PHP core configure
- if test -n "$PHP_VERSION"; then
- dnl This extension can not be build as shared when in PHP core
- ext_shared=no
- else
+ if test -z "$PHP_VERSION"; then
dnl This is PECL build, check if bundled PCRE library is used
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=$INCLUDES

1
php-fpm-tmpfiles.conf Normal file
View file

@ -0,0 +1 @@
d /run/php-fpm 0711 apache apache

11
php-fpm.logrotate Normal file
View file

@ -0,0 +1,11 @@
/var/log/php-fpm/php-fpm.log /var/log/php-fpm/php-fpm-slow.log {
rotate 5
monthly
missingok
create 640 apache apache
notifempty
nocompress
postrotate
/bin/kill -SIGUSR1 `cat /run/php-fpm/php-fpm.pid 2>/dev/null` > /dev/null 2>&1 || :
endscript
}

13
php-fpm.service Normal file
View file

@ -0,0 +1,13 @@
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target
[Service]
Type=forking
PIDFile=/run/php-fpm/php-fpm.pid
EnvironmentFile=/etc/sysconfig/php-fpm
ExecStart=/usr/sbin/php-fpm --daemonize --fpm-config /etc/php-fpm.conf $PHP_FPM_OPTIONS
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target

3
php-fpm.sysconf Normal file
View file

@ -0,0 +1,3 @@
# pass additional options here
PHP_FPM_OPTIONS=""

View file

@ -0,0 +1,302 @@
diff -Naurp php-5.3.4RC1/ext/imap/php_imap.c php-5.3.4RC1.oden/ext/imap/php_imap.c
--- php-5.3.4RC1/ext/imap/php_imap.c 2010-11-18 16:22:22.000000000 +0100
+++ php-5.3.4RC1.oden/ext/imap/php_imap.c 2010-11-22 10:01:42.538863104 +0100
@@ -164,6 +164,22 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_geta
ZEND_ARG_INFO(0, mailbox)
ZEND_END_ARG_INFO()
#endif
+#if defined(HAVE_IMAP2005)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setannotation, 0, 0, 5)
+ ZEND_ARG_INFO(0, stream_id)
+ ZEND_ARG_INFO(0, mailbox)
+ ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, attr)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getannotation, 0, 0, 4)
+ ZEND_ARG_INFO(0, stream_id)
+ ZEND_ARG_INFO(0, mailbox)
+ ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, attr)
+ZEND_END_ARG_INFO()
+#endif
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_expunge, 0, 0, 1)
ZEND_ARG_INFO(0, stream_id)
@@ -408,6 +424,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_stat
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_status_current, 0, 0, 2)
+ ZEND_ARG_INFO(0, stream_id)
+ ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_bodystruct, 0, 0, 3)
ZEND_ARG_INFO(0, stream_id)
ZEND_ARG_INFO(0, msg_no)
@@ -507,6 +528,7 @@ const zend_function_entry imap_functions
PHP_FE(imap_binary, arginfo_imap_binary)
PHP_FE(imap_utf8, arginfo_imap_utf8)
PHP_FE(imap_status, arginfo_imap_status)
+ PHP_FE(imap_status_current, arginfo_imap_status_current)
PHP_FE(imap_mailboxmsginfo, arginfo_imap_mailboxmsginfo)
PHP_FE(imap_setflag_full, arginfo_imap_setflag_full)
PHP_FE(imap_clearflag_full, arginfo_imap_clearflag_full)
@@ -537,6 +559,10 @@ const zend_function_entry imap_functions
PHP_FE(imap_setacl, arginfo_imap_setacl)
PHP_FE(imap_getacl, arginfo_imap_getacl)
#endif
+#if defined(HAVE_IMAP2005)
+ PHP_FE(imap_setannotation, arginfo_imap_setannotation)
+ PHP_FE(imap_getannotation, arginfo_imap_getannotation)
+#endif
PHP_FE(imap_mail, arginfo_imap_mail)
@@ -798,6 +824,30 @@ void mail_getacl(MAILSTREAM *stream, cha
/* }}} */
#endif
+#if defined(HAVE_IMAP2005)
+/* {{{ mail_getannotation
+ *
+ * Mail GET_ANNOTATION callback
+ * Called via the mail_parameter function in c-client:src/c-client/mail.c
+ */
+void mail_getannotation(MAILSTREAM *stream, ANNOTATION *alist)
+{
+ ANNOTATION_VALUES *cur;
+
+ TSRMLS_FETCH();
+
+ /* walk through the ANNOTATION_VALUES */
+
+ for(cur = alist->values; cur; cur = cur->next) {
+ if (cur->value)
+ add_assoc_stringl(IMAPG(imap_annotation_list), cur->attr, cur->value, strlen(cur->value), 1);
+ else
+ add_assoc_stringl(IMAPG(imap_annotation_list), cur->attr, "", 0, 1);
+ }
+}
+/* }}} */
+#endif
+
/* {{{ PHP_GINIT_FUNCTION
*/
static PHP_GINIT_FUNCTION(imap)
@@ -823,6 +873,7 @@ static PHP_GINIT_FUNCTION(imap)
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
imap_globals->quota_return = NIL;
imap_globals->imap_acl_list = NIL;
+ imap_globals->imap_annotation_list = NIL;
#endif
imap_globals->gets_stream = NIL;
}
@@ -1547,7 +1598,119 @@ PHP_FUNCTION(imap_getacl)
}
/* }}} */
#endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */
+
+#if defined(HAVE_IMAP2005)
+
+/* {{{ proto bool imap_setannotation(resource stream_id, string mailbox, string entry, string attr, string value)
+ Sets an annotation for a given mailbox */
+PHP_FUNCTION(imap_setannotation)
+{
+ zval **streamind, **mailbox, **entry, **attr, **value;
+ pils *imap_le_struct;
+ long ret;
+
+ // TODO: Use zend_parse_parameters here
+ if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &streamind, &mailbox, &entry, &attr, &value) == FAILURE) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
+
+ convert_to_string_ex(mailbox);
+ convert_to_string_ex(entry);
+ convert_to_string_ex(attr);
+ convert_to_string_ex(value);
+
+ // create annotation object
+ ANNOTATION *annotation = mail_newannotation();
+ if (!annotation)
+ RETURN_FALSE;
+ annotation->values = mail_newannotationvalue();
+ if (!annotation->values) {
+ mail_free_annotation(&annotation);
+ RETURN_FALSE;
+ }
+
+ // fill in annotation values
+ annotation->mbox = Z_STRVAL_P(*mailbox);
+ annotation->entry = Z_STRVAL_P(*entry);
+ annotation->values->attr = Z_STRVAL_P(*attr);
+ annotation->values->value = Z_STRVAL_P(*value);
+
+ ret = imap_setannotation(imap_le_struct->imap_stream, annotation);
+
+ // make sure mail_free_annotation doesn't free our variables
+ annotation->mbox = NULL;
+ annotation->entry = NULL;
+ annotation->values->attr = NULL;
+ annotation->values->value = NULL;
+ mail_free_annotation(&annotation);
+
+ RETURN_BOOL(ret);
+}
+/* }}} */
+
+/* {{{ proto array imap_getannotation(resource stream_id, string mailbox, string entry, string attr)
+ Gets the ACL for a given mailbox */
+PHP_FUNCTION(imap_getannotation)
+{
+ zval **streamind, **mailbox, **entry, **attr;
+ pils *imap_le_struct;
+ long ret;
+
+ if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &streamind, &mailbox, &entry, &attr) == FAILURE) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
+
+ convert_to_string_ex(mailbox);
+ convert_to_string_ex(entry);
+ convert_to_string_ex(attr);
+
+ /* initializing the special array for the return values */
+ if (array_init(return_value) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ // fillup calling parameters
+ STRINGLIST *entries = mail_newstringlist();
+ if (!entries)
+ RETURN_FALSE;
+
+ STRINGLIST *cur = entries;
+ cur->text.data = (unsigned char *)cpystr(Z_STRVAL_P(*entry));
+ cur->text.size = Z_STRLEN_P(*entry);
+ cur->next = NIL;
+
+ STRINGLIST *attributes = mail_newstringlist();
+ if (!attributes)
+ RETURN_FALSE;
+ cur = attributes;
+ cur->text.data = (unsigned char *)cpystr (Z_STRVAL_P(*attr));
+ cur->text.size = Z_STRLEN_P(*attr);
+ cur->next = NIL;
+
+ IMAPG(imap_annotation_list) = return_value;
+
+ /* set the callback for the GET_ANNOTATION function */
+ mail_parameters(NIL, SET_ANNOTATION, (void *) mail_getannotation);
+ ret = imap_getannotation(imap_le_struct->imap_stream, Z_STRVAL_P(+mailbox), entries, attributes);
+
+ mail_free_stringlist(&entries);
+ mail_free_stringlist(&attributes);
+
+ if (!ret) {
+ zval_dtor(return_value);
+ RETURN_FALSE;
+ }
+
+ IMAPG(imap_annotation_list) = NIL;
+}
+/* }}} */
+
+#endif /* HAVE_IMAP2005 */
+
/* {{{ proto bool imap_expunge(resource stream_id)
Permanently delete all messages marked for deletion */
PHP_FUNCTION(imap_expunge)
@@ -3190,6 +3353,42 @@ PHP_FUNCTION(imap_msgno)
}
/* }}} */
+/* {{{ proto object imap_status_current(resource stream_id, int options)
+ Get (cached) status info from current mailbox */
+PHP_FUNCTION(imap_status_current)
+{
+ zval **streamind, **pflags;
+ pils *imap_le_struct;
+ long flags = 0L;
+
+ if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &pflags) == FAILURE) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
+
+ convert_to_long_ex(pflags);
+ flags = Z_LVAL_PP(pflags);
+
+ if (object_init(return_value) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if (flags & SA_MESSAGES) {
+ add_property_long(return_value, "messages", imap_le_struct->imap_stream->nmsgs);
+ }
+ if (flags & SA_RECENT) {
+ add_property_long(return_value, "recent", imap_le_struct->imap_stream->recent);
+ }
+ if (flags & SA_UIDNEXT) {
+ add_property_long(return_value, "uidnext", imap_le_struct->imap_stream->uid_last+1);
+ }
+ if (flags & SA_UIDVALIDITY) {
+ add_property_long(return_value, "uidvalidity", imap_le_struct->imap_stream->uid_validity);
+ }
+}
+/* }}} */
+
/* {{{ proto object imap_status(resource stream_id, string mailbox, int options)
Get status info from a mailbox */
PHP_FUNCTION(imap_status)
diff -Naurp php-5.3.4RC1/ext/imap/php_imap.h php-5.3.4RC1.oden/ext/imap/php_imap.h
--- php-5.3.4RC1/ext/imap/php_imap.h 2010-01-03 10:23:27.000000000 +0100
+++ php-5.3.4RC1.oden/ext/imap/php_imap.h 2010-11-22 10:01:42.542862889 +0100
@@ -153,6 +153,7 @@ PHP_FUNCTION(imap_lsub);
PHP_FUNCTION(imap_lsub_full);
PHP_FUNCTION(imap_create);
PHP_FUNCTION(imap_rename);
+PHP_FUNCTION(imap_status_current);
PHP_FUNCTION(imap_status);
PHP_FUNCTION(imap_bodystruct);
PHP_FUNCTION(imap_fetch_overview);
@@ -173,6 +174,9 @@ PHP_FUNCTION(imap_mime_header_decode);
PHP_FUNCTION(imap_thread);
PHP_FUNCTION(imap_timeout);
+// TODO: Needs fixing in configure in
+#define HAVE_IMAP2005 1
+
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
PHP_FUNCTION(imap_get_quota);
PHP_FUNCTION(imap_get_quotaroot);
@@ -180,7 +184,10 @@ PHP_FUNCTION(imap_set_quota);
PHP_FUNCTION(imap_setacl);
PHP_FUNCTION(imap_getacl);
#endif
-
+#if defined(HAVE_IMAP2005)
+PHP_FUNCTION(imap_setannotation);
+PHP_FUNCTION(imap_getannotation);
+#endif
ZEND_BEGIN_MODULE_GLOBALS(imap)
char *imap_user;
@@ -211,6 +218,9 @@ ZEND_BEGIN_MODULE_GLOBALS(imap)
zval **quota_return;
zval *imap_acl_list;
#endif
+#if defined(HAVE_IMAP2005)
+ zval *imap_annotation_list;
+#endif
/* php_stream for php_mail_gets() */
php_stream *gets_stream;
ZEND_END_MODULE_GLOBALS(imap)

92
php-imap-myrights.diff Normal file
View file

@ -0,0 +1,92 @@
diff -Naurp php-5.3.4RC1/ext/imap/php_imap.c php-5.3.4RC1.oden/ext/imap/php_imap.c
--- php-5.3.4RC1/ext/imap/php_imap.c 2010-11-22 10:39:59.349863220 +0100
+++ php-5.3.4RC1.oden/ext/imap/php_imap.c 2010-11-22 10:40:14.709956619 +0100
@@ -163,6 +163,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_geta
ZEND_ARG_INFO(0, stream_id)
ZEND_ARG_INFO(0, mailbox)
ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_myrights, 0, 0, 2)
+ ZEND_ARG_INFO(0, stream_id)
+ ZEND_ARG_INFO(0, mailbox)
+ZEND_END_ARG_INFO()
#endif
#if defined(HAVE_IMAP2005)
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setannotation, 0, 0, 5)
@@ -558,6 +563,7 @@ const zend_function_entry imap_functions
PHP_FE(imap_set_quota, arginfo_imap_set_quota)
PHP_FE(imap_setacl, arginfo_imap_setacl)
PHP_FE(imap_getacl, arginfo_imap_getacl)
+ PHP_FE(imap_myrights, arginfo_imap_myrights)
#endif
#if defined(HAVE_IMAP2005)
PHP_FE(imap_setannotation, arginfo_imap_setannotation)
@@ -822,6 +828,20 @@ void mail_getacl(MAILSTREAM *stream, cha
}
}
/* }}} */
+
+/* {{{ mail_myrights
+ *
+ * Mail MYRIGHTS callback
+ * Called via the mail_parameter function in c-client:src/c-client/mail.c
+ */
+void mail_myrights(MAILSTREAM *stream, char *mailbox, char *rights)
+{
+ TSRMLS_FETCH();
+
+ ZVAL_STRING(IMAPG(imap_acl_list), rights, 1);
+
+}
+/* }}} */
#endif
#if defined(HAVE_IMAP2005)
@@ -1597,6 +1617,36 @@ PHP_FUNCTION(imap_getacl)
IMAPG(imap_acl_list) = NIL;
}
/* }}} */
+
+/* {{{ proto string imap_myrights(resource stream_id, string mailbox)
+ Gets my rights (ACL) for a given mailbox */
+PHP_FUNCTION(imap_myrights)
+{
+ zval **streamind, **mailbox;
+ pils *imap_le_struct;
+
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &mailbox) == FAILURE) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
+
+ convert_to_string_ex(mailbox);
+
+ IMAPG(imap_acl_list) = return_value;
+
+ /* set the callback for the GET_ACL function */
+ mail_parameters(NIL, SET_MYRIGHTS, (void *) mail_myrights);
+ if(!imap_myrights(imap_le_struct->imap_stream, Z_STRVAL_P(*mailbox))) {
+ php_error(E_WARNING, "c-client imap_myrights failed");
+ zval_dtor(return_value);
+ RETURN_FALSE;
+ }
+
+ IMAPG(imap_acl_list) = NIL;
+}
+/* }}} */
+
#endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */
#if defined(HAVE_IMAP2005)
diff -Naurp php-5.3.4RC1/ext/imap/php_imap.h php-5.3.4RC1.oden/ext/imap/php_imap.h
--- php-5.3.4RC1/ext/imap/php_imap.h 2010-11-22 10:39:59.349863220 +0100
+++ php-5.3.4RC1.oden/ext/imap/php_imap.h 2010-11-22 10:40:14.709956619 +0100
@@ -183,6 +183,7 @@ PHP_FUNCTION(imap_get_quotaroot);
PHP_FUNCTION(imap_set_quota);
PHP_FUNCTION(imap_setacl);
PHP_FUNCTION(imap_getacl);
+PHP_FUNCTION(imap_myrights);
#endif
#if defined(HAVE_IMAP2005)
PHP_FUNCTION(imap_setannotation);

11
php-install.diff Normal file
View file

@ -0,0 +1,11 @@
--- php-7.0.1/sapi/apache2handler/config.m4.install.droplet 2015-12-29 00:35:28.723395998 +0100
+++ php-7.0.1/sapi/apache2handler/config.m4 2015-12-29 00:36:14.211182883 +0100
@@ -67,7 +67,7 @@ if test "$PHP_APXS2" != "no"; then
fi
APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
- if test -z `$APXS -q SYSCONFDIR`; then
+ if true; then
INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-i -n php7"

25
php-libc-client.diff Normal file
View file

@ -0,0 +1,25 @@
--- php-5.5.5/ext/imap/config.m4.libc-client-php.droplet 2013-10-19 15:41:59.216630129 +0200
+++ php-5.5.5/ext/imap/config.m4 2013-10-19 15:43:08.238767234 +0200
@@ -198,20 +198,14 @@ if test "$PHP_IMAP" != "no"; then
AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.)
fi
- if test ! -r "$IMAP_DIR/c-client/libc-client.a" && test -r "$IMAP_DIR/c-client/c-client.a" ; then
- ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1
- elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then
- ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1
- fi
-
- for lib in c-client4 c-client imap; do
+ for lib in c-client; do
IMAP_LIB=$lib
IMAP_LIB_CHK($PHP_LIBDIR)
IMAP_LIB_CHK(c-client)
done
if test -z "$IMAP_LIBDIR"; then
- AC_MSG_ERROR(Cannot find imap library (libc-client.a). Please check your c-client installation.)
+ AC_MSG_ERROR(Cannot find imap library (libc-client.so). Please check your c-client installation.)
fi
PHP_ADD_INCLUDE($IMAP_INC_DIR)

37
php-libtool.diff Normal file
View file

@ -0,0 +1,37 @@
--- aclocal.m4 2009-12-22 23:07:46.000000000 +0100
+++ aclocal.m4.oden 2010-01-02 15:56:37.000000000 +0100
@@ -3540,6 +3540,20 @@
rm -rf conftest*
;;
+*-*-linux*)
+ # Test if the compiler is 64bit
+ echo 'int i;' > conftest.$ac_ext
+ lt_cv_cc_64bit_output=no
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *"ELF 64"*)
+ lt_cv_cc_64bit_output=yes
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
@@ -4587,6 +4601,13 @@
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
+ case $host_cpu:$lt_cv_cc_64bit_output in
+ powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
+ sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
+ ;;
+ esac
+
# We used to test for /lib/ld.so.1 and disable shared libraries on
# powerpc, because MkLinux only supported shared libraries with the
# GNU dynamic linker. Since this was broken with cross compilers,

85
php-mail.diff Normal file
View file

@ -0,0 +1,85 @@
--- php-7.0.1/ext/standard/mail.c.mail.droplet 2015-12-16 11:42:00.000000000 +0100
+++ php-7.0.1/ext/standard/mail.c 2015-12-29 00:19:04.678943466 +0100
@@ -22,6 +22,8 @@
#include <ctype.h>
#include <stdio.h>
#include <time.h>
+#include <string.h>
+#include <syslog.h>
#include "php.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
@@ -47,6 +49,9 @@
#include "php_string.h"
#include "exec.h"
+#include "zend_operators.h"
+#include "zend_globals.h"
+
#ifdef PHP_WIN32
#include "win32/sendmail.h"
#endif
@@ -125,6 +130,18 @@ PHP_FUNCTION(mail)
MAIL_ASCIIZ_CHECK(ZSTR_VAL(extra_cmd), ZSTR_LEN(extra_cmd));
}
+ /* search for To: and Subject: headers which should be specified in proper mail() parameters, not in additional headers */
+ if (headers != NULL) {
+ if (strncasecmp(headers, "to:", sizeof("to:") - 1) == 0 || strcasestr(headers, "\nto:")) {
+ php_error_docref(NULL, E_WARNING, "To: headers aren't allowed in the additional_headers parameter. Use $to parameter for that. Mail not sent.");
+ RETURN_FALSE;
+ }
+ if (strncasecmp(headers, "subject:", sizeof("subject:") - 1) == 0 || strcasestr(headers, "\nsubject:")) {
+ php_error_docref(NULL, E_WARNING, "Subject: headers aren't allowed in the additional_headers parameter. Use $subject parameter for that. Mail not sent.");
+ RETURN_FALSE;
+ }
+ }
+
if (to_len > 0) {
to_r = estrndup(to, to_len);
for (; to_len; to_len--) {
@@ -396,8 +413,42 @@ PHPAPI int php_mail(char *to, char *subj
MAIL_RET(0);
}
#endif
- fprintf(sendmail, "To: %s\n", to);
- fprintf(sendmail, "Subject: %s\n", subject);
+ TSRMLS_FETCH();
+
+ if ((to != NULL) && (strlen(to)!=0)) {
+ fprintf(sendmail, "To: %s\n", to);
+ }
+ if ((subject != NULL) && (strlen(subject)!=0)) {
+ fprintf(sendmail, "Subject: %s\n", subject);
+ }
+
+ if (PG(http_globals)[TRACK_VARS_SERVER]) {
+ zval **remote_addr, **server_name, **server_port,
+ **script_name, **http_user_agent;
+
+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "REMOTE_ADDR", sizeof("REMOTE_ADDR"), (void **) &remote_addr)==SUCCESS) {
+ convert_to_string_ex(remote_addr);
+ fprintf(sendmail, "HTTP-Posting-Client: %s\n", Z_STRVAL_P(*remote_addr));
+ }
+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_NAME", sizeof("SERVER_NAME"), (void **) &server_name)==SUCCESS) {
+ convert_to_string_ex(server_name);
+ fprintf(sendmail, "HTTP-Posting-URI: %s", Z_STRVAL_P(*server_name));
+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SERVER_PORT", sizeof("SERVER_PORT"), (void **) &server_port)==SUCCESS) {
+ convert_to_string_ex(server_port);
+ fprintf(sendmail, ":%s", Z_STRVAL_P(*server_port));
+ }
+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &script_name)==SUCCESS) {
+ convert_to_string_ex(script_name);
+ fprintf(sendmail, "%s", Z_STRVAL_P(*script_name));
+ }
+ fprintf(sendmail, "\n");
+ }
+ if (zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &http_user_agent)==SUCCESS) {
+ convert_to_string_ex(http_user_agent);
+ fprintf(sendmail, "HTTP-Posting-User-Agent: %s\n", Z_STRVAL_P(*http_user_agent));
+ }
+ }
+
if (hdr != NULL) {
fprintf(sendmail, "%s\n", hdr);
}

61
php-mariadb-10.3.patch Normal file
View file

@ -0,0 +1,61 @@
diff -up php-7.2.4/ext/mysqli/mysqli_api.c.omv~ php-7.2.4/ext/mysqli/mysqli_api.c
--- php-7.2.4/ext/mysqli/mysqli_api.c.omv~ 2018-04-06 21:50:05.183703414 +0200
+++ php-7.2.4/ext/mysqli/mysqli_api.c 2018-04-06 21:50:16.436829372 +0200
@@ -616,7 +616,7 @@ PHP_FUNCTION(mysqli_change_user)
size_t user_len, password_len, dbname_len;
zend_ulong rc;
#if !defined(MYSQLI_USE_MYSQLND) && defined(HAVE_MYSQLI_SET_CHARSET)
- const CHARSET_INFO * old_charset;
+ const MY_CHARSET_INFO * old_charset;
#endif
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss!", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
diff -up php-7.2.4/ext/mysqli/mysqli.c.omv~ php-7.2.4/ext/mysqli/mysqli.c
--- php-7.2.4/ext/mysqli/mysqli.c.omv~ 2018-04-06 21:49:41.782434506 +0200
+++ php-7.2.4/ext/mysqli/mysqli.c 2018-04-06 21:49:52.708561249 +0200
@@ -26,6 +26,7 @@
#include <signal.h>
+#include <server/mysql_version.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
diff -up php-7.2.4/ext/mysqli/mysqli_nonapi.c.omv~ php-7.2.4/ext/mysqli/mysqli_nonapi.c
--- php-7.2.4/ext/mysqli/mysqli_nonapi.c.omv~ 2018-04-06 21:51:43.217399945 +0200
+++ php-7.2.4/ext/mysqli/mysqli_nonapi.c 2018-04-06 21:58:52.799445824 +0200
@@ -263,7 +263,7 @@ void mysqli_common_connect(INTERNAL_FUNC
php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
#if !defined(MYSQLI_USE_MYSQLND)
- mysql->mysql->reconnect = MyG(reconnect);
+/* mysql->mysql->reconnect = MyG(reconnect); */
#endif
mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile));
diff -up php-7.2.4/ext/mysqli/mysqli_prop.c.omv~ php-7.2.4/ext/mysqli/mysqli_prop.c
--- php-7.2.4/ext/mysqli/mysqli_prop.c.omv~ 2018-04-06 21:50:25.687842714 +0200
+++ php-7.2.4/ext/mysqli/mysqli_prop.c 2018-04-06 21:50:35.116768902 +0200
@@ -23,6 +23,7 @@
#include <signal.h>
+#include <server/mysql_version.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
diff -up php-7.2.4/ext/mysqli/php_mysqli_structs.h.omv~ php-7.2.4/ext/mysqli/php_mysqli_structs.h
--- php-7.2.4/ext/mysqli/php_mysqli_structs.h.omv~ 2018-04-06 21:49:12.161080045 +0200
+++ php-7.2.4/ext/mysqli/php_mysqli_structs.h 2018-04-06 21:58:44.599503172 +0200
@@ -79,11 +79,7 @@
#include <my_sys.h>
#include <mysql.h>
#include <errmsg.h>
-#include <my_list.h>
-#include <m_string.h>
#include <mysqld_error.h>
-#include <my_list.h>
-#include <m_ctype.h>
#include "mysqli_libmysql.h"
#endif /* MYSQLI_USE_MYSQLND */

View file

@ -0,0 +1,16 @@
diff -up php-7.3.0RC1/ext/imap/config.m4.no_pam_in_c-client.droplet php-7.3.0RC1/ext/imap/config.m4
--- php-7.3.0RC1/ext/imap/config.m4.no_pam_in_c-client.droplet 2018-09-13 23:20:57.043938103 +0200
+++ php-7.3.0RC1/ext/imap/config.m4 2018-09-13 23:21:32.613041390 +0200
@@ -178,12 +178,6 @@ if test "$PHP_IMAP" != "no"; then
],[])
CPPFLAGS=$old_CPPFLAGS
- PHP_CHECK_LIBRARY(pam, pam_start,
- [
- PHP_ADD_LIBRARY(pam,, IMAP_SHARED_LIBADD)
- AC_DEFINE(HAVE_LIBPAM,1,[ ])
- ])
-
PHP_CHECK_LIBRARY(crypt, crypt,
[
PHP_ADD_LIBRARY(crypt,, IMAP_SHARED_LIBADD)

22
php-phpbuilddir.diff Normal file
View file

@ -0,0 +1,22 @@
--- php-5.4.1RC2/scripts/Makefile.frag.phpbuilddir.droplet 2012-04-12 07:07:50.000000000 +0200
+++ php-5.4.1RC2/scripts/Makefile.frag 2012-04-17 20:53:30.980190103 +0200
@@ -4,7 +4,7 @@
#
phpincludedir = $(includedir)/php
-phpbuilddir = $(libdir)/build
+phpbuilddir = $(libdir)/php/build
BUILD_FILES = \
scripts/phpize.m4 \
--- php-5.4.1RC2/scripts/phpize.in.phpbuilddir.droplet 2012-04-17 20:53:30.000000000 +0200
+++ php-5.4.1RC2/scripts/phpize.in 2012-04-17 20:54:13.665191018 +0200
@@ -4,7 +4,7 @@
prefix='@prefix@'
datarootdir='@datarootdir@'
exec_prefix="`eval echo @exec_prefix@`"
-phpdir="`eval echo @libdir@`/build"
+phpdir="`eval echo @libdir@`/php/build"
includedir="`eval echo @includedir@`/php"
builddir="`pwd`"
SED="@SED@"

63
php-phpize.diff Normal file
View file

@ -0,0 +1,63 @@
diff -up php-7.3.0RC1/build/build2.mk.phpize.droplet php-7.3.0RC1/build/build2.mk
--- php-7.3.0RC1/build/build2.mk.phpize.droplet 2018-09-13 22:42:02.479901557 +0200
+++ php-7.3.0RC1/build/build2.mk 2018-09-13 22:46:57.574353336 +0200
@@ -26,6 +26,7 @@ targets = $(TOUCH_FILES) configure $(con
PHP_AUTOCONF ?= 'autoconf'
PHP_AUTOHEADER ?= 'autoheader'
+PHP_ACLOCAL ?= 'aclocal'
SUPPRESS_WARNINGS ?= 2>&1 | (egrep -v '(AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used)'||true)
diff -up php-7.3.0RC1/scripts/phpize.in.phpize.droplet php-7.3.0RC1/scripts/phpize.in
--- php-7.3.0RC1/scripts/phpize.in.phpize.droplet 2018-09-11 13:13:29.000000000 +0200
+++ php-7.3.0RC1/scripts/phpize.in 2018-09-13 22:47:29.701503740 +0200
@@ -11,7 +11,7 @@ SED="@SED@"
FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4 ax_check_compile_flag.m4 ax_gcc_func_attribute.m4"
FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php"
-CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ modules/ install-sh \
+CLEAN_FILES="$FILES *.o *.so *.lo *.la .deps .libs/ build/ modules/ install-sh \
mkinstalldirs missing config.nice config.sub config.guess configure configure.ac \
aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache autom4te.cache/ \
config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h \
@@ -121,6 +121,7 @@ phpize_check_autotools()
{
test -z "$PHP_AUTOCONF" && PHP_AUTOCONF=autoconf
test -z "$PHP_AUTOHEADER" && PHP_AUTOHEADER=autoheader
+ test -z "$PHP_ACLOCAL" && PHP_ACLOCAL=aclocal
if test ! -x "$PHP_AUTOCONF" && test ! -x "`$php_shtool path $PHP_AUTOCONF`"; then
cat <<EOF
@@ -138,6 +139,14 @@ Cannot find autoheader. Please check you
EOF
exit 1
fi
+ if ! test -x "`$php_shtool path $PHP_ACLOCAL`"; then
+ cat <<EOF
+Cannot find aclocal. Please check your autoconf installation and the \$PHP_ACLOCAL
+environment variable is set correctly and then rerun this script.
+
+EOF
+ exit 1
+ fi
}
phpize_copy_files()
@@ -151,13 +160,13 @@ phpize_copy_files()
phpize_replace_prefix()
{
- $SED \
- -e "s#@prefix@#$prefix#" \
- < "$phpdir/phpize.m4" > configure.ac
+ cp $phpdir/phpize.m4 configure.in
}
phpize_autotools()
{
+ libtoolize --copy --force || exit 1
+ $PHP_ACLOCAL || exit 1
$PHP_AUTOCONF || exit 1
$PHP_AUTOHEADER || exit 1
}

View file

@ -0,0 +1,16 @@
--- php-7.2.0/ext/session/session.c.session.save_path.droplet 2017-11-29 12:53:35.546492999 +0100
+++ php-7.2.0/ext/session/session.c 2017-11-29 12:55:16.785667771 +0100
@@ -790,11 +790,11 @@ static PHP_INI_MH(OnUpdateRfc1867Freq) /
/* {{{ PHP_INI
*/
PHP_INI_BEGIN()
- STD_PHP_INI_ENTRY("session.save_path", "", PHP_INI_ALL, OnUpdateSaveDir, save_path, php_ps_globals, ps_globals)
+ STD_PHP_INI_ENTRY("session.save_path", "/var/lib/php", PHP_INI_ALL, OnUpdateSaveDir, save_path, php_ps_globals, ps_globals)
STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateName, session_name, php_ps_globals, ps_globals)
PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler)
STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_PERDIR, OnUpdateBool, auto_start, php_ps_globals, ps_globals)
- STD_PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, OnUpdateSessionLong, gc_probability, php_ps_globals, ps_globals)
+ STD_PHP_INI_ENTRY("session.gc_probability", "0", PHP_INI_ALL, OnUpdateSessionLong, gc_probability, php_ps_globals, ps_globals)
STD_PHP_INI_ENTRY("session.gc_divisor", "100", PHP_INI_ALL, OnUpdateSessionLong, gc_divisor, php_ps_globals, ps_globals)
STD_PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, OnUpdateSessionLong, gc_maxlifetime, php_ps_globals, ps_globals)
PHP_INI_ENTRY("session.serialize_handler", "php", PHP_INI_ALL, OnUpdateSerializer)

73
php-shared.diff Normal file
View file

@ -0,0 +1,73 @@
--- php-7.2.0/Makefile.global.shared.droplet 2017-11-28 10:22:51.000000000 +0100
+++ php-7.2.0/Makefile.global 2017-11-29 00:28:39.001984696 +0100
@@ -15,8 +15,12 @@ build-modules: $(PHP_MODULES) $(PHP_ZEND
build-binaries: $(PHP_BINARIES)
-libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
+libphp$(PHP_MAJOR_VERSION)_common.la: $(PHP_GLOBAL_OBJS)
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -version-info 8:0:3 -rpath $(phptempdir) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
+ -@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1
+
+libphp$(PHP_MAJOR_VERSION).la: libphp$(PHP_MAJOR_VERSION)_common.la $(PHP_SAPI_OBJS)
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) libphp$(PHP_MAJOR_VERSION)_common.la $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
-@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1
libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
@@ -27,10 +31,10 @@ install: $(all_targets) $(install_target
install-sapi: $(OVERALL_TARGET)
@echo "Installing PHP SAPI module: $(PHP_SAPI)"
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
- -@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \
+ -@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION)_common.$(SHLIB_DL_SUFFIX_NAME); then \
for i in 0.0.0 0.0 0; do \
- if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \
- $(LN_S) $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); \
+ if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION)_common.$(SHLIB_DL_SUFFIX_NAME).$$i; then \
+ $(LN_S) $(phptempdir)/libphp$(PHP_MAJOR_VERSION)_common.$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp$(PHP_MAJOR_VERSION)_common.$(SHLIB_DL_SUFFIX_NAME); \
break; \
fi; \
done; \
--- php-7.2.0/sapi/cgi/config9.m4.shared.droplet 2017-11-28 10:23:05.000000000 +0100
+++ php-7.2.0/sapi/cgi/config9.m4 2017-11-29 00:28:39.002984698 +0100
@@ -64,7 +64,7 @@ if test "$PHP_CGI" != "no"; then
BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_FASTCGI_OBJS:.lo=.o) \$(PHP_CGI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
;;
*)
- BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_FASTCGI_OBJS) \$(PHP_CGI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
+ BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) libphp\$(PHP_MAJOR_VERSION)_common.la \$(PHP_BINARY_OBJS) \$(PHP_FASTCGI_OBJS) \$(PHP_CGI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
;;
esac
--- php-7.2.0/sapi/cgi/Makefile.frag.shared.droplet 2017-11-28 10:23:05.000000000 +0100
+++ php-7.2.0/sapi/cgi/Makefile.frag 2017-11-29 00:28:39.002984698 +0100
@@ -1,6 +1,6 @@
cgi: $(SAPI_CGI_PATH)
-$(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_FASTCGI_OBJS) $(PHP_CGI_OBJS)
+$(SAPI_CGI_PATH): libphp$(PHP_MAJOR_VERSION)_common.la $(PHP_BINARY_OBJS) $(PHP_FASTCGI_OBJS) $(PHP_CGI_OBJS)
$(BUILD_CGI)
install-cgi: $(SAPI_CGI_PATH)
--- php-7.2.0/sapi/cli/config.m4.shared.droplet 2017-11-29 00:28:39.002984698 +0100
+++ php-7.2.0/sapi/cli/config.m4 2017-11-29 00:30:00.110178568 +0100
@@ -45,7 +45,7 @@ if test "$PHP_CLI" != "no"; then
BUILD_CLI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
;;
*)
- BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
+ BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) libphp\$(PHP_MAJOR_VERSION)_common.la \$(PHP_BINARY_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
;;
esac
--- php-7.2.0/sapi/cli/Makefile.frag.shared.droplet 2017-11-28 10:23:05.000000000 +0100
+++ php-7.2.0/sapi/cli/Makefile.frag 2017-11-29 00:28:39.002984698 +0100
@@ -1,6 +1,6 @@
cli: $(SAPI_CLI_PATH)
-$(SAPI_CLI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_CLI_OBJS)
+$(SAPI_CLI_PATH): libphp$(PHP_MAJOR_VERSION)_common.la $(PHP_BINARY_OBJS) $(PHP_CLI_OBJS)
$(BUILD_CLI)
install-cli: $(SAPI_CLI_PATH)

24
php-tests-wddx.diff Normal file
View file

@ -0,0 +1,24 @@
diff -Naur php-5.2.3/ext/wddx/tests/001.phpt php-5.2.3.oden/ext/wddx/tests/001.phpt
--- php-5.2.3/ext/wddx/tests/001.phpt 2007-05-18 13:29:55.000000000 +0200
+++ php-5.2.3.oden/ext/wddx/tests/001.phpt 2007-06-20 13:19:55.000000000 +0200
@@ -22,7 +22,7 @@
["aDateTime2"]=>
int(329632332)
["aDateTime3"]=>
- string(22) "2040-06-12T04:32:12+00"
+ string(12) "NotADateTime"
["aBoolean"]=>
bool(true)
["anArray"]=>
diff -Naur php-5.2.3/ext/wddx/tests/wddx.xml php-5.2.3.oden/ext/wddx/tests/wddx.xml
--- php-5.2.3/ext/wddx/tests/wddx.xml 2005-03-12 02:52:48.000000000 +0100
+++ php-5.2.3.oden/ext/wddx/tests/wddx.xml 2007-06-20 13:19:55.000000000 +0200
@@ -20,7 +20,7 @@
<dateTime>1980-06-12T04:32:12+00</dateTime>
</var>
<var name='aDateTime3'>
- <dateTime>2040-06-12T04:32:12+00</dateTime>
+ <dateTime>NotADateTime</dateTime>
</var>
<var name='aBoolean'>
<boolean value='true'/>

40
php-umask.diff Normal file
View file

@ -0,0 +1,40 @@
--- php-7.0.1/sapi/apache2handler/sapi_apache2.c.umask.droplet 2015-12-16 11:41:54.000000000 +0100
+++ php-7.0.1/sapi/apache2handler/sapi_apache2.c 2015-12-29 00:40:11.502348482 +0100
@@ -475,6 +475,19 @@ static apr_status_t php_server_context_c
return APR_SUCCESS;
}
+static int saved_umask;
+
+static void php_save_umask(void)
+{
+ saved_umask = umask(0777);
+ umask(saved_umask);
+}
+
+static void php_restore_umask(void)
+{
+ umask(saved_umask);
+}
+
static int php_apache_request_ctor(request_rec *r, php_struct *ctx)
{
char *content_length;
@@ -669,6 +682,8 @@ zend_first_try {
} else {
zend_file_handle zfd;
+ php_save_umask();
+
zfd.type = ZEND_HANDLE_FILENAME;
zfd.filename = (char *) r->filename;
zfd.free_filename = 0;
@@ -680,6 +695,8 @@ zend_first_try {
zend_execute_scripts(ZEND_INCLUDE, NULL, 1, &zfd);
}
+ php_restore_umask();
+
apr_table_set(r->notes, "mod_php_memory_usage",
apr_psprintf(ctx->r->pool, "%" APR_SIZE_T_FMT, zend_memory_peak_usage(1)));
}

11
php-xmlrpc_epi.patch Normal file
View file

@ -0,0 +1,11 @@
--- php-7.0.1/ext/xmlrpc/xmlrpc-epi-php.c.xmlrpc_epi_header 2015-12-29 00:12:51.764748580 +0100
+++ php-7.0.1/ext/xmlrpc/xmlrpc-epi-php.c 2015-12-29 00:15:09.654193700 +0100
@@ -71,7 +71,7 @@
#include "ext/date/php_date.h"
#include "php_ini.h"
#include "php_xmlrpc.h"
-#include "xmlrpc.h"
+#include <xmlrpc-epi/xmlrpc.h>
static int le_xmlrpc_server;

21
php-xmlrpc_no_rpath.diff Normal file
View file

@ -0,0 +1,21 @@
--- ext/xmlrpc/config.m4 2007-06-11 11:48:59.000000000 +0200
+++ ext/xmlrpc/config.m4.oden 2007-06-11 12:21:28.000000000 +0200
@@ -49,7 +49,7 @@
for i in $PHP_LIBEXPAT_DIR $XMLRPC_DIR /usr/local /usr; do
if test -f $i/$PHP_LIBDIR/libexpat.a || test -f $i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME; then
AC_DEFINE(HAVE_LIBEXPAT,1,[ ])
- PHP_ADD_LIBRARY_WITH_PATH(expat, $i/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(expat,,XMLRPC_SHARED_LIBADD)
PHP_ADD_INCLUDE($i/include)
testval=yes
break
@@ -100,7 +100,8 @@
fi
PHP_ADD_INCLUDE($XMLRPC_DIR)
- PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(xmlrpc,,XMLRPC_SHARED_LIBADD)
PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c, $ext_shared)
+ PHP_SUBST(XMLRPC_SHARED_LIBADD)
XMLRPC_MODULE_TYPE=external
fi

View file

@ -0,0 +1,38 @@
--- php-7.0.1/ext/standard/image.c.zlib-for-getimagesize.droplet 2015-12-16 11:42:03.000000000 +0100
+++ php-7.0.1/ext/standard/image.c 2015-12-29 00:21:45.084450620 +0100
@@ -34,7 +34,7 @@
#include "win32/php_stdint.h"
#endif
-#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB)
+#if HAVE_ZLIB
#include "zlib.h"
#endif
@@ -84,7 +84,7 @@ PHP_MINIT_FUNCTION(imagetypes)
REGISTER_LONG_CONSTANT("IMAGETYPE_JP2", IMAGE_FILETYPE_JP2, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMAGETYPE_JPX", IMAGE_FILETYPE_JPX, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMAGETYPE_JB2", IMAGE_FILETYPE_JB2, CONST_CS | CONST_PERSISTENT);
-#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB)
+#if HAVE_ZLIB
REGISTER_LONG_CONSTANT("IMAGETYPE_SWC", IMAGE_FILETYPE_SWC, CONST_CS | CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("IMAGETYPE_IFF", IMAGE_FILETYPE_IFF, CONST_CS | CONST_PERSISTENT);
@@ -192,7 +192,7 @@ static unsigned long int php_swf_get_bit
}
/* }}} */
-#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB)
+#if HAVE_ZLIB
/* {{{ php_handle_swc
*/
static struct gfxinfo *php_handle_swc(php_stream * stream)
@@ -1337,7 +1337,7 @@ static void php_getimagesize_from_stream
result = php_handle_swf(stream);
break;
case IMAGE_FILETYPE_SWC:
-#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB)
+#if HAVE_ZLIB
result = php_handle_swc(stream);
#else
php_error_docref(NULL, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled");

8
php.crond Normal file
View file

@ -0,0 +1,8 @@
#!/bin/bash
# /etc/cron.d/php: crontab fragment for php
# This purges session files older than X, where X is defined in seconds
# as the largest value of session.gc_maxlifetime from all your php.ini
# files, or 24 minutes if not defined. See /usr/lib/php/maxlifetime
# Look for and purge old sessions every 30 minutes
09,39 * * * * root [ -d /var/lib/php ] && find /var/lib/php/ -type f -depth -mindepth 1 -maxdepth 1 -mmin +$(/usr/lib/php/maxlifetime) -print0 | xargs -r -0 rm

1806
php.ini Normal file

File diff suppressed because it is too large Load diff

2679
php.spec Normal file

File diff suppressed because it is too large Load diff

77
php5-apache2-filters.diff Normal file
View file

@ -0,0 +1,77 @@
--- php-7.0.1/sapi/apache2handler/php_functions.c.apache2-filters.droplet 2015-12-16 11:41:55.000000000 +0100
+++ php-7.0.1/sapi/apache2handler/php_functions.c 2015-12-29 00:12:07.202603653 +0100
@@ -216,6 +216,65 @@ PHP_FUNCTION(apache_response_headers)
}
/* }}} */
+/* {{{ proto array apache_get_output_filters()
+ Get All Active Output filters */
+PHP_FUNCTION(apache_get_output_filters)
+{
+ ap_filter_t* ff;
+ php_struct *ctx;
+
+ if (ZEND_NUM_ARGS() != 0) {
+ WRONG_PARAM_COUNT;
+ }
+
+ if(array_init(return_value) != SUCCESS)
+ {
+ RETURN_NULL();
+ }
+
+ ctx = SG(server_context);
+
+ ff = ctx->r->output_filters;
+
+ do {
+ add_next_index_string(return_value, ff->frec->name);
+ ff = ff->next ;
+ } while (ff);
+
+}
+/* }}} */
+
+/* {{{ proto bool apache_add_output_filter(string filter_name)
+ Add an output filter to this request */
+PHP_FUNCTION(apache_add_output_filter)
+{
+ php_struct *ctx;
+ int arg_count = ZEND_NUM_ARGS();
+ zval **filter_name;
+ ap_filter_rec_t* ap_filter;
+
+ if (arg_count != 1 ||
+ zend_get_parameters_ex(arg_count, &filter_name) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ ctx = SG(server_context);
+
+ convert_to_string_ex(filter_name);
+
+ ap_filter = ap_get_output_filter_handle(Z_STRVAL_P(*filter_name));
+
+ /* requested output filter was not found */
+ if(ap_filter == NULL) {
+ RETURN_FALSE;
+ }
+ else {
+ ap_add_output_filter_handle(ap_filter, NULL, ctx->r, ctx->r->connection);
+ RETURN_TRUE;
+ }
+}
+/* }}} */
+
/* {{{ proto string apache_note(string note_name [, string note_value])
Get and set Apache request notes */
PHP_FUNCTION(apache_note)
@@ -520,6 +579,8 @@ ZEND_END_ARG_INFO()
static const zend_function_entry apache_functions[] = {
PHP_FE(apache_lookup_uri, arginfo_apache2handler_lookup_uri)
PHP_FE(virtual, arginfo_apache2handler_virtual)
+ PHP_FE(apache_get_output_filters, NULL)
+ PHP_FE(apache_add_output_filter, NULL)
PHP_FE(apache_request_headers, arginfo_apache2handler_getallheaders)
PHP_FE(apache_response_headers, arginfo_apache2handler_response_headers)
PHP_FE(apache_setenv, arginfo_apache2handler_setenv)