public function __construct( &$title, $type = 'view' ) {
$this->mTitle = $title;
+ $type = $type ? $type : 'view';
$this->mType = ($type == 'raw' || $type == 'view' ) ? $type : false;
$this->fileCacheName(); // init name
}
if( HTMLFileCache::useFileCache() ) {
$cache = new HTMLFileCache( $this->mTitle, 'raw' );
if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {
- /* Check incoming headers to see if client has this cached */
- if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) {
- $cache->loadFromFileCache();
- }
+ $cache->loadFromFileCache();
+ $wgOut->disable();
return;
} else {
ob_start( array(&$cache, 'saveToFileCache' ) );
/* Check incoming headers to see if client has this cached */
if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) {
$cache->loadFromFileCache();
- # Do any stats increment/watchlist stuff
- $wgArticle = self::articleFromTitle( $wgTitle );
- $wgArticle->viewUpdates();
}
+ # Do any stats increment/watchlist stuff
+ $wgArticle = MediaWiki::articleFromTitle( $wgTitle );
+ $wgArticle->viewUpdates();
# Tell $wgOut that output is taken care of
- $wgOut->disable();
wfProfileOut( 'main-try-filecache' );
$mediaWiki->restInPeace();
exit;