r50700 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50699‎ | r50700 | r50701 >
Date:17:01, 17 May 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Too slow to unserialize every time... keep the data in memory
Modified paths:
  • /trunk/extensions/Translate/TranslateUtils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslateUtils.php
@@ -214,7 +214,8 @@
215215 }
216216
217217 public static function messageIndex() {
218 - $keyToGroup = array();
 218+ static $keyToGroup = null;
 219+ if ( $keyToGroup !== null ) return $keyToGroup;
219220 if ( file_exists( TRANSLATE_INDEXFILE ) ) {
220221 $keyToGroup = unserialize( file_get_contents( TRANSLATE_INDEXFILE ) );
221222 } else {

Status & tagging log