| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -806,6 +806,12 @@ |
| 807 | 807 | */ |
| 808 | 808 | $wgMaxMsgCacheEntrySize = 10000; |
| 809 | 809 | |
| | 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 | + |
| 810 | 816 | # Whether to enable language variant conversion. |
| 811 | 817 | $wgDisableLangConversion = false; |
| 812 | 818 | |
| Index: trunk/phase3/languages/Language.php |
| — | — | @@ -1956,7 +1956,7 @@ |
| 1957 | 1957 | */ |
| 1958 | 1958 | static function loadLocalisation( $code, $disableCache = false ) { |
| 1959 | 1959 | static $recursionGuard = array(); |
| 1960 | | - global $wgMemc; |
| | 1960 | + global $wgMemc, $wgCheckSerialized; |
| 1961 | 1961 | |
| 1962 | 1962 | if ( !$code ) { |
| 1963 | 1963 | throw new MWException( "Invalid language code requested" ); |
| — | — | @@ -1973,10 +1973,15 @@ |
| 1974 | 1974 | # Try the serialized directory |
| 1975 | 1975 | $cache = wfGetPrecompiledData( self::getFileName( "Messages", $code, '.ser' ) ); |
| 1976 | 1976 | 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 | + } |
| 1981 | 1986 | } |
| 1982 | 1987 | |
| 1983 | 1988 | # Try the global cache |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -22,6 +22,9 @@ |
| 23 | 23 | * Marking edits as bot edits with Special:Contributions?bot=1 now requires the |
| 24 | 24 | markbotedit permission, rather than the rollback permission previously used. |
| 25 | 25 | 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) |
| 26 | 29 | |
| 27 | 30 | === New features in 1.12 === |
| 28 | 31 | * (bug 10735) Add a warning for non-descriptive filenames at Special:Upload |
| — | — | @@ -82,6 +85,7 @@ |
| 83 | 86 | * (bug 9633) Add a predefined list of delete reasons to the deletion form |
| 84 | 87 | * Show a warning message when creating/editing a user (talk) page but the user |
| 85 | 88 | does not exists |
| | 89 | +* (bug 8396) Ignore out-of-date serialised message caches |
| 86 | 90 | |
| 87 | 91 | === Bug fixes in 1.12 === |
| 88 | 92 | |