r54233 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54232‎ | r54233 | r54234 >
Date:20:21, 2 August 2009
Author:demon
Status:ok
Tags:
Comment:
Forgot that updaters.inc relies on deleteDefaultMessages.php. Move its require down to where its actually needed, and define MW_NO_SETUP so we don't try to kick it off like normal. Stupid hack until update.php uses Maintenance.php.
Modified paths:
  • /trunk/phase3/maintenance/deleteDefaultMessages.php (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updaters.inc
@@ -11,7 +11,6 @@
1212
1313 require_once 'convertLinks.inc';
1414 require_once 'userDupes.inc';
15 -require_once 'deleteDefaultMessages.php';
1615 # Extension updates
1716 require_once( "$IP/includes/Hooks.php" );
1817
@@ -1113,7 +1112,11 @@
11141113
11151114
11161115 wfOut( "Deleting old default messages (this may take a long time!)..." );
1117 - deleteDefaultMessages();
 1116+ if( !defined( 'MW_NO_SETUP' ) ) {
 1117+ define( 'MW_NO_SETUP', true );
 1118+ }
 1119+ require_once 'deleteDefaultMessages.php';
 1120+ DeleteDefaultMessages::reallyExecute();
11181121 wfOut( "Done\n" );
11191122
11201123 do_stats_init();
Index: trunk/phase3/maintenance/deleteDefaultMessages.php
@@ -31,6 +31,10 @@
3232 }
3333
3434 public function execute() {
 35+ self::reallyExecute();
 36+ }
 37+
 38+ public static function reallyExecute() {
3539 $user = 'MediaWiki default';
3640 $reason = 'No longer required';
3741
@@ -49,7 +53,7 @@
5054 );
5155
5256 $dbw = wfGetDB( DB_MASTER );
53 -
 57+
5458 while ( $row = $dbr->fetchObject( $res ) ) {
5559 if ( function_exists( 'wfWaitForSlaves' ) ) {
5660 wfWaitForSlaves( 5 );

Status & tagging log