Skip to content

Merge pull request #1 from phppgadmin/master#118

Open
idontusenumbers wants to merge 7 commits intophppgadmin:masterfrom
idontusenumbers:master
Open

Merge pull request #1 from phppgadmin/master#118
idontusenumbers wants to merge 7 commits intophppgadmin:masterfrom
idontusenumbers:master

Conversation

@idontusenumbers
Copy link
Copy Markdown

Fixes #117

Running the tests looked like a lot of work so I apologize but I didn't run them (I might suggest a docker-compose based solution for running the tests that can be run in one command). Feel free to include these changes in your own commit and reject the PR.

I tested it connects and appears to function with my postgres:12-alpine container.

/**
* Set server information.
* @param $key parameter name to set, or null to replace all
* @param $key string parameter name to set, or null to replace all
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDEA/PHP Storm was complaining about the paramater types not matching "expecting the but was string" etc.

}
$this->setServerInfo('platform', $platform, $server_id);
$this->setServerInfo('pgVersion', $_connection->conn->pgVersion, $server_id);
$this->setServerInfo('pgVersion',/* $_connection->conn->pgVersion*/ "unknown version", $server_id);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable wasn't defined and I'm not sure where it ever lived. I simply removed it and phppgadmin seems to still properly report the version.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe #125 is a better fix for that one.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

*/
function __construct($host, $port, $sslmode, $user, $password, $database, $fetchMode = ADODB_FETCH_ASSOC) {
$this->conn = ADONewConnection('postgres7');
$this->conn = ADONewConnection('postgres');
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ADODb says to reference just postgres to grab the latest driver

@idontusenumbers
Copy link
Copy Markdown
Author

Most of these changes are just upgrading ADOdb; I wasn't able to identify the cause using the existing version; I saw the ADODb library was out of date and thought upgrading that would do the trick since the error was in that code.

*/
function __construct()
{
die('Virtual Class -- cannot instantiate');
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the origin of the error

@1Luc1
Copy link
Copy Markdown

1Luc1 commented Feb 15, 2021

Any update/news on this PR? Have the same issue with the following setup:

Q A
phppgadmin 7.13.0
PHP version 8.0.2
psql (PostgreSQL) 13.1
Operating system 5.10.15-1-Manjaro
nginx 1.18.0

@ormorph
Copy link
Copy Markdown

ormorph commented Mar 8, 2021

Hmm, as far as I understand this error occurs due to incorrect inheritance. The ADODB_postgres64 class inherits the ADOConnection class, but the ADODB_postgres64 class uses the obsolete name of the constructor. You just need to add a new constructor method to the ADODB_postgres64 class:

          function __construct()
          {
          //Description
          }

@ormorph
Copy link
Copy Markdown

ormorph commented Mar 8, 2021

Any update/news on this PR? Have the same issue with the following setup:
Q A
phppgadmin 7.13.0
PHP version 8.0.2
psql (PostgreSQL) 13.1
Operating system 5.10.15-1-Manjaro
nginx 1.18.0

For version 7.13.0 try using this patch.
phpPgAdmin-7.13.0-php8.patch.gz

@idontusenumbers
Copy link
Copy Markdown
Author

Hmm, as far as I understand this error occurs due to incorrect inheritance. The ADODB_postgres64 class inherits the ADOConnection class, but the ADODB_postgres64 class uses the obsolete name of the constructor. You just need to add a new constructor method to the ADODB_postgres64 class:

          function __construct()
          {
          //Description
          }

Is there any reason to have the override if it's not doing anything?

@ormorph
Copy link
Copy Markdown

ormorph commented Mar 8, 2021

Is there any reason to have the override if it's not doing anything?

Yes, of course there is. This constructor is required so that the constructor of the inherited ADOConnection class does not run. Php8 uses the new constructor name, so the old one is deprecated and not used, as a result the constructor of the virtual inherited class is run, which should not be run. Declaring a new constructor solves this problem.
The constructor of the ADOConnection class is used for validation, so that this class is not used directly, but only inherited in other classes.

@shoerofi
Copy link
Copy Markdown

Any update/news on this PR? Have the same issue with the following setup:
Q A
phppgadmin 7.13.0
PHP version 8.0.2
psql (PostgreSQL) 13.1
Operating system 5.10.15-1-Manjaro
nginx 1.18.0

For version 7.13.0 try using this patch.
phpPgAdmin-7.13.0-php8.patch.gz

works like a charm. thanks

@L34T
Copy link
Copy Markdown

L34T commented Jun 15, 2021

Why it still not merged?
ps Thanks to idontusenumbers and ormorph for this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't load tree

6 participants