Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -853,6 +853,14 @@ |
854 | 854 | $wgMaxMsgCacheEntrySize = 10000; |
855 | 855 | |
856 | 856 | /** |
| 857 | + * If true, serialized versions of the messages arrays will be |
| 858 | + * read from the 'serialized' subdirectory if they are present. |
| 859 | + * Set to false to always use the Messages files, regardless of |
| 860 | + * whether they are up to date or not. |
| 861 | + */ |
| 862 | +$wgEnableSerializedMessages = true; |
| 863 | + |
| 864 | +/** |
857 | 865 | * Set to false if you are thorough system admin who always remembers to keep |
858 | 866 | * serialized files up to date to save few mtime calls. |
859 | 867 | */ |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -2272,7 +2272,7 @@ |
2273 | 2273 | */ |
2274 | 2274 | static function loadLocalisation( $code, $disableCache = false ) { |
2275 | 2275 | static $recursionGuard = array(); |
2276 | | - global $wgMemc, $wgCheckSerialized; |
| 2276 | + global $wgMemc, $wgEnableSerializedMessages, $wgCheckSerialized; |
2277 | 2277 | |
2278 | 2278 | if ( !$code ) { |
2279 | 2279 | throw new MWException( "Invalid language code requested" ); |
— | — | @@ -2287,16 +2287,18 @@ |
2288 | 2288 | wfProfileIn( __METHOD__ ); |
2289 | 2289 | |
2290 | 2290 | # Try the serialized directory |
2291 | | - $cache = wfGetPrecompiledData( self::getFileName( "Messages", $code, '.ser' ) ); |
2292 | | - if ( $cache ) { |
2293 | | - if ( $wgCheckSerialized && self::isLocalisationOutOfDate( $cache ) ) { |
2294 | | - $cache = false; |
2295 | | - wfDebug( "Language::loadLocalisation(): precompiled data file for $code is out of date\n" ); |
2296 | | - } else { |
2297 | | - self::$mLocalisationCache[$code] = $cache; |
2298 | | - wfDebug( "Language::loadLocalisation(): got localisation for $code from precompiled data file\n" ); |
2299 | | - wfProfileOut( __METHOD__ ); |
2300 | | - return self::$mLocalisationCache[$code]['deps']; |
| 2291 | + if( $wgEnableSerializedMessages ) { |
| 2292 | + $cache = wfGetPrecompiledData( self::getFileName( "Messages", $code, '.ser' ) ); |
| 2293 | + if ( $cache ) { |
| 2294 | + if ( $wgCheckSerialized && self::isLocalisationOutOfDate( $cache ) ) { |
| 2295 | + $cache = false; |
| 2296 | + wfDebug( "Language::loadLocalisation(): precompiled data file for $code is out of date\n" ); |
| 2297 | + } else { |
| 2298 | + self::$mLocalisationCache[$code] = $cache; |
| 2299 | + wfDebug( "Language::loadLocalisation(): got localisation for $code from precompiled data file\n" ); |
| 2300 | + wfProfileOut( __METHOD__ ); |
| 2301 | + return self::$mLocalisationCache[$code]['deps']; |
| 2302 | + } |
2301 | 2303 | } |
2302 | 2304 | } |
2303 | 2305 | |