git: f16b3f9ae2ad - main - databases/phppgadmin: fix for PHP8

From: Dirk Meyer <dinoex_at_FreeBSD.org>
Date: Mon, 09 May 2022 08:18:06 UTC
The branch main has been updated by dinoex:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f16b3f9ae2ad70954302899106b9d2e14ad874e5

commit f16b3f9ae2ad70954302899106b9d2e14ad874e5
Author:     Dirk Meyer <dinoex@FreeBSD.org>
AuthorDate: 2022-05-09 08:17:32 +0000
Commit:     Dirk Meyer <dinoex@FreeBSD.org>
CommitDate: 2022-05-09 08:17:32 +0000

    databases/phppgadmin: fix for PHP8
    
    PR: 263759
---
 databases/phppgadmin/Makefile                             |  2 +-
 databases/phppgadmin/files/patch-adodb-postgres64.inc.php | 14 ++++++++++++++
 databases/phppgadmin/files/patch-all_db.php               | 11 +++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/databases/phppgadmin/Makefile b/databases/phppgadmin/Makefile
index 6a10cf22df20..c44f8140cd94 100644
--- a/databases/phppgadmin/Makefile
+++ b/databases/phppgadmin/Makefile
@@ -3,7 +3,7 @@
 PORTNAME=	phppgadmin
 DISTVERSIONPREFIX=	REL_
 DISTVERSION=	7-13-0
-PORTREVISION=	0
+PORTREVISION=	1
 CATEGORIES=	databases www
 PKGNAMESUFFIX=	${PHP_PKGNAMESUFFIX}
 
diff --git a/databases/phppgadmin/files/patch-adodb-postgres64.inc.php b/databases/phppgadmin/files/patch-adodb-postgres64.inc.php
new file mode 100644
index 000000000000..0c62e353ce1a
--- /dev/null
+++ b/databases/phppgadmin/files/patch-adodb-postgres64.inc.php
@@ -0,0 +1,14 @@
+--- libraries/adodb/drivers/adodb-postgres64.inc.php.orig	2020-11-07 06:09:12 UTC
++++ libraries/adodb/drivers/adodb-postgres64.inc.php
+@@ -122,6 +122,11 @@ WHERE relkind in ('r','v') AND (c.relname='%s' or c.re
+ 	// changes the metaColumnsSQL, adds columns: attnum[6]
+ 	}
+ 	
++	function __construct()
++	{
++	// changes the metaColumnsSQL, adds columns: attnum[6]
++	}
++	
+ 	function ServerInfo()
+ 	{
+ 		if (isset($this->version)) return $this->version;
diff --git a/databases/phppgadmin/files/patch-all_db.php b/databases/phppgadmin/files/patch-all_db.php
new file mode 100644
index 000000000000..a2f8dbd52592
--- /dev/null
+++ b/databases/phppgadmin/files/patch-all_db.php
@@ -0,0 +1,11 @@
+--- all_db.php.orig	2020-11-07 06:09:12 UTC
++++ all_db.php
+@@ -199,7 +199,7 @@
+ 		echo "\t\t<td class=\"data1\">\n";
+ 		echo "\t\t\t<select name=\"formEncoding\">\n";
+ 		echo "\t\t\t\t<option value=\"\"></option>\n";
+-		while (list ($key) = each ($data->codemap)) {
++		foreach ($data->codemap as $key => $value) {
+ 		    echo "\t\t\t\t<option value=\"", htmlspecialchars($key), "\"",
+ 				($key == $_POST['formEncoding']) ? ' selected="selected"' : '', ">",
+ 				$misc->printVal($key), "</option>\n";