Index: trunk/phase3/index.php |
— | — | @@ -80,20 +80,26 @@ |
81 | 81 | // Raw pages should handle cache control on their own, |
82 | 82 | // even when using file cache. This reduces hits from clients. |
83 | 83 | 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; |
90 | 103 | } |
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; |
98 | 104 | } |
99 | 105 | } |
100 | 106 | wfProfileOut( 'main-try-filecache' ); |