diff options
Diffstat (limited to '0003-fix-for-PHP-7.2.patch')
-rw-r--r-- | 0003-fix-for-PHP-7.2.patch | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/0003-fix-for-PHP-7.2.patch b/0003-fix-for-PHP-7.2.patch new file mode 100644 index 0000000..1eb1daa --- /dev/null +++ b/0003-fix-for-PHP-7.2.patch @@ -0,0 +1,138 @@ +From acaa9671bf73c609f65f42c12c50780d490d5e08 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Mon, 26 Jun 2017 16:50:24 +0200 +Subject: [PATCH 3/3] fix for PHP 7.2 + +--- + php_request.h | 15 +++++++++++++++ + serverrequest.c | 18 +++++++++--------- + serverresponse.c | 10 +++++----- + 3 files changed, 29 insertions(+), 14 deletions(-) + +diff --git a/php_request.h b/php_request.h +index 3c3174e..0e39425 100644 +--- a/php_request.h ++++ b/php_request.h +@@ -8,6 +8,21 @@ + extern zend_module_entry request_module_entry; + #define phpext_request_ptr &request_module_entry + ++#if PHP_VERSION_ID >= 70200 ++ ++#define REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX ++#define REQUEST_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX ++ ++#else ++ ++#define REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ ++ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, NULL, allow_null) ++ ++#define REQUEST_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null) \ ++ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, IS_OBJECT, classname, allow_null) ++ ++#endif ++ + #endif /* PHP_REQUEST_H */ + + /* +diff --git a/serverrequest.c b/serverrequest.c +index 730c895..c6b549b 100644 +--- a/serverrequest.c ++++ b/serverrequest.c +@@ -55,40 +55,40 @@ ZEND_BEGIN_ARG_INFO_EX(ServerRequest_construct_args, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, globals, IS_ARRAY, 1) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(ServerRequest_parseAccept_args, IS_ARRAY, NULL, 1) ++REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ServerRequest_parseAccept_args, 0, 1, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(ServerRequest_parseContentType_args, IS_ARRAY, NULL, 1) ++REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ServerRequest_parseContentType_args, 0, 1, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(ServerRequest_parseDigestAuth_args, IS_ARRAY, NULL, 1) ++REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ServerRequest_parseDigestAuth_args, 0, 1, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(ServerRequest_withInput_args, IS_OBJECT, "ServerRequest", 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(ServerRequest_withInput_args, 0, 1, "ServerRequest", 0) + ZEND_ARG_INFO(0, input) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(ServerRequest_withParam_args, IS_OBJECT, "ServerRequest", 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(ServerRequest_withParam_args, 0, 2, "ServerRequest", 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, val) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(ServerRequest_withParams_args, IS_OBJECT, "ServerRequest", 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(ServerRequest_withParams_args, 0, 1, "ServerRequest", 0) + ZEND_ARG_ARRAY_INFO(0, params, 0) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(ServerRequest_withoutParam_args, IS_OBJECT, "ServerRequest", 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(ServerRequest_withoutParam_args, 0, 1, "ServerRequest", 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(ServerRequest_withoutParams_args, IS_OBJECT, "ServerRequest", 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(ServerRequest_withoutParams_args, 0, 1, "ServerRequest", 0) + ZEND_ARG_ARRAY_INFO(0, keys, 1) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(ServerRequest_withUrl_args, IS_OBJECT, "ServerRequest", 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(ServerRequest_withUrl_args, 0, 1, "ServerRequest", 0) + ZEND_ARG_ARRAY_INFO(0, url, 0) + ZEND_END_ARG_INFO() + /* }}} Argument Info */ +diff --git a/serverresponse.c b/serverresponse.c +index 02853e1..72b5e59 100644 +--- a/serverresponse.c ++++ b/serverresponse.c +@@ -31,7 +31,7 @@ zend_class_entry * ServerResponse_ce_ptr; + ZEND_BEGIN_ARG_INFO_EX(AI(__construct), 0, 0, 0) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(getVersion), 0, 0, IS_STRING, NULL, 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(getVersion), 0, 0, IS_STRING, 0) + ZEND_END_ARG_INFO() + + ZEND_BEGIN_ARG_INFO_EX(AI(setVersion), 0, 0, 1) +@@ -45,10 +45,10 @@ ZEND_BEGIN_ARG_INFO_EX(AI(setStatus), 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, status, IS_LONG, 0) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(getHeader), 0, 0, IS_STRING, NULL, 1) ++REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(getHeader), 0, 0, IS_STRING, 1) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(getHeaders), 0, 0, IS_ARRAY, NULL, 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(getHeaders), 0, 0, IS_ARRAY, 0) + ZEND_END_ARG_INFO() + + ZEND_BEGIN_ARG_INFO_EX(AI(addSetHeader), 0, 0, 2) +@@ -56,7 +56,7 @@ ZEND_BEGIN_ARG_INFO_EX(AI(addSetHeader), 0, 0, 2) + ZEND_ARG_INFO(0, value) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(getCookies), 0, 0, IS_ARRAY, NULL, 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(getCookies), 0, 0, IS_ARRAY, 0) + ZEND_END_ARG_INFO() + + ZEND_BEGIN_ARG_INFO_EX(AI(setCookie), 0, 0, 1) +@@ -89,7 +89,7 @@ ZEND_BEGIN_ARG_INFO_EX(AI(setContentDownload), 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0) + ZEND_END_ARG_INFO() + +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(date), 0, 1, IS_STRING, NULL, 0) ++REQUEST_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(AI(date), 0, 1, IS_STRING, 0) + ZEND_ARG_INFO(0, date) + ZEND_END_ARG_INFO() + +-- +2.9.4 + |