From: Aaron Schulz Date: Wed, 11 Feb 2009 16:08:36 +0000 (+0000) Subject: (bug 17414) Added magic words as a cache dependency X-Git-Tag: 1.31.0-rc.0~42934 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=891fde08e981fd0019e25c201553fc445f3fc3ba;p=lhc%2Fweb%2Fwiklou.git (bug 17414) Added magic words as a cache dependency --- diff --git a/languages/Language.php b/languages/Language.php index 97ac27cb41..427e7a975a 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -2396,6 +2396,12 @@ class Language { $cache = compact( self::$mLocalisationKeys ); wfDebug( "Language::loadLocalisation(): got localisation for $code from source\n" ); } + + # Load magic word source file + global $IP; + $filename = "$IP/includes/MagicWord.php"; + $newDeps = array( $filename => filemtime( $filename ) ); + $deps = array_merge( $deps, $newDeps ); if ( !empty( $fallback ) ) { # Load the fallback localisation, with a circular reference guard @@ -2472,6 +2478,10 @@ class Language { self::loadLocalisation( $cache ); $cache = self::$mLocalisationCache[$cache]; } + // At least one language file and the MagicWord file needed + if( count($cache['deps']) < 2 ) { + return true; + } $expired = false; foreach ( $cache['deps'] as $file => $mtime ) { if ( !file_exists( $file ) || filemtime( $file ) > $mtime ) {