r55630 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55629‎ | r55630 | r55631 >
Date:16:28, 27 August 2009
Author:midom
Status:ok (Comments)
Tags:
Comment:
I LOVE OO PEOPLE <3 <3 <3
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/RawPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -3427,7 +3427,8 @@
34283428 */
34293429 public function isFileCacheable() {
34303430 $cacheable = false;
3431 - if( HTMLFileCache::useFileCache() ) {
 3431+ global $wgUseFileCache;
 3432+ if( $wgUseFileCache and HTMLFileCache::useFileCache() ) {
34323433 $cacheable = $this->getID() && !$this->mRedirectedFrom;
34333434 // Extension may have reason to disable file caching on some pages.
34343435 if( $cacheable ) {
Index: trunk/phase3/includes/RawPage.php
@@ -135,7 +135,8 @@
136136 $mode = $this->mPrivateCache ? 'private' : 'public';
137137 header( 'Cache-Control: '.$mode.', s-maxage='.$this->mSmaxage.', max-age='.$this->mMaxage );
138138
139 - if( HTMLFileCache::useFileCache() ) {
 139+ global $wgUseFileCache;
 140+ if( $wgUseFileCache and HTMLFileCache::useFileCache() ) {
140141 $cache = new HTMLFileCache( $this->mTitle, 'raw' );
141142 if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {
142143 $cache->loadFromFileCache();

Comments

#Comment by Brion VIBBER (talk | contribs)   16:55, 27 August 2009

(This avoids loading extra classes if we're not going to use the file cache.)

#Comment by Simetrical (talk | contribs)   17:04, 27 August 2009

Ah, I get it now. And index.php already checks $wgUseFileCache.

(Switching back new → ok: apparently CodeReview doesn't handle simulpost well.)

#Comment by Simetrical (talk | contribs)   17:03, 27 August 2009

I don't get the point of this? useFileCache() is used in index.php as well, should it be fixed there as well? It checks $wgUseFileCache first thing anyway, though.

Status & tagging log