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
|
From 7afdbe2fc07b0e862b6e79190f9ff7f1ff3f61f9 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 11 May 2022 14:02:38 +0200
Subject: [PATCH] support 8.2
---
config.m4 | 4 ++--
config.w32 | 2 ++
php81/php_zip.c | 4 ++++
tests/bug53603.phpt | 1 +
tests/bug53885_php8.phpt | 2 +-
tests/bug70752.phpt | 2 +-
tests/oo_getstatusstring.phpt | 4 ++--
7 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/config.m4 b/config.m4
index 3737db2..390108b 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 80200; then
- AC_MSG_RESULT(8.1)
+ elif test $PHP_VERSION -lt 80300; then
+ AC_MSG_RESULT(8.1/8.2)
subdir=php81
else
AC_MSG_ERROR(PHP version $PHP_VERSION is not supported yet)
diff --git a/config.w32 b/config.w32
index 2d45fb6..1d1c3e0 100644
--- a/config.w32
+++ b/config.w32
@@ -30,6 +30,8 @@ if (PHP_ZIP != "no") {
configure_module_dirname = configure_module_dirname + "\\php8";
} else if (PHP_VERSION == 8 && PHP_MINOR_VERSION == 1) {
configure_module_dirname = configure_module_dirname + "\\php81";
+ } else if (PHP_VERSION == 8 && PHP_MINOR_VERSION == 2) {
+ configure_module_dirname = configure_module_dirname + "\\php81";
} else {
ERROR("PHP " + PHP_VERSION + "." + PHP_MINOR_VERSION + " not supported");
}
diff --git a/php81/php_zip.c b/php81/php_zip.c
index ca040b5..9be5a9b 100644
--- a/php81/php_zip.c
+++ b/php81/php_zip.c
@@ -993,7 +993,11 @@ static HashTable *php_zip_get_properties(zend_object *object)/* {{{ */
return NULL;
}
+#if PHP_VERSION_ID < 80200
ZEND_HASH_FOREACH_STR_KEY_PTR(obj->prop_handler, key, hnd) {
+#else
+ ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(obj->prop_handler, key, hnd) {
+#endif
zval *ret, val;
ret = php_zip_property_reader(obj, hnd, &val);
if (ret == NULL) {
diff --git a/tests/bug53603.phpt b/tests/bug53603.phpt
index b1058b0..76b8ad9 100644
--- a/tests/bug53603.phpt
+++ b/tests/bug53603.phpt
@@ -8,6 +8,7 @@ if(!extension_loaded('zip')) die('skip');
<?php
class TestStream {
+ public $context;
function url_stat($path, $flags) {
if (!($flags & STREAM_URL_STAT_QUIET))
trigger_error("not quiet");
diff --git a/tests/bug53885_php8.phpt b/tests/bug53885_php8.phpt
index 19fb350..f976d9a 100644
--- a/tests/bug53885_php8.phpt
+++ b/tests/bug53885_php8.phpt
@@ -19,7 +19,7 @@ $nx->statName("a",ZIPARCHIVE::FL_UNCHANGED);
--CLEAN--
<?php
$fname = __DIR__."/test53885.zip";
-unlink($fname);
+@unlink($fname);
?>
--EXPECTF--
Deprecated: ZipArchive::open(): Using empty file as ZipArchive is deprecated in %s
diff --git a/tests/bug70752.phpt b/tests/bug70752.phpt
index f006fbe..46546b5 100644
--- a/tests/bug70752.phpt
+++ b/tests/bug70752.phpt
@@ -27,5 +27,5 @@ bool(false)
--CLEAN--
<?php
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70752.txt';
-unlink($filename);
+@unlink($filename);
?>
diff --git a/tests/oo_getstatusstring.phpt b/tests/oo_getstatusstring.phpt
index efd19e3..5860b64 100644
--- a/tests/oo_getstatusstring.phpt
+++ b/tests/oo_getstatusstring.phpt
@@ -8,7 +8,7 @@ Ole-Petter Wikene <olepw@redpill-linpro.com>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$arch = new ZipArchive;
$arch->open($dirname.'foo.zip',ZIPARCHIVE::CREATE);
var_dump($arch->getStatusString());
@@ -20,7 +20,7 @@ $arch->close();
?>
--CLEAN--
<?php
-unlink($dirname.'foo.zip');
+@unlink(__DIR__ . '/foo.zip');
?>
--EXPECT--
string(8) "No error"
--
2.35.3
|