'serverless' => true
);
-$ourdb['mssql'] = array(
- 'fullname' => 'MSSQL',
- 'havedriver' => 0,
- 'compile' => 'mssql_not_ready', # Change to 'mssql' after includes/DatabaseMssql.php added;
- 'bgcolor' => '#ffc0cb',
- 'rootuser' => 'administrator',
- 'serverless' => false
-);
-
$ourdb['ibm_db2'] = array(
'fullname' => 'DB2',
'havedriver' => 0,
$phpdatabases = array();
foreach (array_keys($ourdb) as $db) {
$compname = $ourdb[$db]['compile'];
- if( extension_loaded( $compname ) || ( mw_have_dl() && dl( "{$compname}." . PHP_SHLIB_SUFFIX ) ) ) {
+ if( wfDl( $compname ) ) {
array_push($phpdatabases, $db);
$ourdb[$db]['havedriver'] = 1;
}
$conf->DBtype = $DefaultDBtype;
}
- $conf->DBserver = importPost( "DBserver", "localhost" );
- $conf->DBname = importPost( "DBname", "wikidb" );
- $conf->DBuser = importPost( "DBuser", "wikiuser" );
+ $conf->DBserver = importPost( "DBserver", $wgDBserver );
+ $conf->DBname = importPost( "DBname", $wgDBname );
+ $conf->DBuser = importPost( "DBuser", $wgDBuser );
$conf->DBpassword = importPost( "DBpassword" );
$conf->DBpassword2 = importPost( "DBpassword2" );
$conf->SysopName = importPost( "SysopName", "WikiSysop" );
importPost( "DBengine", "InnoDB" ) );
## Postgres specific:
- $conf->DBport = importPost( "DBport", "5432" );
+ $conf->DBport = importPost( "DBport", $wgDBport );
$conf->DBts2schema = importPost( "DBts2schema", "public" );
$conf->DBpgschema = importPost( "DBpgschema", "mediawiki" );
## SQLite specific
$conf->SQLiteDataDir = importPost( "SQLiteDataDir", "$IP/../data" );
- ## MSSQL specific
- // We need a second field so it doesn't overwrite the MySQL one
- $conf->DBprefix2 = importPost( "DBprefix2" );
-
## DB2 specific:
// New variable in order to have a different default port number
$conf->DBport_db2 = importPost( "DBport_db2", "50000" );
$wgDBmwschema = $conf->DBdb2schema;
}
- if( $conf->DBprefix2 != '' ) {
- // For MSSQL
- $wgDBprefix = $conf->DBprefix2;
- } elseif( $conf->DBprefix_ora != '' ) {
+ if( $conf->DBprefix_ora != '' ) {
// For Oracle
$wgDBprefix = $conf->DBprefix_ora;
}
if ($wgDatabase->isOpen()) {
$wgDBOracleDefTS = $conf->DBdefTS_ora;
$wgDBOracleTempTS = $conf->DBtempTS_ora;
- $wgDatabase->sourceFile( "../maintenance/ora/user.sql" );
+ $res = $wgDatabase->sourceFile( "../maintenance/ora/user.sql" );
+ if ($res !== true) dieout($res);
} else {
echo "<li>Invalid database superuser, please supply a valid superuser account.</li>";
echo "<li>ERR: ".print_r(oci_error(), true)."</li>";
## Possible connect as a superuser
// Changed !mysql to postgres check since it seems to only apply to postgres
if( $useRoot && $conf->DBtype == 'postgres' ) {
- $wgDBsuperuser = $conf->RootUser;
echo( "<li>Attempting to connect to database \"postgres\" as superuser \"" .
- htmlspecialchars( $wgDBsuperuser ) . "\"..." );
- $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBsuperuser, $conf->RootPW, "postgres", 1);
+ htmlspecialchars( $conf->RootUser ) . "\"..." );
+ $wgDatabase = $dbc->newFromParams($wgDBserver, $conf->RootUser, $conf->RootPW, "postgres", 1);
if (!$wgDatabase->isOpen()) {
print " error: " . htmlspecialchars( $wgDatabase->lastError() ) . "</li>\n";
$errs["DBserver"] = "Could not connect to database as superuser";
$errs["RootPW"] = "and password";
continue;
}
- $wgDatabase->initial_setup($conf->RootPW, 'postgres');
+ $wgDatabase->initial_setup($conf->RootUser, $conf->RootPW, 'postgres');
}
echo( "<li>Attempting to connect to database \"" . htmlspecialchars( $wgDBname ) .
"\" as \"" . htmlspecialchars( $wgDBuser ) . "\"..." );
print " <b class='error'>If the next step fails, see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'>http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b>";
}
print "</li>\n";
- $wgDatabase->sourceFile( "../maintenance/users.sql" );
+ $res = $wgDatabase->sourceFile( "../maintenance/users.sql" );
+ if ($res !== true) dieout($res);
}
}
}
}
}
- # FIXME: Check for errors
print "<li>Creating tables...";
if ($conf->DBtype == 'mysql') {
- $wgDatabase->sourceFile( "../maintenance/tables.sql" );
- $wgDatabase->sourceFile( "../maintenance/interwiki.sql" );
+ $res = $wgDatabase->sourceFile( "../maintenance/tables.sql" );
+ if ($res === true) {
+ print " done.</li>\n<li>Populating interwiki table... \n";
+ $res = $wgDatabase->sourceFile( "../maintenance/interwiki.sql" );
+ }
+ if ($res === true) {
+ print " done.</li>\n";
+ } else {
+ print " <b>FAILED</b></li>\n";
+ dieout( htmlspecialchars( $res ) );
+ }
} elseif (is_callable(array($wgDatabase, 'setup_database'))) {
$wgDatabase->setup_database();
}
continue;
}
- print " done.</li>\n";
-
if ( $conf->DBtype == 'ibm_db2' ) {
// Now that table creation is done, make sure everything is committed
} else {
# Yes, so run the grants
echo( "<li>" . htmlspecialchars( "Granting user permissions to $wgDBuser on $wgDBname..." ) );
- $wgDatabase->sourceFile( "../maintenance/users.sql" );
- echo( "success.</li>\n" );
+ $res = $wgDatabase->sourceFile( "../maintenance/users.sql" );
+ if ( $res === true ) {
+ echo( " success.</li>\n" );
+ } else {
+ echo( " <b>FAILED</b>.</li>\n" );
+ dieout( $res );
+ }
}
}
$localSettings = str_replace( "\r\n", "\n", $localSettings );
$f = fopen( "LocalSettings.php", 'xt' );
- if( $f == false ) {
+ if( !$f ) {
print( "</li>\n" );
dieout( "<p>Couldn't write out LocalSettings.php. Check that the directory permissions are correct and that there isn't already a file of that name here...</p>\n" .
"<p>Here's the file that would have been written, try to paste it into place manually:</p>\n" .
<label class='column'>E-mail notification about changes:</label>
<ul class="plain">
<li><?php aField( $conf, "Enotif", "Disabled", "radio", "enotif_disabled" ); ?></li>
- <li><?php aField( $conf, "Enotif", "Enabled for changes to user discussion pages only", "radio", "enotif_usertalk" ); ?></li>
- <li><?php aField( $conf, "Enotif", "Enabled for changes to user discussion pages, and to pages on watchlists (not recommended for large wikis)", "radio", "enotif_allpages" ); ?></li>
+ <li><?php aField( $conf, "Enotif", "Changes to user discussion pages only", "radio", "enotif_usertalk" ); ?></li>
+ <li><?php aField( $conf, "Enotif", "Changes to user discussion pages, and to pages on watchlists (not recommended for large wikis)", "radio", "enotif_allpages" ); ?></li>
</ul>
</div>
<div class="config-desc">
<div class="config-input">
<label class="column">Superuser account:</label>
<input type="checkbox" name="useroot" id="useroot" <?php if( $useRoot ) { ?>checked="checked" <?php } ?> />
- <label for="useroot">Use superuser account</label>
+  <label for="useroot">Use superuser account</label>
</div>
<div class="config-input"><?php aField( $conf, "RootUser", "Superuser name:", "text" ); ?></div>
<div class="config-input"><?php aField( $conf, "RootPW", "Superuser password:", "password" ); ?></div>
</div>
</fieldset>
- <?php database_switcher('mssql'); ?>
- <div class="config-input"><?php
- aField( $conf, "DBprefix2", "Database table prefix:" );
- ?></div>
- <div class="config-desc">
- <p>If you need to share one database between multiple wikis, or
- between MediaWiki and another web application, you may choose to
- add a prefix to all the table names to avoid conflicts.</p>
-
- <p>Avoid exotic characters; something like <tt>mw_</tt> is good.</p>
- </div>
- </fieldset>
-
<?php database_switcher('ibm_db2'); ?>
<div class="config-input"><?php
aField( $conf, "DBport_db2", "Database port:" );
</fieldset>
<div class="config-input" style="padding:2em 0 3em">
- <label class='column'> </label>
+ <label class='column'> </label>
<input type="submit" value="Install MediaWiki!" class="btn-install" />
</div>
</div>
$dbsettings =
"# SQLite-specific settings
\$wgSQLiteDataDir = \"{$sqliteDataDir}\";";
- } elseif( $conf->DBtype == 'mssql' ) {
- $dbsettings =
-"# MSSQL specific settings
-\$wgDBprefix = \"{$slconf['DBprefix2']}\";";
} elseif( $conf->DBtype == 'ibm_db2' ) {
$dbsettings =
"# DB2 specific settings
} elseif( $conf->DBtype == 'oracle' ) {
$dbsettings =
"# Oracle specific settings
-\$wgDBprefix = \"{$slconf['DBprefix']}\";";
+\$wgDBprefix = \"{$slconf['DBprefix_ora']}\";";
} else {
// ummm... :D
$dbsettings = '';
return false;
}
-function wfArrayMap( $function, $input ) {
- $ret = array_map( $function, $input );
- foreach ( $ret as $key => $value ) {
- $taint = istainted( $input[$key] );
- if ( $taint ) {
- taint( $ret[$key], $taint );
- }
- }
- return $ret;
-}
-
?>
<div class="license">
<li><a href="http://www.mediawiki.org/wiki/Manual:Contents">Administrator's Guide</a></li>
<li><a href="http://www.mediawiki.org/wiki/Manual:FAQ">FAQ</a></li>
</ul>
- <p style="font-size:90%;margin-top:1em">MediaWiki is Copyright © 2001-2009 by Magnus Manske, Brion Vibber,
+ <p style="font-size:90%;margin-top:1em">MediaWiki is Copyright © 2001-2010 by Magnus Manske, Brion Vibber,
Lee Daniel Crocker, Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason, Niklas Laxström,
Domas Mituzas, Rob Church, Yuri Astrakhan, Aryeh Gregor, Aaron Schulz and others.</p>
</div></div>