*/
$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.
*/
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" );
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'];
+ }
}
}