Bug 263759

Summary: databases/phppgadmin PHP 8.0 issues
Product: Ports & Packages Reporter: gessel
Component: Individual Port(s)Assignee: Dirk Meyer <dinoex>
Status: Closed FIXED    
Severity: Affects Some People Flags: dinoex: maintainer-feedback+
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description gessel 2022-05-03 18:45:32 UTC
databases/phppgadmin has issues with PHP 8.0 even though there's a 8.0 flavor. 

Login fails with "Virtual Class -- cannot instantiate" 

This has been reported - it doesn't seem FreeBSD specific: https://stackoverflow.com/questions/65299248/phppgadmin-login-fail-virtual-class-cannot-instantiate.   

(@hericklr's isn't optimal)

@ormorph proposed a patch, it seems to work:

https://github.com/phppgadmin/phppgadmin/issues/119#issuecomment-801712145

--- adodb-postgres64.inc.php.bak        2022-05-03 10:42:54.773501000 -0700
+++ adodb-postgres64.inc.php    2022-05-03 10:47:32.151320000 -0700
@@ -122,7 +122,12 @@
        // changes the metaColumnsSQL, adds columns: attnum[6]
        }
        
-       function ServerInfo()
+       function __construct()
+       {
+       // changes the metaColumnsSQL, adds columns: attnum[6]
+       }
+       
+        function ServerInfo()
        {
                if (isset($this->version)) return $this->version;

--- all_db.php.bak      2022-05-03 10:37:26.866823000 -0700
+++ all_db.php  2022-05-03 10:42:04.130932000 -0700
@@ -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";
Comment 1 Dirk Meyer freebsd_committer freebsd_triage 2022-05-04 04:49:31 UTC
looks fine,
testing if the patch is backwards compatible.
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-05-09 08:18:51 UTC
A commit in branch main references this bug:

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 +-
 .../phppgadmin/files/patch-adodb-postgres64.inc.php (new)  | 14 ++++++++++++++
 databases/phppgadmin/files/patch-all_db.php (new)          | 11 +++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)