Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -111,7 +111,6 @@ |
112 | 112 | // about the possible different language variants |
113 | 113 | if( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 ) |
114 | 114 | $wgContLang->findVariantLink( $title, $ret ); |
115 | | - |
116 | 115 | } |
117 | 116 | if( ( $oldid = $wgRequest->getInt( 'oldid' ) ) |
118 | 117 | && ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) ) { |
— | — | @@ -221,25 +220,6 @@ |
222 | 221 | /* actions that need to be made when we have a special pages */ |
223 | 222 | SpecialPage::executePath( $title ); |
224 | 223 | } else { |
225 | | - /* Try low-level file cache hit */ |
226 | | - if( $title->getNamespace() != NS_MEDIAWIKI && HTMLFileCache::useFileCache() ) { |
227 | | - $cache = new HTMLFileCache( $title ); |
228 | | - if( $cache->isFileCacheGood( /* Assume up to date */ ) ) { |
229 | | - global $wgOut; |
230 | | - /* Check incoming headers to see if client has this cached */ |
231 | | - if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) { |
232 | | - wfDebug( "MediaWiki::initializeSpecialCases(): about to load file cache\n" ); |
233 | | - $cache->loadFromFileCache(); |
234 | | - # Tell $wgOut that output is taken care of |
235 | | - $wgOut->disable(); |
236 | | - # Do any stats increment/watchlist stuff |
237 | | - $article = self::articleFromTitle( $title ); |
238 | | - $article->viewUpdates(); |
239 | | - } |
240 | | - wfProfileOut( __METHOD__ ); |
241 | | - return true; |
242 | | - } |
243 | | - } |
244 | 224 | /* No match to special cases */ |
245 | 225 | wfProfileOut( __METHOD__ ); |
246 | 226 | return false; |
Index: trunk/phase3/index.php |
— | — | @@ -67,13 +67,35 @@ |
68 | 68 | # |
69 | 69 | if( $wgUseAjax && $action == 'ajax' ) { |
70 | 70 | require_once( $IP . '/includes/AjaxDispatcher.php' ); |
71 | | - |
72 | 71 | $dispatcher = new AjaxDispatcher(); |
73 | 72 | $dispatcher->performAction(); |
74 | 73 | $mediaWiki->restInPeace(); |
75 | 74 | exit; |
76 | 75 | } |
77 | 76 | |
| 77 | +if( $wgUseFileCache && isset($wgTitle) ) { |
| 78 | + wfProfileIn( 'main-try-filecache' ); |
| 79 | + if( HTMLFileCache::useFileCache() ) { |
| 80 | + /* Try low-level file cache hit */ |
| 81 | + $cache = new HTMLFileCache( $wgTitle ); |
| 82 | + if( $cache->isFileCacheGood( /* Assume up to date */ ) ) { |
| 83 | + /* Check incoming headers to see if client has this cached */ |
| 84 | + if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) { |
| 85 | + $cache->loadFromFileCache(); |
| 86 | + # Do any stats increment/watchlist stuff |
| 87 | + $wgArticle = self::articleFromTitle( $wgTitle ); |
| 88 | + $wgArticle->viewUpdates(); |
| 89 | + } |
| 90 | + # Tell $wgOut that output is taken care of |
| 91 | + $wgOut->disable(); |
| 92 | + wfProfileOut( 'main-try-filecache' ); |
| 93 | + $mediaWiki->restInPeace(); |
| 94 | + exit; |
| 95 | + } |
| 96 | + } |
| 97 | + wfProfileOut( 'main-try-filecache' ); |
| 98 | +} |
| 99 | + |
78 | 100 | # Setting global variables in mediaWiki |
79 | 101 | $mediaWiki->setVal( 'action', $action ); |
80 | 102 | $mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode ); |
— | — | @@ -89,7 +111,7 @@ |
90 | 112 | $mediaWiki->setVal( 'UsePathInfo', $wgUsePathInfo ); |
91 | 113 | |
92 | 114 | $mediaWiki->initialize( $wgTitle, $wgArticle, $wgOut, $wgUser, $wgRequest ); |
93 | | -$mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgOut ); |
| 115 | +$mediaWiki->finalCleanup( $wgDeferredUpdateList, $wgOut ); |
94 | 116 | |
95 | 117 | # Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup |
96 | 118 | $mediaWiki->doUpdates( $wgPostCommitUpdateList ); |