logo       

[MediaWiki-CVS] SVN: [54075] trunk/phase3/includes/MessageCache.php: msg#01453

mediawiki-cvs

Subject: [MediaWiki-CVS] SVN: [54075] trunk/phase3/includes/MessageCache.php

http://www.mediawiki.org/wiki/Special:Code/MediaWiki/54075

Revision: 54075
Author: nikerabbit
Date: 2009-07-31 07:12:25 +0000 (Fri, 31 Jul 2009)

Log Message:
-----------
* Fix sidebar purging code (still unknown to me what causes it to cache bad
version)
* Add language code to the load method

Modified Paths:
--------------
trunk/phase3/includes/MessageCache.php

Modified: trunk/phase3/includes/MessageCache.php
===================================================================
--- trunk/phase3/includes/MessageCache.php 2009-07-31 06:54:55 UTC (rev
54074)
+++ trunk/phase3/includes/MessageCache.php 2009-07-31 07:12:25 UTC (rev
54075)
@@ -346,7 +346,7 @@

$res = $dbr->select( array( 'page', 'revision', 'text' ),
array( 'page_title', 'old_text', 'old_flags' ),
- $smallConds, __METHOD__ );
+ $smallConds, __METHOD__. "($code)" );

for ( $row = $dbr->fetchObject( $res ); $row; $row =
$dbr->fetchObject( $res ) ) {
$cache[$row->page_title] = ' ' .
Revision::getRevisionText( $row );
@@ -400,9 +400,18 @@

// Also delete cached sidebar... just in case it is affected
global $parserMemc;
- $sidebarKey = wfMemcKey( 'sidebar', $code );
- $parserMemc->delete( $sidebarKey );
+ $codes = array( $code );
+ if ( $code === 'en' ) {
+ // Delete all sidebars, like for example on
action=purge on the
+ // sidebar messages
+ $codes = array_keys( Language::getLanguageNames() );
+ }

+ foreach ( $codes as $code ) {
+ $sidebarKey = wfMemcKey( 'sidebar', $code );
+ $parserMemc->delete( $sidebarKey );
+ }
+
wfRunHooks( "MessageCacheReplace", array( $title, $text ) );

wfProfileOut( __METHOD__ );



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@xxxxxxxxxxxxxxxxxxx
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise