r92 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91‎ | r92 | r93 >
Date:04:21, 8 February 2002
Author:vibber
Status:old
Tags:
Comment:
Continued cache fix
Modified paths:
  • /trunk/phpwiki/fpw/wikiPage.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/wikiPage.php
@@ -24,6 +24,7 @@
2525 $this->knownUnlinkedLinks = array () ;
2626 $this->SetTitle ( $t ) ;
2727 $this->isSpecialPage = false ;
 28+ $this->canBeCached = true ;
2829 $this->revision = "current" ;
2930 if ( $this->namespace == "special" ) { # Special page, calling appropriate function
3031 $allowed = $wikiAllowedSpecialPages ; # List of allowed special pages
@@ -40,6 +41,7 @@
4142 # include_once ( "./specialPages.php") ;
4243 $this->contents = $call () ;
4344 $this->isSpecialPage = true ;
 45+ $this->canBeCached = false ;
4446 return ; # contents of special page is returned here!!!
4547 }
4648
@@ -464,8 +466,8 @@
465467 }
466468 */
467469
468 - if ( $countvars == substr_count ( "{{" , $s ) ) $this->canBeCached = true ;
469 - else $this->canBeCached = false ;
 470+ if ( $countvars != substr_count ( "{{" , $s ) )
 471+ $this->canBeCached = false ;
470472
471473 return $s ;
472474 }
@@ -1062,13 +1064,14 @@
10631065 global $pageTitle , $diff , $wikiArticleSource , $wikiCurrentServer , $wikiPrintLinksMarkup , $useCachedPages ;
10641066 $pageTitle = $this->title ;
10651067 if ( isset ( $diff ) ) {
 1068+ $this->canBeCached = false; # A little crude, but effective
10661069 $middle = $this->doDiff().$this->contents ;
1067 - $useCachedPages = false; # A little crude, but effective
10681070 }
10691071 else $middle = $this->contents ;
1070 - if ( $useCachedPages and !$this->isSpecialPage) {
 1072+ if ( $useCachedPages and !$this->isSpecialPage and $this->canBeCached) {
10711073 if ( $this->cache != "" ) { # Using cache
10721074 $middle = $this->cache ;
 1075+ #$middle = "<p>(cached)</p>" . $this->cache ; #FIXME
10731076 } else {
10741077 $middle = $this->parseContents($middle) ;
10751078 if ( $this->canBeCached ) { # Generating cache

Status & tagging log