PostreSQL: DatabaseBase constructor cleanups
authorJeff Janes <jeff.janes@gmail.com>
Tue, 24 Feb 2015 03:51:29 +0000 (19:51 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 25 Feb 2015 18:27:59 +0000 (18:27 +0000)
Change I29b79a3c1bb2b5e51c1c8f5e04cd08c71e0662a3 rendered
it uninstallable on PostgreSQL.

Make the corresponding API changes to PostgreSQL installer.

Bug: T90288
Change-Id: I2019893ad705d99f3dbbce13690cd808cfb71d4a

includes/installer/PostgresInstaller.php

index e19f9aa..b18fe94 100644 (file)
@@ -262,11 +262,13 @@ class PostgresInstaller extends DatabaseInstaller {
                $status = Status::newGood();
                foreach ( $dbs as $db ) {
                        try {
-                               $conn = new DatabasePostgres(
-                                       $this->getVar( 'wgDBserver' ),
-                                       $user,
-                                       $password,
-                                       $db );
+                               $p = array(
+                                       'host' => $this->getVar( 'wgDBserver' ),
+                                       'user' => $user,
+                                       'password' => $password,
+                                       'dbname' => $db
+                               );
+                               $conn = DatabaseBase::factory( 'postgres', $p );
                        } catch ( DBConnectionError $error ) {
                                $conn = false;
                                $status->fatal( 'config-pg-test-error', $db,