r32936 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32935‎ | r32936 | r32937 >
Date:00:22, 8 April 2008
Author:dale
Status:old
Tags:
Comment:
cache naming bug
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_ParserCache.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_ParserCache.php
@@ -13,19 +13,22 @@
1414 //avoids conflicts of inline display with full article display
1515 class MV_ParserCache extends ParserCache{
1616 var $extraKeyOpt='mv';
17 - public static function &singleton() {
 17+ var $addToKey ='';
 18+ public static function & singleton() {
1819 static $instance;
1920 if ( !isset( $instance ) ) {
2021 global $parserMemc;
2122 $instance = new MV_ParserCache( $parserMemc );
2223 }
 24+ //reset addToKey
 25+ $instance->addToKey='';
2326 return $instance;
2427 }
2528 function addToKey($opt){
26 - $this->extraKeyOpt.=$opt;
 29+ $this->addToKey=$opt;
2730 }
2831 function getKey( &$article, &$user ) {
29 - return parent::getKey( $article, $user ) .$this->extraKeyOpt;
 32+ return parent::getKey( $article, $user ).$this->extraKeyOpt.$this->addToKey;
3033 }
3134 }
3235 ?>
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php
@@ -236,8 +236,8 @@
237237 //use the cache by default:
238238 //$usepCache = (isset($mvd_page->usePcache))?$mvd_page->usePcache:true;
239239
240 - /*try to pull from cache: (should do new key on edits)*/
241 - $MvParserCache =& MV_ParserCache::singleton();
 240+ /*try to pull from cache: seperate out cache for internal links vs external links cache*/
 241+ $MvParserCache = & MV_ParserCache::singleton();
242242 $add_opt = ($absolute_links)?'a':'';
243243 $MvParserCache->addToKey($add_opt);
244244

Status & tagging log