summaryrefslogtreecommitdiffstats
path: root/zip-php83.patch
blob: 238d6a11a652b2213a403270dcd78acfee98c330 (plain)
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
From 85624b566aa4f3c9d0e676fbc6127795e1f77f24 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 30 May 2023 17:00:32 +0200
Subject: [PATCH] sync changes from 8.3

---
 php81/php_zip.c         | 25 +++++++++++++++++--------
 php81/php_zip.stub.php  | 23 ++++++++++++++++++++++-
 php81/php_zip_arginfo.h | 16 ++++++++++------
 3 files changed, 49 insertions(+), 15 deletions(-)

diff --git a/php81/php_zip.c b/php81/php_zip.c
index 1d7c7e9..4ba1319 100644
--- a/php81/php_zip.c
+++ b/php81/php_zip.c
@@ -39,6 +39,10 @@
 #endif
 #endif
 
+#if PHP_VERSION_ID < 80300
+#define zend_zval_value_name(opt) zend_zval_type_name(opt)
+#endif
+
 /* {{{ Resource le */
 static int le_zip_dir;
 #define le_zip_dir_name "Zip Directory"
@@ -354,7 +358,7 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts)
 	if ((option = zend_hash_str_find(options, "remove_all_path", sizeof("remove_all_path") - 1)) != NULL) {
 		if (Z_TYPE_P(option) != IS_FALSE && Z_TYPE_P(option) != IS_TRUE) {
 			php_error_docref(NULL, E_WARNING, "Option \"remove_all_path\" must be of type bool, %s given",
-				zend_zval_type_name(option));
+				zend_zval_value_name(option));
 		}
 		opts->remove_all_path = zval_get_long(option);
 	}
@@ -362,14 +366,14 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts)
 	if ((option = zend_hash_str_find(options, "comp_method", sizeof("comp_method") - 1)) != NULL) {
 		if (Z_TYPE_P(option) != IS_LONG) {
 			php_error_docref(NULL, E_WARNING, "Option \"comp_method\" must be of type int, %s given",
-				zend_zval_type_name(option));
+				zend_zval_value_name(option));
 		}
 		opts->comp_method = zval_get_long(option);
 
 		if ((option = zend_hash_str_find(options, "comp_flags", sizeof("comp_flags") - 1)) != NULL) {
 			if (Z_TYPE_P(option) != IS_LONG) {
 				php_error_docref(NULL, E_WARNING, "Option \"comp_flags\" must be of type int, %s given",
-					zend_zval_type_name(option));
+					zend_zval_value_name(option));
 			}
 			opts->comp_flags = zval_get_long(option);
 		}
@@ -379,14 +383,14 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts)
 	if ((option = zend_hash_str_find(options, "enc_method", sizeof("enc_method") - 1)) != NULL) {
 		if (Z_TYPE_P(option) != IS_LONG) {
 			php_error_docref(NULL, E_WARNING, "Option \"enc_method\" must be of type int, %s given",
-				zend_zval_type_name(option));
+				zend_zval_value_name(option));
 		}
 		opts->enc_method = zval_get_long(option);
 
 		if ((option = zend_hash_str_find(options, "enc_password", sizeof("enc_password") - 1)) != NULL) {
 			if (Z_TYPE_P(option) != IS_STRING) {
 				zend_type_error("Option \"enc_password\" must be of type string, %s given",
-					zend_zval_type_name(option));
+					zend_zval_value_name(option));
 				return -1;
 			}
 			opts->enc_password = Z_STRVAL_P(option);
@@ -397,7 +401,7 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts)
 	if ((option = zend_hash_str_find(options, "remove_path", sizeof("remove_path") - 1)) != NULL) {
 		if (Z_TYPE_P(option) != IS_STRING) {
 			zend_type_error("Option \"remove_path\" must be of type string, %s given",
-				zend_zval_type_name(option));
+				zend_zval_value_name(option));
 			return -1;
 		}
 
@@ -417,7 +421,7 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts)
 	if ((option = zend_hash_str_find(options, "add_path", sizeof("add_path") - 1)) != NULL) {
 		if (Z_TYPE_P(option) != IS_STRING) {
 			zend_type_error("Option \"add_path\" must be of type string, %s given",
-				zend_zval_type_name(option));
+				zend_zval_value_name(option));
 			return -1;
 		}
 
@@ -437,7 +441,7 @@ static int php_zip_parse_options(HashTable *options, zip_options *opts)
 	if ((option = zend_hash_str_find(options, "flags", sizeof("flags") - 1)) != NULL) {
 		if (Z_TYPE_P(option) != IS_LONG) {
 			zend_type_error("Option \"flags\" must be of type int, %s given",
-				zend_zval_type_name(option));
+				zend_zval_value_name(option));
 			return -1;
 		}
 		opts->flags = Z_LVAL_P(option);
@@ -1079,7 +1083,9 @@ static zend_object *php_zip_object_new(zend_class_entry *class_type) /* {{{ */
 	intern->prop_handler = &zip_prop_handlers;
 	zend_object_std_init(&intern->zo, class_type);
 	object_properties_init(&intern->zo, class_type);
+#if PHP_VERSION_ID < 80300
 	intern->zo.handlers = &zip_object_handlers;
+#endif
 	intern->last_id = -1;
 
 	return &intern->zo;
@@ -3105,6 +3111,9 @@ static PHP_MINIT_FUNCTION(zip)
 
 	zip_class_entry = register_class_ZipArchive(zend_ce_countable);
 	zip_class_entry->create_object = php_zip_object_new;
+#if PHP_VERSION_ID >= 80300
+	zip_class_entry->default_object_handlers = &zip_object_handlers;
+#endif
 
 	zend_hash_init(&zip_prop_handlers, 0, NULL, php_zip_free_prop_handler, 1);
 	php_zip_register_prop_handler(&zip_prop_handlers, "lastId",    php_zip_last_id, NULL, IS_LONG);
From c26e4215686294971a13896e3da06312f4a18037 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 5 Jun 2023 16:31:35 +0200
Subject: [PATCH] allow 8.3

---
 config.m4  | 4 ++--
 config.w32 | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/config.m4 b/config.m4
index 390108b..5d77eeb 100644
--- a/config.m4
+++ b/config.m4
@@ -27,8 +27,8 @@ if test "$PHP_ZIP" != "no"; then
   elif test $PHP_VERSION -lt 80100; then
     AC_MSG_RESULT(8.0)
     subdir=php8
-  elif test $PHP_VERSION -lt 80300; then
-    AC_MSG_RESULT(8.1/8.2)
+  elif test $PHP_VERSION -lt 80400; then
+    AC_MSG_RESULT(8.1/8.2/8.3)
     subdir=php81
   else
     AC_MSG_ERROR(PHP version $PHP_VERSION is not supported yet)
diff --git a/config.w32 b/config.w32
index 1d1c3e0..da42ba3 100644
--- a/config.w32
+++ b/config.w32
@@ -32,6 +32,8 @@ if (PHP_ZIP != "no") {
 				configure_module_dirname = configure_module_dirname + "\\php81";
 			} else if (PHP_VERSION == 8 && PHP_MINOR_VERSION == 2) {
 				configure_module_dirname = configure_module_dirname + "\\php81";
+			} else if (PHP_VERSION == 8 && PHP_MINOR_VERSION == 3) {
+				configure_module_dirname = configure_module_dirname + "\\php81";
 			} else {
 				ERROR("PHP " + PHP_VERSION + "." + PHP_MINOR_VERSION + " not supported");
 			}