1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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
|