r96242 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96241‎ | r96242 | r96243 >
Date:18:02, 4 September 2011
Author:maxsem
Status:ok
Tags:
Comment:
WikiHiero: store image path in cache key to cater for different protocols, also use extension version to avoid stale cache on upgrades
Modified paths:
  • /trunk/extensions/wikihiero/SpecialHieroglyphs.php (modified) (history)
  • /trunk/extensions/wikihiero/wikihiero.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/wikihiero/SpecialHieroglyphs.php
@@ -73,7 +73,11 @@
7474 private function listHieroglyphs() {
7575 global $wgMemc;
7676
77 - $key = wfMemcKey( 'hiero-list', $this->getContext()->getLang()->getCode() );
 77+ $key = wfMemcKey( 'hiero-list',
 78+ $this->getContext()->getLang()->getCode(),
 79+ WikiHiero::getImagePath(),
 80+ WIKIHIERO_VERSION
 81+ );
7882 $html = $wgMemc->get( $key );
7983 if ( $html ) {
8084 return $html;
Index: trunk/extensions/wikihiero/wikihiero.body.php
@@ -469,6 +469,13 @@
470470 }
471471
472472 /**
 473+ * @return string: URL of images directory
 474+ */
 475+ public static function getImagePath() {
 476+ return WH_IMG_DIR;
 477+ }
 478+
 479+ /**
473480 * Get glyph code from file name
474481 *
475482 * @param $file string: file name

Status & tagging log