Update comments: file stuff no longer uses WikiError
[lhc/web/wiklou.git] / includes / HTMLFileCache.php
index d205624..fd7d048 100644 (file)
@@ -7,8 +7,7 @@
 
 /**
  * Handles talking to the file cache, putting stuff in and taking it back out.
- * Mostly called from Article.php, also from DatabaseFunctions.php for the
- * emergency abort/fallback to cache.
+ * Mostly called from Article.php for the emergency abort/fallback to cache.
  *
  * Global options that affect this module:
  * - $wgCachePages
@@ -55,7 +54,7 @@ class HTMLFileCache {
                        if( $this->useGzip() )
                                $this->mFileCache .= '.gz';
 
-                       wfDebug( " fileCacheName() - {$this->mFileCache}\n" );
+                       wfDebug( __METHOD__ . ": {$this->mFileCache}\n" );
                }
                return $this->mFileCache;
        }
@@ -106,12 +105,11 @@ class HTMLFileCache {
                global $wgCacheEpoch;
 
                if( !$this->isFileCached() ) return false;
-               if( !$timestamp ) return true; // should be invalidated on change
 
                $cachetime = $this->fileCacheTime();
                $good = $timestamp <= $cachetime && $wgCacheEpoch <= $cachetime;
 
-               wfDebug(" isFileCacheGood() - cachetime $cachetime, touched '{$timestamp}' epoch {$wgCacheEpoch}, good $good\n");
+               wfDebug( __METHOD__ . ": cachetime $cachetime, touched '{$timestamp}' epoch {$wgCacheEpoch}, good $good\n");
                return $good;
        }
 
@@ -137,7 +135,7 @@ class HTMLFileCache {
        /* Working directory to/from output */
        public function loadFromFileCache() {
                global $wgOut, $wgMimeType, $wgOutputEncoding, $wgContLanguageCode;
-               wfDebug(" loadFromFileCache()\n");
+               wfDebug( __METHOD__ . "()\n");
                $filename = $this->fileCacheName();
                // Raw pages should handle cache control on their own,
                // even when using file cache. This reduces hits from clients.
@@ -176,7 +174,7 @@ class HTMLFileCache {
                        return $text;
                }
 
-               wfDebug(" saveToFileCache()\n", false);
+               wfDebug( __METHOD__ . "()\n", false);
 
                $this->checkCacheDirs();