summaryrefslogtreecommitdiffstats
path: root/php86.patch
blob: 6b86de1948cd6522f024db80e9e5d989aa6638ec (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
From 8ba604b2a97d8433d0b5691f92dc022adf229725 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 26 Jun 2026 08:14:44 +0200
Subject: [PATCH 1/3] zval_dtor remomved in 8.6

---
 rpminfo.c                  | 2 +-
 tests/008-rpmdbsearch.phpt | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/rpminfo.c b/rpminfo.c
index ee6e0c6..c90be1e 100644
--- a/rpminfo.c
+++ b/rpminfo.c
@@ -234,7 +234,7 @@ PHP_FUNCTION(rpminfo)
 	}
 	if (error) {
 		ZVAL_DEREF(error);
-		zval_dtor(error);
+		zval_ptr_dtor_nogc(error);
 		ZVAL_NULL(error);
 	}
 	if (php_check_open_basedir(path)) {
diff --git a/tests/008-rpmdbsearch.phpt b/tests/008-rpmdbsearch.phpt
index 6e0e402..2bd04f1 100644
--- a/tests/008-rpmdbsearch.phpt
+++ b/tests/008-rpmdbsearch.phpt
@@ -2,7 +2,9 @@
 Check for rpmdbinfo function
 --SKIPIF--
 <?php
-if (!extension_loaded("rpminfo")) print "skip";
+if (!extension_loaded("rpminfo")) dir('skip extension missing');
+$a = rpmdbsearch(PHP_BINARY, RPMTAG_INSTFILENAMES);
+if (is_null($a)) die('skip PHP installed from sources');
 ?>
 
 --FILE--
-- 
2.55.0

From 4f2744656cad572fe8ebe91cb0dc13b03069e569 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 26 Jun 2026 09:34:58 +0200
Subject: [PATCH 2/3] simplify previous

---
 rpminfo.c                     | 6 ++----
 tests/006-rpminfo-errors.phpt | 1 +
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/rpminfo.c b/rpminfo.c
index c90be1e..1183ff5 100644
--- a/rpminfo.c
+++ b/rpminfo.c
@@ -233,9 +233,7 @@ PHP_FUNCTION(rpminfo)
 		RETURN_THROWS();
 	}
 	if (error) {
-		ZVAL_DEREF(error);
-		zval_ptr_dtor_nogc(error);
-		ZVAL_NULL(error);
+		ZEND_TRY_ASSIGN_REF_NULL(error);
 	}
 	if (php_check_open_basedir(path)) {
 		RETURN_NULL();
@@ -268,7 +266,7 @@ PHP_FUNCTION(rpminfo)
 	}
 	if (e_len) {
 		if (error) {
-			ZVAL_STRINGL(error, e_msg, e_len);
+			ZEND_TRY_ASSIGN_REF_STRINGL(error, e_msg, e_len);
 		} else {
 			php_error_docref(NULL, E_WARNING, "%s", e_msg);
 		}
diff --git a/tests/006-rpminfo-errors.phpt b/tests/006-rpminfo-errors.phpt
index 5d205d7..007ed5c 100644
--- a/tests/006-rpminfo-errors.phpt
+++ b/tests/006-rpminfo-errors.phpt
@@ -9,6 +9,7 @@ var_dump(rpminfo(__DIR__ . "/missing.rpm"));
 var_dump(rpminfo(__FILE__));
 
 echo "\n+ PHP Warnings\n";
+$error='xxx';
 var_dump(rpminfo(__DIR__ . "/missing.rpm", true,  $error), 
 	$error);
 var_dump(rpminfo(__FILE__,                 false, $error), 
-- 
2.55.0

From 12e2cba1a2c33e3d709c6e1a4246ba236670c77f Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 26 Jun 2026 09:44:23 +0200
Subject: [PATCH 3/3] improve rpminfo errors test

---
 tests/006-rpminfo-errors.phpt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/006-rpminfo-errors.phpt b/tests/006-rpminfo-errors.phpt
index 007ed5c..bf3a5f6 100644
--- a/tests/006-rpminfo-errors.phpt
+++ b/tests/006-rpminfo-errors.phpt
@@ -7,8 +7,9 @@ Check for rpminfo function errors
 echo "+ PHP Warnings\n";
 var_dump(rpminfo(__DIR__ . "/missing.rpm"));
 var_dump(rpminfo(__FILE__));
+var_dump(is_array(rpminfo(__DIR__ . "/bidon.rpm")));
 
-echo "\n+ PHP Warnings\n";
+echo "\n+ Error returned\n";
 $error='xxx';
 var_dump(rpminfo(__DIR__ . "/missing.rpm", true,  $error), 
 	$error);
@@ -26,8 +27,9 @@ NULL
 
 Warning: rpminfo(): Can't read '%s/tests/006-rpminfo-errors.php': Argument is not a RPM file in %s on line %d
 NULL
+bool(true)
 
-+ PHP Warnings
++ Error returned
 NULL
 string(%d) "Can't open '%s/tests/missing.rpm': No such file or directory"
 NULL
-- 
2.55.0