r47143 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47142‎ | r47143 | r47144 >
Date:16:08, 11 February 2009
Author:aaron
Status:deferred
Tags:
Comment:
(bug 17414) Added magic words as a cache dependency
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -2396,6 +2396,12 @@
23972397 $cache = compact( self::$mLocalisationKeys );
23982398 wfDebug( "Language::loadLocalisation(): got localisation for $code from source\n" );
23992399 }
 2400+
 2401+ # Load magic word source file
 2402+ global $IP;
 2403+ $filename = "$IP/includes/MagicWord.php";
 2404+ $newDeps = array( $filename => filemtime( $filename ) );
 2405+ $deps = array_merge( $deps, $newDeps );
24002406
24012407 if ( !empty( $fallback ) ) {
24022408 # Load the fallback localisation, with a circular reference guard
@@ -2472,6 +2478,10 @@
24732479 self::loadLocalisation( $cache );
24742480 $cache = self::$mLocalisationCache[$cache];
24752481 }
 2482+ // At least one language file and the MagicWord file needed
 2483+ if( count($cache['deps']) < 2 ) {
 2484+ return true;
 2485+ }
24762486 $expired = false;
24772487 foreach ( $cache['deps'] as $file => $mtime ) {
24782488 if ( !file_exists( $file ) || filemtime( $file ) > $mtime ) {

Status & tagging log