From: Tim Starling Date: Sun, 18 Jan 2004 10:39:36 +0000 (+0000) Subject: Fixed recent bugs X-Git-Tag: 1.3.0beta1~1137 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=114ca8a14689b5f76ac612854542f9dd641bc7f1;p=lhc%2Fweb%2Fwiklou.git Fixed recent bugs --- diff --git a/includes/Database.php b/includes/Database.php index 8e6282e345..d98715cc83 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -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 ) { diff --git a/install.php b/install.php index 03e51050e8..21c1debce2 100644 --- a/install.php +++ b/install.php @@ -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";