Fixed recent bugs
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 18 Jan 2004 10:39:36 +0000 (10:39 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 18 Jan 2004 10:39:36 +0000 (10:39 +0000)
includes/Database.php
install.php

index 8e6282e..d98715c 100644 (file)
@@ -93,16 +93,21 @@ class Database {
                $success = false;
                
                @$this->mConn = mysql_connect( $server, $user, $password );
-               if ( $this->mConn !== false && $dbName != "" ) {
-                       $success = @mysql_select_db( $dbName, $this->mConn );
-                       if ( !$success ) {
-                               wfDebug( "Error selecting database \"$dbName\": " . $this->lastError() . "\n" );
+               if ( $dbName != "" ) {
+                       if ( $this->mConn !== false ) {
+                               $success = @mysql_select_db( $dbName, $this->mConn );
+                               if ( !$success ) {
+                                       wfDebug( "Error selecting database \"$dbName\": " . $this->lastError() . "\n" );
+                               }
+                       } else {
+                               wfDebug( "DB connect error: " . $this->lastError() . "\n" );
+                               wfDebug( "Server: $server, User: $user, Password: " . 
+                                       substr( $password, 0, 3 ) . "...\n" );
+                               $success = false;
                        }
                } else {
-                       wfDebug( "DB connect error: " . $this->lastError() . "\n" );
-                       wfDebug( "Server: $server, User: $user, Password: " . 
-                               substr( $password, 0, 3 ) . "...\n" );
-                       $success = false;
+                       # Delay USE
+                       $success = true;
                }
                
                if ( !$success ) {
index 03e5105..21c1deb 100644 (file)
@@ -108,17 +108,17 @@ print "\nYou should have already created a root password for the database.\n" .
 
 $rootpw = readconsole();
 
+# Include rest of code to get things like internationalized messages.
+#
+include_once( "{$IP}/Setup.php" );
+$wgTitle = Title::newFromText( "Installation script" );
+
 $wgDatabase = Database::newFromParams( $wgDBserver, "root", $rootpw, "", 1 );
 if ( !$wgDatabase->isOpen() ) {
        print "Could not connect to database on \"{$wgDBserver}\" as root.\n";
        exit();
 }
 
-# Include rest of code to get things like internationalized messages.
-#
-include_once( "{$IP}/Setup.php" );
-$wgTitle = Title::newFromText( "Installation script" );
-
 # Now do the actual database creation
 #
 print "Creating database...\n";