MediaWiki r27983 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r27982‎ | r27983 (on ViewVC)‎ | r27984 >
Date:17:03, 30 November 2007
Author:nikerabbit
Status:old
Tags:
Comment:
* (bug 8396) Ignore out-of-date serialised message caches
* MediaWiki now checks if serialized files are out of date. New configuration
variable $wgCheckSerialized can be set to false to enable old behavior (i.e.
to not check and assume they are always up to date)
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -806,6 +806,12 @@
807807 */
808808 $wgMaxMsgCacheEntrySize = 10000;
809809
 810+/**
 811+ * Set to false if you are thorough system admin who always remembers to keep
 812+ * serialized files up to date to save few mtime calls.
 813+ */
 814+$wgCheckSerialized = true;
 815+
810816 # Whether to enable language variant conversion.
811817 $wgDisableLangConversion = false;
812818
Index: trunk/phase3/languages/Language.php
@@ -1956,7 +1956,7 @@
19571957 */
19581958 static function loadLocalisation( $code, $disableCache = false ) {
19591959 static $recursionGuard = array();
1960 - global $wgMemc;
 1960+ global $wgMemc, $wgCheckSerialized;
19611961
19621962 if ( !$code ) {
19631963 throw new MWException( "Invalid language code requested" );
@@ -1973,10 +1973,15 @@
19741974 # Try the serialized directory
19751975 $cache = wfGetPrecompiledData( self::getFileName( "Messages", $code, '.ser' ) );
19761976 if ( $cache ) {
1977 - self::$mLocalisationCache[$code] = $cache;
1978 - wfDebug( "Language::loadLocalisation(): got localisation for $code from precompiled data file\n" );
1979 - wfProfileOut( __METHOD__ );
1980 - return self::$mLocalisationCache[$code]['deps'];
 1977+ if ( $wgCheckSerialized && self::isLocalisationOutOfDate( $cache ) ) {
 1978+ $cache = false;
 1979+ wfDebug( "Language::loadLocalisation(): precompiled data file for $code is out of date\n" );
 1980+ } else {
 1981+ self::$mLocalisationCache[$code] = $cache;
 1982+ wfDebug( "Language::loadLocalisation(): got localisation for $code from precompiled data file\n" );
 1983+ wfProfileOut( __METHOD__ );
 1984+ return self::$mLocalisationCache[$code]['deps'];
 1985+ }
19811986 }
19821987
19831988 # Try the global cache
Index: trunk/phase3/RELEASE-NOTES
@@ -22,6 +22,9 @@
2323 * Marking edits as bot edits with Special:Contributions?bot=1 now requires the
2424 markbotedit permission, rather than the rollback permission previously used.
2525 This permission is assigned by default to the sysop group.
 26+* MediaWiki now checks if serialized files are out of date. New configuration
 27+ variable $wgCheckSerialized can be set to false to enable old behavior (i.e.
 28+ to not check and assume they are always up to date)
2629
2730 === New features in 1.12 ===
2831 * (bug 10735) Add a warning for non-descriptive filenames at Special:Upload
@@ -82,6 +85,7 @@
8386 * (bug 9633) Add a predefined list of delete reasons to the deletion form
8487 * Show a warning message when creating/editing a user (talk) page but the user
8588 does not exists
 89+* (bug 8396) Ignore out-of-date serialised message caches
8690
8791 === Bug fixes in 1.12 ===
8892

Status & tagging log

  • 15:22, 12 September 2011 Meno25 (talk | contribs) changed the status of r27983 [removed: ok added: old]