r69431 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69430‎ | r69431 | r69432 >
Date:18:25, 16 July 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Err on the side of correctness for statistics cache
Modified paths:
  • /trunk/extensions/Translate/scripts/createMessageIndex.php (modified) (history)
  • /trunk/extensions/Translate/utils/MemoryCache.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/createMessageIndex.php
@@ -33,4 +33,6 @@
3434 showUsage();
3535 }
3636
 37+$cache = new ArrayMemoryCache( 'groupstats' );
 38+$cache->clearAll();
3739 MessageIndexRebuilder::execute();
Index: trunk/extensions/Translate/utils/MemoryCache.php
@@ -51,6 +51,11 @@
5252 }
5353 }
5454
 55+ public function clearAll() {
 56+ $this->load();
 57+ $this->cache = array();
 58+ }
 59+
5560 public function commit() {
5661 $this->save();
5762 }

Status & tagging log