Example #1
0
 /**
  * checkLastModified returns true if it has taken care of all
  * output to the client that is necessary for this request.
  * (that is, it has sent a cached version of the page)
  */
 function tryFileCache()
 {
     static $called = false;
     if ($called) {
         wfDebug("Article::tryFileCache(): called twice!?\n");
         return;
     }
     $called = true;
     if ($this->isFileCacheable()) {
         $touched = $this->mTouched;
         $cache = new CacheManager($this->mTitle);
         if ($cache->isFileCacheGood($touched)) {
             wfDebug("Article::tryFileCache(): about to load file\n");
             $cache->loadFromFileCache();
             return true;
         } else {
             wfDebug("Article::tryFileCache(): starting buffer\n");
             ob_start(array(&$cache, 'saveToFileCache'));
         }
     } else {
         wfDebug("Article::tryFileCache(): not cacheable\n");
     }
 }