$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 ) {
$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";