summaryrefslogtreecommitdiffstats
path: root/pr2.patch
blob: 394a42d2b8dcb80ec79b8e5c3f6cb80dcb24c9f4 (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
From b53da53d60c479baa2e33859bdb03cad0ea5b540 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 9 Jul 2021 16:10:52 +0200
Subject: [PATCH 1/2] use extension version instead of PHP version

---
 php_xz.h |  2 ++
 xz.c     | 10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/php_xz.h b/php_xz.h
index 8368c4a..9908cb9 100644
--- a/php_xz.h
+++ b/php_xz.h
@@ -20,6 +20,8 @@
 #ifndef PHP_XZ_H
 # define PHP_XZ_H
 
+#define PHP_XZ_VERSION "1.1.1"
+
 extern zend_module_entry xz_module_entry;
 extern php_stream_wrapper php_stream_xz_wrapper;
 
diff --git a/xz.c b/xz.c
index 243167d..e0a4d3a 100644
--- a/xz.c
+++ b/xz.c
@@ -92,7 +92,7 @@ zend_module_entry xz_module_entry = {
 	NULL, /* PHP_RINIT(xz) */
 	NULL, /* PHP_RSHUTDOWN(xz) */
 	PHP_MINFO(xz),
-	PHP_VERSION,
+	PHP_XZ_VERSION,
 	STANDARD_MODULE_PROPERTIES
 };
 /* }}} */
@@ -134,7 +134,13 @@ PHP_MINFO_FUNCTION(xz)
 {
 	php_info_print_table_start();
 	php_info_print_table_header(2, "xz support", "enabled");
-	php_info_print_table_header(2, "liblzma version", lzma_version_string());
+	php_info_print_table_header(2, "xz extension version ", PHP_XZ_VERSION);
+	if (strcmp(LZMA_VERSION_STRING, lzma_version_string())) {
+		php_info_print_table_header(2, "liblzma headers version", LZMA_VERSION_STRING);
+		php_info_print_table_header(2, "liblzma library version", lzma_version_string());
+	} else {
+		php_info_print_table_header(2, "liblzma version", lzma_version_string());
+	}
 	php_info_print_table_end();
 
 	DISPLAY_INI_ENTRIES();

From 1aa1b2763257b9c733c5f636e6ace275e1600891 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 9 Jul 2021 16:13:04 +0200
Subject: [PATCH 2/2] only 1 header + rows

---
 xz.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xz.c b/xz.c
index e0a4d3a..832c13e 100644
--- a/xz.c
+++ b/xz.c
@@ -134,12 +134,12 @@ PHP_MINFO_FUNCTION(xz)
 {
 	php_info_print_table_start();
 	php_info_print_table_header(2, "xz support", "enabled");
-	php_info_print_table_header(2, "xz extension version ", PHP_XZ_VERSION);
+	php_info_print_table_row(2, "xz extension version ", PHP_XZ_VERSION);
 	if (strcmp(LZMA_VERSION_STRING, lzma_version_string())) {
-		php_info_print_table_header(2, "liblzma headers version", LZMA_VERSION_STRING);
-		php_info_print_table_header(2, "liblzma library version", lzma_version_string());
+		php_info_print_table_row(2, "liblzma headers version", LZMA_VERSION_STRING);
+		php_info_print_table_row(2, "liblzma library version", lzma_version_string());
 	} else {
-		php_info_print_table_header(2, "liblzma version", lzma_version_string());
+		php_info_print_table_row(2, "liblzma version", lzma_version_string());
 	}
 	php_info_print_table_end();