r55161 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55160‎ | r55161 | r55162 >
Date:01:54, 17 August 2009
Author:aaron
Status:reverted
Tags:
Comment:
Fixed html filecache handling of ?curid urls
Modified paths:
  • /trunk/phase3/index.php (modified) (history)

Diff [purge]

Index: trunk/phase3/index.php
@@ -80,20 +80,26 @@
8181 // Raw pages should handle cache control on their own,
8282 // even when using file cache. This reduces hits from clients.
8383 if( $action != 'raw' && HTMLFileCache::useFileCache() ) {
84 - /* Try low-level file cache hit */
85 - $cache = new HTMLFileCache( $wgTitle, $action );
86 - if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {
87 - /* Check incoming headers to see if client has this cached */
88 - if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) {
89 - $cache->loadFromFileCache();
 84+ /* Set the title from the page ID if needed... */
 85+ if( $curid = $wgRequest->getInt('curid') ) {
 86+ $wgTitle = Title::newFromID( $curid );
 87+ }
 88+ if( !is_null($wgTitle) ) {
 89+ /* Try low-level file cache hit */
 90+ $cache = new HTMLFileCache( $wgTitle, $action );
 91+ if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {
 92+ /* Check incoming headers to see if client has this cached */
 93+ if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) {
 94+ $cache->loadFromFileCache();
 95+ }
 96+ # Do any stats increment/watchlist stuff
 97+ $wgArticle = MediaWiki::articleFromTitle( $wgTitle );
 98+ $wgArticle->viewUpdates();
 99+ # Tell $wgOut that output is taken care of
 100+ wfProfileOut( 'main-try-filecache' );
 101+ $mediaWiki->restInPeace();
 102+ exit;
90103 }
91 - # Do any stats increment/watchlist stuff
92 - $wgArticle = MediaWiki::articleFromTitle( $wgTitle );
93 - $wgArticle->viewUpdates();
94 - # Tell $wgOut that output is taken care of
95 - wfProfileOut( 'main-try-filecache' );
96 - $mediaWiki->restInPeace();
97 - exit;
98104 }
99105 }
100106 wfProfileOut( 'main-try-filecache' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r55162reverted r55161 - not neededaaron02:25, 17 August 2009

Status & tagging log