r55798 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55797‎ | r55798 | r55799 >
Date:02:03, 4 September 2009
Author:tstarling
Status:ok
Tags:
Comment:
(bug 20471) In update.php, disable the LocalisationCache storage backend before Setup.php is run, to avoid having extensions die when they try to access the l10n_cache table from $wgExtensionSetupFunctions.
Modified paths:
  • /trunk/phase3/maintenance/update.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/update.php
@@ -10,14 +10,11 @@
1111 */
1212
1313 /** */
 14+define( 'MW_CMDLINE_CALLBACK', 'wfSetupUpdateScript' );
1415 $wgUseMasterForMaintenance = true;
1516 require_once( dirname(__FILE__) . '/commandLine.inc' );
1617 require( "updaters.inc" );
1718
18 -# Don't try to load stuff from l10n_cache yet
19 -$lc = Language::getLocalisationCache();
20 -$lc->disableBackend();
21 -
2219 $wgTitle = Title::newFromText( "MediaWiki database updater" );
2320
2421 echo( "MediaWiki {$wgVersion} Updater\n\n" );
@@ -43,4 +40,16 @@
4441
4542 print "Done.\n";
4643
 44+function wfSetupUpdateScript() {
 45+ global $wgLocalisationCacheConf;
4746
 47+ # Don't try to access the database
 48+ # This needs to be disabled early since extensions will try to use the l10n
 49+ # cache from $wgExtensionSetupFunctions (bug 20471)
 50+ $wgLocalisationCacheConf = array(
 51+ 'class' => 'LocalisationCache',
 52+ 'storeClass' => 'LCStore_Null',
 53+ 'storeDirectory' => false,
 54+ 'manualRecache' => false,
 55+ );
 56+}

Status & tagging log