Comments (11)
Hmm, these changes were enough for me to make everything work:
--- a/all_db.php 2020-11-07 09:09:12.000000000 +0300
+++ b/all_db.php 2021-03-08 17:44:57.760262808 +0300
@@ -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";
--- a/libraries/adodb/drivers/adodb-postgres64.inc.php 2020-11-07 09:09:12.000000000 +0300
+++ b/libraries/adodb/drivers/adodb-postgres64.inc.php 2021-03-08 08:08:31.886314599 +0300
@@ -122,6 +122,11 @@
// 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;
Php8 no longer uses each
. Also, the classes no longer use the name of the constructor that is the same as the name of the class.
The ADOConnection class must be virtual, i.e. it should only be inherited, so it was not very good to remove this check from the class, as it was done in the new adodb:
die('Virtual Class -- cannot instantiate');
In a class that inherits from the ADOConnection class, you just need to override the constructor. It seems that the author's idea was simply not understood and was deleted.
from phppgadmin.
Hmm, these changes were enough for me to make everything work:
--- a/all_db.php 2020-11-07 09:09:12.000000000 +0300 +++ b/all_db.php 2021-03-08 17:44:57.760262808 +0300 @@ -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"; --- a/libraries/adodb/drivers/adodb-postgres64.inc.php 2020-11-07 09:09:12.000000000 +0300 +++ b/libraries/adodb/drivers/adodb-postgres64.inc.php 2021-03-08 08:08:31.886314599 +0300 @@ -122,6 +122,11 @@ // 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;
Php8 no longer uses
each
. Also, the classes no longer use the name of the constructor that is the same as the name of the class. The ADOConnection class must be virtual, i.e. it should only be inherited, so it was not very good to remove this check from the class, as it was done in the new adodb:die('Virtual Class -- cannot instantiate');
In a class that inherits from the ADOConnection class, you just need to override the constructor. It seems that the author's idea was simply not understood and was deleted.
RESUME:
- Change 1:
- because of php 8 policy > not available each use > foreach instead.
- FILE: Root of tree Phppgadmin >>> File : all_db.php
- CHANGE : LINE 202 complete sentence ... (list ($key) = each ($data->codemap)) { “ ...
TO foreach ($data->codemap as $key => $value) {”
- Change 2:
- because of php 8 policy > **not available **same name: constructor = class **** use > __constructor instead.
- FILE: libraries/adodb/drivers >>> File : adbodb-postgres64inc.php
- CHANGE: LINE 120 function ADODB_postgres64() to function __construct()
BASICALLY
from phppgadmin.
It seems like this project is abandoned. At least no PRs were accepted yet to resolve this issue. I have created my own fork to support PHP 8.2 https://github.com/vldmitrofanov/phppgadmin-php8 as a temporary solution
from phppgadmin.
Hi @vldmitrofanov . I've been using the phpPgAdmin fork at https://github.com/ReimuHakurei/phpPgAdmin for the last year or so, and it has been working fine using PHP 8.1.x.
from phppgadmin.
This is entirely dependent on "someone" testing with php8 and then submitting fixes that work in a way that is compatible with 7.3+. We've had 1 PR so far, but it has issues and hasn't been tested, so there would seem to be some work to do.
TLDR; there is no ETA at this time.
from phppgadmin.
I ran phppgadmin successfully with PHP 8:
- Using #126 to stop using each()
- Upgrading adodb (just replace libraries/adodb by upstream library at https://github.com/ADOdb/ADOdb/. I tried successfully versions 5.20.19 and 5.21.1-beta1)
- If using adodb 5.21, use #125 to update the way to get PG version. #125 also work with 5.20.19.
- I had to change hasSequencePrivilege() function to have the regression test work, see #127. Most people won't see the difference.
I uploaded the result to Debian, FYI.
from phppgadmin.
I tried @nirgal 's solution and it works PERFECTLY !!!
Thank you very much !
from phppgadmin.
Created a pull request for PHP8 support. Incorporated all the changes mentioned by @nirgal .
Relevant ADOdb files updated in the libraries folder
from phppgadmin.
The above patch seems to work with FreeBSD/PHP 8.0.
from phppgadmin.
A few PRs have been added here that allow you to work with php8. But it just doesn't look like any of them will be merged. Large changes should be described, or divided into smaller commits. Otherwise it's hard to understand the code for mergeing PR.
from phppgadmin.
Just to mention: there's an apparently popular hack (not sure if this is related): https://stackoverflow.com/a/65891974/1547831
from phppgadmin.
Related Issues (20)
- Add a tool that can help users quickly try this app?
- Version of PostgreSQL not supported. Please upgrade to version or later. HOT 1
- CVE-2021-3850 - Authentication Bypass in PostgreSQL connections
- Is phpPGadmin also affected by CVE-2022-0813 HOT 1
- Can't run
- PHP8 issue:
- phpPgAdmin 7.13.0 - COPY FROM PROGRAM Command Execution (Authenticated) HOT 1
- Two issues with php8 and postgreslq13 - Deprecated: Function pg_cmdtuples() and Virtual class error HOT 2
- Not able to edit or delete data or rows HOT 8
- CVE-2020-11022,CVE-2020-11023: JQuery 1.2 < 3.5.0 Multiple XSS HOT 4
- Add support for Postgres 15 HOT 5
- Import csv file generates a warning HOT 2
- PHP 8.2 Error deprecated HOT 9
- Can't login with created user HOT 1
- PhpPgAdmin2: forked from ReimaHakurei. Contributors needed! HOT 12
- Login form needs to allow to specify database name
- Tables not showing in left frame after successful log in
- Critical Vulnerability that may lead to Remote Code Execution HOT 4
- psql 16.x not supported HOT 3
- install error Forbidden HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phppgadmin.