Typo, minor rearrangements,
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 14 Mar 2007 16:34:50 +0000 (16:34 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 14 Mar 2007 16:34:50 +0000 (16:34 +0000)
includes/DatabasePostgres.php

index d945e1d..3c0a094 100644 (file)
@@ -61,9 +61,12 @@ class DatabasePostgres extends Database {
                        throw new DBConnectionError( $this, "Postgres functions missing, have you compiled PHP with the --with-pgsql option?\n (Note: if you recently installed PHP, you may need to restart your webserver and database)\n" );
                }
 
-
                global $wgDBport;
 
+               if (!strlen($user)) { ## e.g. the class is being loaded
+                       return;
+               }
+
                $this->close();
                $this->mServer = $server;
                $port = $wgDBport;
@@ -79,9 +82,6 @@ class DatabasePostgres extends Database {
                        $hstring .= "port=$port ";
                }
 
-               if (!strlen($user)) { ## e.g. the class is being loaded
-                       return;
-               }
 
                error_reporting( E_ALL );
                @$this->mConn = pg_connect("$hstring dbname=$dbName user=$user password=$password");
@@ -230,7 +230,8 @@ class DatabasePostgres extends Database {
 
                                $wgDBsuperuser = '';
                                return true; ## Reconnect as regular user
-                       }
+
+                       } ## end superuser
 
                if (!defined('POSTGRES_SEARCHPATH')) {
 
@@ -788,7 +789,7 @@ class DatabasePostgres extends Database {
                return $type;
        }
 
-       function begin( $fname = 'DatabasePostgrs::begin' ) {
+       function begin( $fname = 'DatabasePostgres::begin' ) {
                $this->query( 'BEGIN', $fname );
                $this->mTrxLevel = 1;
        }