From: Tim Starling Date: Fri, 4 Sep 2009 02:03:23 +0000 (+0000) Subject: (bug 20471) In update.php, disable the LocalisationCache storage backend before Setup... X-Git-Tag: 1.31.0-rc.0~39945 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=25a5344514408dd3d83c0acf34663f130337a604;p=lhc%2Fweb%2Fwiklou.git (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. --- diff --git a/maintenance/update.php b/maintenance/update.php index c473153e19..abd0bebb25 100644 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -10,14 +10,11 @@ */ /** */ +define( 'MW_CMDLINE_CALLBACK', 'wfSetupUpdateScript' ); $wgUseMasterForMaintenance = true; require_once( dirname(__FILE__) . '/commandLine.inc' ); require( "updaters.inc" ); -# Don't try to load stuff from l10n_cache yet -$lc = Language::getLocalisationCache(); -$lc->disableBackend(); - $wgTitle = Title::newFromText( "MediaWiki database updater" ); echo( "MediaWiki {$wgVersion} Updater\n\n" ); @@ -43,4 +40,16 @@ do_all_updates( $shared, $purge ); print "Done.\n"; - +function wfSetupUpdateScript() { + global $wgLocalisationCacheConf; + + # Don't try to access the database + # This needs to be disabled early since extensions will try to use the l10n + # cache from $wgExtensionSetupFunctions (bug 20471) + $wgLocalisationCacheConf = array( + 'class' => 'LocalisationCache', + 'storeClass' => 'LCStore_Null', + 'storeDirectory' => false, + 'manualRecache' => false, + ); +}