'config-extensions-help' => 'The extensions listed above were detected in your <code>./extensions</code> directory.
They may require additional configuration, but you can enable them now',
- 'config-install-step-done' => 'Done',
- 'config-install-step-failed' => 'Failed',
+ 'config-install-alreadydone' => "'''Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
+ 'config-install-step-done' => 'done',
+ 'config-install-step-failed' => 'failed',
'config-install-extensions' => 'Including extensions',
'config-install-database' => 'Setting up database',
'config-install-pg-schema-failed' => 'Tables creation failed.
'config-install-user' => 'Creating database user',
'config-install-user-failed' => 'Granting permission to user "$1" failed: $2',
'config-install-tables' => 'Creating tables',
+ 'config-install-tables-exist' => "'''Warning''': MediaWiki tables seem to already exist. Skipping creation",
+ 'config-install-tables-failed' => "'''Error''': Table creation failed with the following error $1",
'config-install-interwiki' => 'Populating default interwiki table',
'config-install-interwiki-sql' => 'Could not find file <code>interwiki.sql</code>',
+ 'config-install-interwiki-exists' => "'''Warning''': Interwiki table seems to already have entires. Skipping default list",
'config-install-secretkey' => 'Generating secret key',
'config-insecure-secretkey' => "'''Warning:''' Unable to create secure <code>\$wgSecretKey</code>.
Consider changing it manually.",
'_SafeMode' => false,
'_RaiseMemory' => false,
'_UpgradeDone' => false,
+ '_InstallDone' => false,
'_Caches' => array(),
'_InstallUser' => 'root',
'_InstallPassword' => '',
if( !$status->isOk() )
break;
}
+ $this->setVar( '_InstallDone', true );
return $installResults;
}
return $status;
}
$this->db->selectDB( $this->getVar( 'wgDBname' ) );
+
+ if( $this->db->selectRow( 'interwiki', '*', array(), __METHOD__ ) ) {
+ $status->warning( 'config-install-interwiki-exists' );
+ return $status;
+ }
global $IP;
$rows = file( "$IP/maintenance/interwiki.list",
FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES );
$db = $this->getVar( 'wgDBname' );
$this->db->selectDB( $db );
$error = $this->db->sourceFile( "$IP/maintenance/users.sql" );
- if ( !$error ) {
+ if ( $error !== true ) {
$status->fatal( 'config-install-user-failed', $this->getVar( 'wgDBuser' ), $error );
}
return $status;
}
$this->db->selectDB( $this->getVar( 'wgDBname' ) );
- if ( !$this->db->sourceFile( "$IP/maintenance/tables.sql" ) ) {
- //@todo
+
+ if( $this->db->tableExists( 'user' ) ) {
+ $status->warning( 'config-install-tables-exist' );
+ return $status;
+ }
+
+ $error = $this->db->sourceFile( "$IP/maintenance/tables.sql" );
+ if( $error !== true ) {
+ $status->fatal( 'config-install-tables-failed', $error );
}
- return Status::newGood();
+ return $status;
}
function getTableOptions() {
function execute() {
if( $this->parent->request->wasPosted() ) {
return 'continue';
+ } elseif( $this->getVar( '_InstallDone' ) ) {
+ $this->startForm();
+ $status = new Status();
+ $status->warning( 'config-install-alreadydone' );
+ $this->parent->showStatusBox( $status );
+ $this->endForm();
+ return true;
+ } else {
+ $this->startForm();
+ $this->addHTML("<ul>");
+ $this->parent->performInstallation(
+ array( $this, 'startStage'),
+ array( $this, 'endStage' )
+ );
+ $this->addHTML("</ul>");
+ $this->endForm();
+ return true;
}
- $this->startForm();
- $this->addHTML("<ul>");
- $this->parent->performInstallation(
- array( $this, 'startStage'),
- array( $this, 'endStage' )
- );
- $this->addHTML("</ul>");
- $this->endForm();
- return true;
}