r69795 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69794‎ | r69795 | r69796 >
Date:15:35, 23 July 2010
Author:catrope
Status:deferred
Tags:
Comment:
resourceloader: Use MessageBlobStore::updateMessage() in MessageCache::replace(), and fix a bug in the former
Modified paths:
  • /branches/resourceloader/phase3/includes/MessageBlobStore.php (modified) (history)
  • /branches/resourceloader/phase3/includes/MessageCache.php (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/includes/MessageCache.php
@@ -368,7 +368,7 @@
369369 wfProfileIn( __METHOD__ );
370370
371371
372 - list( , $code ) = $this->figureMessage( $title );
 372+ list( $msg, $code ) = $this->figureMessage( $title );
373373
374374 $cacheKey = wfMemcKey( 'messages', $code );
375375 $this->load($code);
@@ -410,6 +410,10 @@
411411 $sidebarKey = wfMemcKey( 'sidebar', $code );
412412 $parserMemc->delete( $sidebarKey );
413413 }
 414+
 415+ // Update the message in the message blob store
 416+ global $wgContLang;
 417+ MessageBlobStore::updateMessage( $wgContLang->lcfirst( $msg ) );
414418
415419 wfRunHooks( "MessageCacheReplace", array( $title, $text ) );
416420
@@ -769,7 +773,7 @@
770774 }
771775
772776 public function figureMessage( $key ) {
773 - global $wgContLanguageCode;
 777+ global $wgContLanguageCode, $wgContLang;
774778 $pieces = explode( '/', $key );
775779 if( count( $pieces ) < 2 )
776780 return array( $key, $wgContLanguageCode );
Index: branches/resourceloader/phase3/includes/MessageBlobStore.php
@@ -149,14 +149,14 @@
150150
151151 // Delete old messages, insert new ones
152152 $dbw->delete( 'msg_resource_links', array(
153 - 'mrl_resource' => $resource,
 153+ 'mrl_resource' => $module,
154154 'mrl_message' => $oldMessages
155155 ), __METHOD__
156156 );
157157 $newLinksRows = array();
158158 foreach ( $newMessages as $message ) {
159159 $newLinksRows[] = array(
160 - 'mrl_resource' => $resource,
 160+ 'mrl_resource' => $module,
161161 'mrl_message' => $message
162162 );
163163 }

Status & tagging log