Jjanes has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/156350

Change subject: PostgreSQL: Fix Installer
......................................................................

PostgreSQL: Fix Installer

Commit 30a82aae changed openConnectionToAnyDB to use a different
constructor, which returned a Status rather than a Connection. But
the rest of the code was not adapted to this.  In particular, it
would stuff the resuling Status into the Connection slot of a new
Status object, yielding an incorrectly nested object.

Bug: 70030
Change-Id: Ib9dca3a25f81551fe1f088934f8d607b5cd6224b
---
M includes/installer/PostgresInstaller.php
1 file changed, 3 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/50/156350/1

diff --git a/includes/installer/PostgresInstaller.php 
b/includes/installer/PostgresInstaller.php
index 6dcce23..2291cbd 100644
--- a/includes/installer/PostgresInstaller.php
+++ b/includes/installer/PostgresInstaller.php
@@ -258,29 +258,22 @@
                if ( !in_array( $this->getVar( 'wgDBname' ), $dbs ) ) {
                        array_unshift( $dbs, $this->getVar( 'wgDBname' ) );
                }
-               $conn = false;
-               $status = Status::newGood();
                foreach ( $dbs as $db ) {
                        try {
-                               $conn = $this->openConnectionWithParams(
+                               $status = $this->openConnectionWithParams(
                                        $user,
                                        $password,
                                        $db,
                                        $this->getVar( 'wgDBmwschema' ) );
                        } catch ( DBConnectionError $error ) {
-                               $conn = false;
                                $status->fatal( 'config-pg-test-error', $db,
                                        $error->getMessage() );
                        }
-                       if ( $conn !== false ) {
+                       if ( $status->isOK() ) {
                                break;
                        }
                }
-               if ( $conn !== false ) {
-                       return Status::newGood( $conn );
-               } else {
-                       return $status;
-               }
+               return $status;
        }
 
        protected function getInstallUserPermissions() {

-- 
To view, visit https://gerrit.wikimedia.org/r/156350
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9dca3a25f81551fe1f088934f8d607b5cd6224b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jjanes <jeff.ja...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to