* (bug 14392) Fix regression breaking table prefix in installer

Problem was a second DBprefix field in the installer, for the MS SQL-specific options.
This second field would be blank, overwriting the first submission from the MySQL-specific section.
Have renamed that field to DBprefix2, so it won't conflict.
Haven't tested on MSSQL of course. . . ;)
This commit is contained in:
Brion Vibber 2008-06-09 21:42:54 +00:00
parent fd34708d02
commit 10deba116d

View file

@ -612,6 +612,11 @@ print "<li style='font-weight:bold;color:green;font-size:110%'>Environment check
## SQLite specific
$conf->SQLiteDataDir = importPost( "SQLiteDataDir", "" );
## MSSQL specific
// We need a second field so it doesn't overwrite the MySQL one
$conf->DBprefix2 = importPost( "DBprefix2" );
/* Check for validity */
$errs = array();
@ -767,6 +772,11 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
$wgDBmwschema = $conf->DBmwschema;
$wgDBts2schema = $conf->DBts2schema;
if( $conf->DBprefix2 != '' ) {
// For MSSQL
$wgDBprefix = $conf->DBprefix2;
}
$wgCommandLineMode = true;
if (! defined ( 'STDERR' ) )
define( 'STDERR', fopen("php://stderr", "wb"));
@ -1459,7 +1469,7 @@ if( count( $errs ) ) {
<?php database_switcher('mssql'); ?>
<div class="config-input"><?php
aField( $conf, "DBprefix", "Database table prefix:" );
aField( $conf, "DBprefix2", "Database table prefix:" );
?></div>
<div class="config-desc">
<p>If you need to share one database between multiple wikis, or
@ -1632,6 +1642,10 @@ function writeLocalSettings( $conf ) {
$dbsettings =
"# SQLite-specific settings
\$wgSQLiteDataDir = \"{$slconf['SQLiteDataDir']}\";";
} elseif( $conf->DBtype == 'mssql' ) {
$dbsettings =
"# MSSQL specific settings
\$wgDBprefix = \"{$slconf['DBprefix2']}\";";
} else {
// ummm... :D
$dbsettings = '';