* Followup r78450: just use selectField() instead of pg_fetch_result() with a raw...
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 27 Dec 2010 13:56:20 +0000 (13:56 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 27 Dec 2010 13:56:20 +0000 (13:56 +0000)
* Remove useless isset() check, this will always be set with some default in DefaultSettings.php

includes/installer/DatabaseUpdater.php
includes/installer/PostgresUpdater.php

index 7af63d9..c0c3d47 100644 (file)
@@ -26,6 +26,11 @@ abstract class DatabaseUpdater {
 
        protected $extensionUpdates = array();
 
+       /**
+        * Handle to the database subclass
+        *
+        * @var DatabaseBase
+        */
        protected $db;
 
        protected $shared = false;
index 629ccba..4708c19 100644 (file)
@@ -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 );