r75371 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75370‎ | r75371 | r75372 >
Date:18:57, 25 October 2010
Author:freakolowsky
Status:ok (Comments)
Tags:
Comment:
* moved installMainpage to CoreInstaller as requested in r75366
Modified paths:
  • /trunk/phase3/includes/installer/CoreInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/DatabaseInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.php
@@ -373,17 +373,6 @@
374374 }
375375
376376 /**
377 - * TODO: document
378 - *
379 - * @param $installer DatabaseInstaller
380 - *
381 - * @return Status
382 - */
383 - public function installMainpage( DatabaseInstaller &$installer ) {
384 - return $installer->createMainpage();
385 - }
386 -
387 - /**
388377 * Exports all wg* variables stored by the installer into global scope.
389378 */
390379 public function exportVars() {
Index: trunk/phase3/includes/installer/CoreInstaller.php
@@ -433,6 +433,27 @@
434434 }
435435
436436 /**
 437+ * Insert Main Page with default content.
 438+ *
 439+ * @return Status
 440+ */
 441+ public function installMainpage( DatabaseInstaller &$installer ) {
 442+ $status = Status::newGood();
 443+ try {
 444+ $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) );
 445+ $article = new Article( $titleobj );
 446+ $article->doEdit( wfMsg( 'mainpagetext' ) . "\n\n" . wfMsgNoTrans( 'mainpagedocfooter' ),
 447+ '',
 448+ EDIT_NEW );
 449+ } catch (MWException $e) {
 450+ //using raw, because $wgShowExceptionDetails can not be set yet
 451+ $status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
 452+ }
 453+
 454+ return $status;
 455+ }
 456+
 457+ /**
437458 * Override the necessary bits of the config to run an installation.
438459 */
439460 public static function overrideConfig() {
Index: trunk/phase3/includes/installer/DatabaseInstaller.php
@@ -137,27 +137,6 @@
138138 }
139139
140140 /**
141 - * Insert Main Page with default content.
142 - *
143 - * @return Status
144 - */
145 - public function createMainpage() {
146 - $status = Status::newGood();
147 - try {
148 - $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) );
149 - $article = new Article( $titleobj );
150 - $article->doEdit( wfMsg( 'mainpagetext' ) . "\n\n" . wfMsgNoTrans( 'mainpagedocfooter' ),
151 - '',
152 - EDIT_NEW );
153 - } catch (MWException $e) {
154 - //using raw, because $wgShowExceptionDetails can not be set yet
155 - $status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
156 - }
157 -
158 - return $status;
159 - }
160 -
161 - /**
162141 * Get the DBMS-specific options for LocalSettings.php generation.
163142 *
164143 * @return String

Follow-up revisions

RevisionCommit summaryAuthorDate
r75386Followup r75371, use MediaWiki default user and content language for messagesdemon21:46, 25 October 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75366* DatabaseOracle - throw connection exception instead of debug+false...freakolowsky16:49, 25 October 2010

Comments

#Comment by 😂 (talk | contribs)   20:30, 25 October 2010

On further thought, this should probably use wfMsgForContent(). We actually make the distinction in the new installer.

Status & tagging log