From 9b9cbb420684d13701908fe10ebc8caa443f0972 Mon Sep 17 00:00:00 2001 From: Jure Kajzer Date: Mon, 25 Oct 2010 18:57:44 +0000 Subject: [PATCH] * moved installMainpage to CoreInstaller as requested in r75366 --- includes/installer/CoreInstaller.php | 21 +++++++++++++++++++++ includes/installer/DatabaseInstaller.php | 21 --------------------- includes/installer/Installer.php | 11 ----------- 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/includes/installer/CoreInstaller.php b/includes/installer/CoreInstaller.php index 2024418fe2..7d604b3f8e 100644 --- a/includes/installer/CoreInstaller.php +++ b/includes/installer/CoreInstaller.php @@ -432,6 +432,27 @@ abstract class CoreInstaller extends Installer { return Status::newGood(); } + /** + * Insert Main Page with default content. + * + * @return Status + */ + public function installMainpage( DatabaseInstaller &$installer ) { + $status = Status::newGood(); + try { + $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) ); + $article = new Article( $titleobj ); + $article->doEdit( wfMsg( 'mainpagetext' ) . "\n\n" . wfMsgNoTrans( 'mainpagedocfooter' ), + '', + EDIT_NEW ); + } catch (MWException $e) { + //using raw, because $wgShowExceptionDetails can not be set yet + $status->fatal( 'config-install-mainpage-failed', $e->getMessage() ); + } + + return $status; + } + /** * Override the necessary bits of the config to run an installation. */ diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index a1f9c9332f..b63749520e 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -136,27 +136,6 @@ abstract class DatabaseInstaller { return $status; } - /** - * Insert Main Page with default content. - * - * @return Status - */ - public function createMainpage() { - $status = Status::newGood(); - try { - $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) ); - $article = new Article( $titleobj ); - $article->doEdit( wfMsg( 'mainpagetext' ) . "\n\n" . wfMsgNoTrans( 'mainpagedocfooter' ), - '', - EDIT_NEW ); - } catch (MWException $e) { - //using raw, because $wgShowExceptionDetails can not be set yet - $status->fatal( 'config-install-mainpage-failed', $e->getMessage() ); - } - - return $status; - } - /** * Get the DBMS-specific options for LocalSettings.php generation. * diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index f11f091443..e17131e217 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -372,17 +372,6 @@ abstract class Installer { return $installer->populateInterwikiTable(); } - /** - * TODO: document - * - * @param $installer DatabaseInstaller - * - * @return Status - */ - public function installMainpage( DatabaseInstaller &$installer ) { - return $installer->createMainpage(); - } - /** * Exports all wg* variables stored by the installer into global scope. */ -- 2.20.1