From: Chad Horohoe Date: Mon, 27 Dec 2010 13:56:20 +0000 (+0000) Subject: * Followup r78450: just use selectField() instead of pg_fetch_result() with a raw... X-Git-Tag: 1.31.0-rc.0~33063 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=a854a0efbe5deb2c731947e8242f42bc32fd6dd6;p=lhc%2Fweb%2Fwiklou.git * 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 --- 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 );