From: Rob Church Date: Sat, 23 Dec 2006 13:55:24 +0000 (+0000) Subject: (bug 8016) Purge objectcache table during upgrade processes - use the --nopurge optio... X-Git-Tag: 1.31.0-rc.0~54792 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=a9e40883ee97f81c8e6cd49d27be6303a4cf1999;p=lhc%2Fweb%2Fwiklou.git (bug 8016) Purge objectcache table during upgrade processes - use the --nopurge option to prevent this when running maintennace/update.php --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index bd41f84da3..6a5099a314 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -393,6 +393,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN revisions * (bug 8214) Output file size limit and actual file size in appropriate units on Special:Upload +* (bug 8016) Purge objectcache table during upgrade processes - use the --nopurge + option to prevent this when running maintennace/update.php == Languages updated == diff --git a/maintenance/update.php b/maintenance/update.php index 402818ce14..490c3f6370 100644 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -10,7 +10,7 @@ require_once 'counter.php'; /** */ $wgUseMasterForMaintenance = true; -$options = array( 'quick' ); +$options = array( 'quick', 'nopurge' ); require_once( "commandLine.inc" ); require_once( "updaters.inc" ); $wgTitle = Title::newFromText( "MediaWiki database updater" ); @@ -54,13 +54,10 @@ if( !isset( $options['quick'] ) ) { echo "\n"; } -if ( isset( $options['doshared'] ) ) { - $doShared = true; -} else { - $doShared = false; -} +$shared = isset( $options['doshared'] ); +$purge = !isset( $options['nopurge'] ); -do_all_updates( $doShared ); +do_all_updates( $shared, $purge ); print "Done.\n"; diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index 84eda278ec..a042cecf5b 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -823,7 +823,16 @@ function do_backlinking_indices_update() { } } -function do_all_updates( $doShared = false ) { +function purge_cache() { + global $wgDatabase; + # We can't guarantee that the user will be able to use TRUNCATE, + # but we know that DELETE is available to us + echo( "Purging caches..." ); + $wgDatabase->delete( 'objectcache', '*', __METHOD__ ); + echo( "done.\n" ); +} + +function do_all_updates( $shared = false, $purge = true ) { global $wgNewTables, $wgNewFields, $wgRenamedTables, $wgSharedDB, $wgDatabase, $wgDBtype; $doUser = !$wgSharedDB || $doShared; @@ -892,6 +901,11 @@ function do_all_updates( $doShared = false ) { do_backlinking_indices_update(); flush(); initialiseMessages(); flush(); + + if( $purge ) { + purge_cache(); + flush(); + } } function archive($name) {