Throw in $wgEnableSerializedMessages which I can disable on test wikipedia so it...
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 11 Dec 2008 22:20:26 +0000 (22:20 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 11 Dec 2008 22:20:26 +0000 (22:20 +0000)
includes/DefaultSettings.php
languages/Language.php

index bdaad83..8379bac 100644 (file)
@@ -852,6 +852,14 @@ $wgMsgCacheExpiry  = 86400;
  */
 $wgMaxMsgCacheEntrySize = 10000;
 
+/**
+ * If true, serialized versions of the messages arrays will be
+ * read from the 'serialized' subdirectory if they are present.
+ * Set to false to always use the Messages files, regardless of
+ * whether they are up to date or not.
+ */
+$wgEnableSerializedMessages = true;
+
 /**
  * Set to false if you are thorough system admin who always remembers to keep
  * serialized files up to date to save few mtime calls.
index 49a37ea..5aa1650 100644 (file)
@@ -2272,7 +2272,7 @@ class Language {
         */
        static function loadLocalisation( $code, $disableCache = false ) {
                static $recursionGuard = array();
-               global $wgMemc, $wgCheckSerialized;
+               global $wgMemc, $wgEnableSerializedMessages, $wgCheckSerialized;
 
                if ( !$code ) {
                        throw new MWException( "Invalid language code requested" );
@@ -2287,16 +2287,18 @@ class Language {
                        wfProfileIn( __METHOD__ );
 
                        # Try the serialized directory
-                       $cache = wfGetPrecompiledData( self::getFileName( "Messages", $code, '.ser' ) );
-                       if ( $cache ) {
-                               if ( $wgCheckSerialized && self::isLocalisationOutOfDate( $cache ) ) {
-                                       $cache = false;
-                                       wfDebug( "Language::loadLocalisation(): precompiled data file for $code is out of date\n" );
-                               } else {
-                                       self::$mLocalisationCache[$code] = $cache;
-                                       wfDebug( "Language::loadLocalisation(): got localisation for $code from precompiled data file\n" );
-                                       wfProfileOut( __METHOD__ );
-                                       return self::$mLocalisationCache[$code]['deps'];
+                       if( $wgEnableSerializedMessages ) {
+                               $cache = wfGetPrecompiledData( self::getFileName( "Messages", $code, '.ser' ) );
+                               if ( $cache ) {
+                                       if ( $wgCheckSerialized && self::isLocalisationOutOfDate( $cache ) ) {
+                                               $cache = false;
+                                               wfDebug( "Language::loadLocalisation(): precompiled data file for $code is out of date\n" );
+                                       } else {
+                                               self::$mLocalisationCache[$code] = $cache;
+                                               wfDebug( "Language::loadLocalisation(): got localisation for $code from precompiled data file\n" );
+                                               wfProfileOut( __METHOD__ );
+                                               return self::$mLocalisationCache[$code]['deps'];
+                                       }
                                }
                        }