// about the possible different language variants
if( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 )
$wgContLang->findVariantLink( $title, $ret );
-
}
if( ( $oldid = $wgRequest->getInt( 'oldid' ) )
&& ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) ) {
/* actions that need to be made when we have a special pages */
SpecialPage::executePath( $title );
} else {
- /* Try low-level file cache hit */
- if( $title->getNamespace() != NS_MEDIAWIKI && HTMLFileCache::useFileCache() ) {
- $cache = new HTMLFileCache( $title );
- if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {
- global $wgOut;
- /* Check incoming headers to see if client has this cached */
- if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) {
- wfDebug( "MediaWiki::initializeSpecialCases(): about to load file cache\n" );
- $cache->loadFromFileCache();
- # Tell $wgOut that output is taken care of
- $wgOut->disable();
- # Do any stats increment/watchlist stuff
- $article = self::articleFromTitle( $title );
- $article->viewUpdates();
- }
- wfProfileOut( __METHOD__ );
- return true;
- }
- }
/* No match to special cases */
wfProfileOut( __METHOD__ );
return false;
#
if( $wgUseAjax && $action == 'ajax' ) {
require_once( $IP . '/includes/AjaxDispatcher.php' );
-
$dispatcher = new AjaxDispatcher();
$dispatcher->performAction();
$mediaWiki->restInPeace();
exit;
}
+if( $wgUseFileCache && isset($wgTitle) ) {
+ wfProfileIn( 'main-try-filecache' );
+ if( HTMLFileCache::useFileCache() ) {
+ /* Try low-level file cache hit */
+ $cache = new HTMLFileCache( $wgTitle );
+ if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {
+ /* 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();
+ }
+ # Tell $wgOut that output is taken care of
+ $wgOut->disable();
+ wfProfileOut( 'main-try-filecache' );
+ $mediaWiki->restInPeace();
+ exit;
+ }
+ }
+ wfProfileOut( 'main-try-filecache' );
+}
+
# Setting global variables in mediaWiki
$mediaWiki->setVal( 'action', $action );
$mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode );
$mediaWiki->setVal( 'UsePathInfo', $wgUsePathInfo );
$mediaWiki->initialize( $wgTitle, $wgArticle, $wgOut, $wgUser, $wgRequest );
-$mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgOut );
+$mediaWiki->finalCleanup( $wgDeferredUpdateList, $wgOut );
# Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
$mediaWiki->doUpdates( $wgPostCommitUpdateList );