File: Require-PHP-8.0.patch

package info (click to toggle)
phpmyadmin 4%3A5.2.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 142,056 kB
  • sloc: javascript: 228,532; php: 167,409; xml: 17,850; sql: 504; sh: 278; makefile: 208; python: 205
file content (117 lines) | stat: -rw-r--r-- 4,567 bytes parent folder | download
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
From: William Desportes <williamdes@wdes.fr>
Date: Fri, 14 Apr 2023 18:06:39 +0200
Subject: Require PHP >= 8.0

Due to the delta carried in the Ubuntu PSR stack, phpmyadmin does not run with
PHP versions < 8. This patch makes it fail gracefully instead of allowing
phpmyadmin to abruptly crash, allowing us to provide useful error messages so
users understand what their next steps should be towards getting a functional
phpmyadmin deployment.

Bug: https://github.com/phpmyadmin/phpmyadmin/issues/17503
Bug: https://github.com/phpmyadmin/phpmyadmin/issues/19092
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2016016
Origin: vendor
Forwarded: not-needed
Reviewed-by: Athos Ribeiro <athos.ribeiro@canonical.com>
---
 composer.json            | 2 --
 index.php                | 9 +++++++--
 js/messages.php          | 9 +++++++--
 setup/lib/common.inc.php | 9 +++++++--
 url.php                  | 9 +++++++--
 5 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/composer.json b/composer.json
index 134f273..fad5528 100644
--- a/composer.json
+++ b/composer.json
@@ -77,8 +77,6 @@
         "symfony/polyfill-ctype": "^1.17.0",
         "symfony/polyfill-iconv": "^1.33",
         "symfony/polyfill-mbstring": "^1.17.0",
-        "symfony/polyfill-php80": "^1.16",
-        "symfony/polyfill-php84": "^1.33",
         "twig/twig": "^3.3.5",
         "webmozart/assert": "^1.10",
         "williamdes/mariadb-mysql-kbs": "^1.2"
diff --git a/index.php b/index.php
index 26fcabf..8831d47 100644
--- a/index.php
+++ b/index.php
@@ -11,8 +11,13 @@ if (! defined('ROOT_PATH')) {
     // phpcs:enable
 }
 
-if (PHP_VERSION_ID < 70205) {
-    die('<p>PHP 7.2.5+ is required.</p><p>Currently installed version is: ' . PHP_VERSION . '</p>');
+if (PHP_VERSION_ID < 80000) {
+    die(
+        '<p>PHP 8.0.0+ is required ('
+        . '<a href="https://bugs.launchpad.net/ubuntu/+source/symfony/+bug/1975892">Ubuntu Launchpad bug #1975892</a>'
+        . '&nbsp;and&nbsp;<a href="https://github.com/phpmyadmin/phpmyadmin/issues/17503">phpMyAdmin issue #17503</a>'
+        . ').</p><p>Currently installed version is: ' . PHP_VERSION . '</p>'
+    );
 }
 
 // phpcs:disable PSR1.Files.SideEffects
diff --git a/js/messages.php b/js/messages.php
index 927226b..1e2b249 100644
--- a/js/messages.php
+++ b/js/messages.php
@@ -15,8 +15,13 @@ if (! defined('ROOT_PATH')) {
     // phpcs:enable
 }
 
-if (PHP_VERSION_ID < 70205) {
-    die('<p>PHP 7.2.5+ is required.</p><p>Currently installed version is: ' . PHP_VERSION . '</p>');
+if (PHP_VERSION_ID < 80000) {
+    die(
+        '<p>PHP 8.0.0+ is required ('
+        . '<a href="https://bugs.launchpad.net/ubuntu/+source/symfony/+bug/1975892">Ubuntu Launchpad bug #1975892</a>'
+        . '&nbsp;and&nbsp;<a href="https://github.com/phpmyadmin/phpmyadmin/issues/17503">phpMyAdmin issue #17503</a>'
+        . ').</p><p>Currently installed version is: ' . PHP_VERSION . '</p>'
+    );
 }
 
 // phpcs:disable PSR1.Files.SideEffects
diff --git a/setup/lib/common.inc.php b/setup/lib/common.inc.php
index 17adc52..b681566 100644
--- a/setup/lib/common.inc.php
+++ b/setup/lib/common.inc.php
@@ -6,8 +6,13 @@ use PhpMyAdmin\Common;
 use PhpMyAdmin\Config\ConfigFile;
 use PhpMyAdmin\DatabaseInterface;
 
-if (PHP_VERSION_ID < 70205) {
-    die('<p>PHP 7.2.5+ is required.</p><p>Currently installed version is: ' . PHP_VERSION . '</p>');
+if (PHP_VERSION_ID < 80000) {
+    die(
+        '<p>PHP 8.0.0+ is required ('
+        . '<a href="https://bugs.launchpad.net/ubuntu/+source/symfony/+bug/1975892">Ubuntu Launchpad bug #1975892</a>'
+        . '&nbsp;and&nbsp;<a href="https://github.com/phpmyadmin/phpmyadmin/issues/17503">phpMyAdmin issue #17503</a>'
+        . ').</p><p>Currently installed version is: ' . PHP_VERSION . '</p>'
+    );
 }
 
 if (! defined('PHPMYADMIN')) {
diff --git a/url.php b/url.php
index 0274481..ebf69df 100644
--- a/url.php
+++ b/url.php
@@ -11,8 +11,13 @@ if (! defined('ROOT_PATH')) {
     // phpcs:enable
 }
 
-if (PHP_VERSION_ID < 70205) {
-    die('<p>PHP 7.2.5+ is required.</p><p>Currently installed version is: ' . PHP_VERSION . '</p>');
+if (PHP_VERSION_ID < 80000) {
+    die(
+        '<p>PHP 8.0.0+ is required ('
+        . '<a href="https://bugs.launchpad.net/ubuntu/+source/symfony/+bug/1975892">Ubuntu Launchpad bug #1975892</a>'
+        . '&nbsp;and&nbsp;<a href="https://github.com/phpmyadmin/phpmyadmin/issues/17503">phpMyAdmin issue #17503</a>'
+        . ').</p><p>Currently installed version is: ' . PHP_VERSION . '</p>'
+    );
 }
 
 // phpcs:disable PSR1.Files.SideEffects