X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=index.php;h=dcea36b5b751ef877a8ccd806ebb0b33dc9f0293;hb=19466ac51ad70629945c3157ce9b0ca51ed50d98;hp=edf28d30dbd53b31f5005dde15ab5d3d411cdc24;hpb=7ead47486d16a9432337f494d97a64e636f7c894;p=lhc%2Fweb%2Fwiklou.git diff --git a/index.php b/index.php index edf28d30db..dcea36b5b7 100644 --- a/index.php +++ b/index.php @@ -13,7 +13,7 @@ * * ---------- * - * Copyright (C) 2001-2009 Magnus Manske, Brion Vibber, Lee Daniel Crocker, + * Copyright (C) 2001-2010 Magnus Manske, Brion Vibber, Lee Daniel Crocker, * Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason, * Niklas Laxström, Domas Mituzas, Rob Church, Yuri Astrakhan, Aryeh Gregor, * Aaron Schulz and others. @@ -36,13 +36,11 @@ * @file */ - # Initialise common code $preIP = dirname( __FILE__ ); require_once( "$preIP/includes/WebStart.php" ); # Initialize MediaWiki base class -require_once( "$preIP/includes/Wiki.php" ); $mediaWiki = new MediaWiki(); wfProfileIn( 'main-misc-setup' ); @@ -57,8 +55,9 @@ if( !is_null( $maxLag ) && !$mediaWiki->checkMaxLag( $maxLag ) ) { $action = $wgRequest->getVal( 'action', 'view' ); $title = $wgRequest->getVal( 'title' ); +# Set title from request parameters $wgTitle = $mediaWiki->checkInitialQueries( $title, $action ); -if( $wgTitle === NULL ) { +if( $wgTitle === null ) { unset( $wgTitle ); } @@ -80,26 +79,20 @@ if( $wgUseFileCache && isset( $wgTitle ) ) { // Raw pages should handle cache control on their own, // even when using file cache. This reduces hits from clients. if( $action != 'raw' && HTMLFileCache::useFileCache() ) { - /* Set the title from the page ID if needed... */ - if( $curid = $wgRequest->getInt('curid') ) { - $wgTitle = Title::newFromID( $curid ); - } - if( !is_null($wgTitle) ) { - /* Try low-level file cache hit */ - $cache = new HTMLFileCache( $wgTitle, $action ); - 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 = MediaWiki::articleFromTitle( $wgTitle ); - $wgArticle->viewUpdates(); - # Tell $wgOut that output is taken care of - wfProfileOut( 'main-try-filecache' ); - $mediaWiki->restInPeace(); - exit; + /* Try low-level file cache hit */ + $cache = new HTMLFileCache( $wgTitle, $action ); + 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 = MediaWiki::articleFromTitle( $wgTitle ); + $wgArticle->viewUpdates(); + # Tell $wgOut that output is taken care of + wfProfileOut( 'main-try-filecache' ); + $mediaWiki->restInPeace(); + exit; } } wfProfileOut( 'main-try-filecache' );