r81541 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81540‎ | r81541 | r81542 >
Date:21:10, 4 February 2011
Author:demon
Status:ok
Tags:
Comment:
Suppress warnings on reading interwiki.list in case permissions or something else makes it not work.
Tweak message since we no longer read the .sql file.
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -457,7 +457,7 @@
458458 Skipping creation.",
459459 'config-install-tables-failed' => "'''Error''': Table creation failed with the following error: $1",
460460 'config-install-interwiki' => 'Populating default interwiki table',
461 - 'config-install-interwiki-sql' => 'Could not find file <code>interwiki.sql</code>.',
 461+ 'config-install-interwiki-list' => 'Could not read file <code>interwiki.list</code>.',
462462 'config-install-interwiki-exists' => "'''Warning''': The interwiki table seems to already have entries.
463463 Skipping default list.",
464464 'config-install-stats' => 'Initializing statistics',
Index: trunk/phase3/includes/installer/DatabaseInstaller.php
@@ -547,11 +547,13 @@
548548 return $status;
549549 }
550550 global $IP;
 551+ wfSuppressWarnings();
551552 $rows = file( "$IP/maintenance/interwiki.list",
552553 FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES );
 554+ wfRestoreWarnings();
553555 $interwikis = array();
554556 if ( !$rows ) {
555 - return Status::newFatal( 'config-install-interwiki-sql' );
 557+ return Status::newFatal( 'config-install-interwiki-list' );
556558 }
557559 foreach( $rows as $row ) {
558560 $row = preg_replace( '/^\s*([^#]*?)\s*(#.*)?$/', '\\1', $row ); // strip comments - whee

Status & tagging log