<p>Afterwards retry to start the <a href=\"\">setup</a>.</p>" );
}
-
-require_once( "$IP/maintenance/updaters.inc" );
-
class ConfigData {
function getEncoded( $data ) {
# removing latin1 support, no need...
$conf->SQLiteDataDir = importPost( "SQLiteDataDir", "$IP/../data" );
## DB2 specific:
- // New variable in order to have a different default port number
$conf->DBport_db2 = importPost( "DBport_db2", "50000" );
- $conf->DBcataloged = importPost( "DBcataloged", "cataloged" );
$conf->DBdb2schema = importPost( "DBdb2schema", "mediawiki" );
// Oracle specific
}
## DB2 specific:
- $wgDBcataloged = $conf->DBcataloged;
+ if ( $conf->DBtype == 'ibm_db2' ) {
+ $wgDBport = $conf->DBport_db2;
+ }
$wgCommandLineMode = true;
if (! defined ( 'STDERR' ) )
if( !$ok ) { continue; }
}
else if ( $conf->DBtype == 'mssql' ) {
- error_reporting( E_ALL );
- $wgSuperUser = '';
- # # Possible connect as a superuser
+ # Possible connect as a superuser
if ( $useRoot ) {
- $wgDBsuperuser = $conf->RootUser;
- echo( "<li>Attempting to connect to database \"{$conf->DBtype}\" as superuser \"{$wgDBsuperuser}\"" );
+ echo( "<li>Attempting to connect to database \"{$conf->DBtype}\" as superuser \"{$conf->RootUser}\"" );
$wgDatabase = $dbc->newFromParams(
$conf->DBserver,
$conf->RootUser,
$errs['RootPW'] = 'and password';
continue;
}
- $wgDatabase->initial_setup( $conf->RootPW, $conf->DBtype );
+ $wgDatabase->initial_setup( $conf->DBname, $conf->DBuser, $conf->DBpassword );
}
echo( "<li>Attempting to connect to database \"{$wgDBname}\" as \"{$wgDBuser}\"..." );
$wgDatabase = $dbc->newFromParams(
echo "<li>Connect failed.</li>";
if ($useRoot) {
if (ini_get('oci8.privileged_connect') === false) {
- echo "<li>Privileged connect disabled, please set oci8.privileged_connect or run maintenance/ora/user.sql script manually prior to continuing.</li>";
+ echo "<li>Privileged connect disabled, please set oci8.privileged_connect or run maintenance/oracle/user.sql script manually prior to continuing.</li>";
$ok = false;
} else {
$wgDBadminuser = $conf->RootUser;
if ($wgDatabase->isOpen()) {
$wgDBOracleDefTS = $conf->DBdefTS_ora;
$wgDBOracleTempTS = $conf->DBtempTS_ora;
- $res = $wgDatabase->sourceFile( "../maintenance/ora/user.sql" );
+ $res = $wgDatabase->sourceFile( "../maintenance/oracle/user.sql" );
if ($res !== true) dieout($res);
} else {
echo "<li>Invalid database superuser, please supply a valid superuser account.</li>";
}
} else { # not mysql
error_reporting( E_ALL | E_STRICT );
- $wgSuperUser = '';
## Possible connect as a superuser
// Changed !mysql to postgres check since it seems to only apply to postgres
if( $useRoot && $conf->DBtype == 'postgres' ) {
print "</ul><pre>\n";
chdir( ".." );
flush();
- do_all_updates();
+
+ $updater = DatabaseUpdater::newForDb( $wgDatabase, false );
+ $updater->doUpdates();
+ foreach( $updater->getPostDatabaseUpdateMaintenance() as $maint ) {
+ call_user_func_array( array( new $maint, 'execute' ), array() );
+ }
+
chdir( "config" );
print "</pre>\n";
print "<ul><li>Finished update checks.</li>\n";
if ( $conf->DBtype == 'mysql' && version_compare( $myver, "4.1.2", "ge" ) ) {
$res = $wgDatabase->query( 'SHOW ENGINES' );
$found = false;
- while ( $row = $wgDatabase->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( $row->Engine == $conf->DBengine && ( $row->Support == 'YES' || $row->Support == 'DEFAULT' ) ) {
$found = true;
break;
}
}
- $wgDatabase->freeResult( $res );
if ( !$found && $conf->DBengine != 'MyISAM' ) {
echo "<li><strong>Warning:</strong> " . htmlspecialchars( $conf->DBengine ) .
" storage engine not available, " .
}
?>
<ul class='plain'><?php
- database_picker($conf);
+ database_picker($ourdb, $conf);
?></ul>
</div>
</p>
</div>
- <?php database_switcher('mysql'); ?>
+ <?php database_switcher($ourdb, 'mysql'); ?>
<div class="config-input"><?php aField( $conf, "DBprefix", "Database table prefix:" ); ?></div>
<div class="config-desc">
<p>If you need to share one database between multiple wikis, or
</p>
</fieldset>
- <?php database_switcher('postgres'); ?>
+ <?php database_switcher($ourdb, 'postgres'); ?>
<div class="config-input"><?php aField( $conf, "DBport", "Database port:" ); ?></div>
<div class="config-input"><?php aField( $conf, "DBpgschema", "Schema for mediawiki:" ); ?></div>
<div class="config-input"><?php aField( $conf, "DBts2schema", "Schema for tsearch2:" ); ?></div>
</div>
</fieldset>
- <?php database_switcher('sqlite'); ?>
+ <?php database_switcher($ourdb, 'sqlite'); ?>
<div class="config-input"><?php
aField( $conf, "SQLiteDataDir", "SQLite data directory:" );
?></div>
</fieldset>
- <?php database_switcher( 'mssql' ); ?>
+ <?php database_switcher($ourdb, 'mssql' ); ?>
<div class="config-desc">
<p>No MS SQL Server specific options at this time.</p>
</div>
+ </fieldset>
- <?php database_switcher('ibm_db2'); ?>
+ <?php database_switcher($ourdb, 'ibm_db2'); ?>
<div class="config-input"><?php
aField( $conf, "DBport_db2", "Database port:" );
?></div>
+ <div class="config-desc">
+ <p>50000 is the usual DB2 port.</p>
+ </div>
<div class="config-input"><?php
aField( $conf, "DBdb2schema", "Schema for mediawiki:" );
?></div>
- <div>Select one:</div>
- <ul class="plain">
- <li><?php aField( $conf, "DBcataloged", "Cataloged (DB2 installed locally)", "radio", "cataloged" ); ?></li>
- <li><?php aField( $conf, "DBcataloged", "Uncataloged (remote DB2 through ODBC)", "radio", "uncataloged" ); ?></li>
- </ul>
<div class="config-desc">
<p>If you need to share one database between multiple wikis, or
between MediaWiki and another web application, you may specify
</div>
</fieldset>
- <?php database_switcher('oracle'); ?>
+ <?php database_switcher($ourdb, 'oracle'); ?>
<div class="config-input"><?php aField( $conf, "DBprefix_ora", "Database table prefix:" ); ?></div>
<div class="config-desc">
<p>If you need to share one database between multiple wikis, or
"# SQLite-specific settings
\$wgSQLiteDataDir = \"{$sqliteDataDir}\";";
} elseif( $conf->DBtype == 'ibm_db2' ) {
- $dbsettings =
-"# DB2 specific settings
-\$wgDBport = \"{$slconf['DBport_db2']}\";
-\$wgDBmwschema = \"{$slconf['DBdb2schema']}\";
-\$wgDBcataloged = \"{$slconf['DBcataloged']}\";";
+ $dbsettings = <<<MULTILINE
+# DB2 specific settings
+\$wgDBport = "{$slconf['DBport_db2']}";
+\$wgDBmwschema = "{$slconf['DBdb2schema']}";
+MULTILINE;
} elseif( $conf->DBtype == 'oracle' ) {
$dbsettings =
"# Oracle specific settings
$id = $field;
$nolabel = ($type == "radio") || ($type == "hidden");
- if ($type == 'radio')
+ if ($type == 'radio') {
$id .= $radioCount++;
+ }
if( !$nolabel ) {
echo "<label class='column' for=\"$id\">$text</label>";
return $errstr;
}
-function database_picker($conf) {
- global $ourdb;
+function database_picker($ourdb, $conf) {
print "\n";
foreach(array_keys($ourdb) as $db) {
if ($ourdb[$db]['havedriver']) {
print "\n\t";
}
-function database_switcher($db) {
- global $ourdb;
+function database_switcher($ourdb, $db) {
$color = $ourdb[$db]['bgcolor'];
$full = $ourdb[$db]['fullname'];
print "<fieldset id='$db' style='clear:both'><legend>$full-specific options</legend>\n";