From a854a0efbe5deb2c731947e8242f42bc32fd6dd6 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 27 Dec 2010 13:56:20 +0000 Subject: [PATCH] * Followup r78450: just use selectField() instead of pg_fetch_result() with a raw doQuery() * Remove useless isset() check, this will always be set with some default in DefaultSettings.php --- includes/installer/DatabaseUpdater.php | 5 +++++ includes/installer/PostgresUpdater.php | 10 +++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 7af63d9acd..c0c3d47292 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -26,6 +26,11 @@ abstract class DatabaseUpdater { protected $extensionUpdates = array(); + /** + * Handle to the database subclass + * + * @var DatabaseBase + */ protected $db; protected $shared = false; diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 629ccba828..4708c19cf6 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -516,14 +516,10 @@ END; protected function checkPgUser() { global $wgDBmwschema, $wgDBts2schema, $wgDBuser; - # Just in case their LocalSettings.php does not have this: - if ( !isset( $wgDBmwschema ) ) { - $wgDBmwschema = 'mediawiki'; - } + $config = $this->db->selectField( + 'pg_catalog.pg_user', "array_to_string(useconfig,'*')", + array( 'usename' => $wgDBuser ), __METHOD__ ); - $safeuser = $this->db->addQuotes( $wgDBuser ); - $SQL = "SELECT array_to_string(useconfig,'*') FROM pg_catalog.pg_user WHERE usename = $safeuser"; - $config = pg_fetch_result( $this->db->query( $SQL ), 0, 0 ); $conf = array(); foreach ( explode( '*', $config ) as $c ) { list( $x, $y ) = explode( '=', $c ); -- 2.20.1