X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=index.php;h=50c2ef5421cb41a23817d0545790ca74ca115fe9;hb=7d7d6cb56a001c74f3b8103aea73513837f12ce9;hp=1c24f5a5e3e2e8e43ac540d5a3d6a5d7c43aa596;hpb=43c6f33ddb74283a9e798dc804505a06d283c6d4;p=lhc%2Fweb%2Fwiklou.git diff --git a/index.php b/index.php index 1c24f5a5e3..50c2ef5421 100644 --- a/index.php +++ b/index.php @@ -13,10 +13,11 @@ * * ---------- * - * Copyright (C) 2001-2008 Magnus Manske, Brion Vibber, Lee Daniel Crocker, + * Copyright (C) 2001-2011 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. + * Aaron Schulz, Andrew Garrett, Raimond Spekking, Alexandre Emsenhuber + * Siebrand Mazeland, Chad Horohoe, Roan Kattouw and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,49 +33,41 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html + * + * @file */ - # Initialise common code -$preIP = dirname( __FILE__ ); -require_once( "$preIP/includes/WebStart.php" ); +require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); + +wfProfileIn( 'index.php' ); +wfProfileIn( 'index.php-setup' ); # Initialize MediaWiki base class -require_once( "$preIP/includes/Wiki.php" ); $mediaWiki = new MediaWiki(); -wfProfileIn( 'main-misc-setup' ); -OutputPage::setEncodings(); # Not really used yet - $maxLag = $wgRequest->getVal( 'maxlag' ); -if( !is_null($maxLag) && !$mediaWiki->checkMaxLag( $maxLag ) ) { +if( !is_null( $maxLag ) && !$mediaWiki->checkMaxLag( $maxLag ) ) { exit; } -# Query string fields +# Set title from request parameters +$wgTitle = $mediaWiki->checkInitialQueries( $wgRequest ); $action = $wgRequest->getVal( 'action', 'view' ); -$title = $wgRequest->getVal( 'title' ); -$wgTitle = $mediaWiki->checkInitialQueries( $title, $action ); -if( $wgTitle === NULL ) { - unset( $wgTitle ); -} - -wfProfileOut( 'main-misc-setup' ); +wfProfileOut( 'index.php-setup' ); -# # Send Ajax requests to the Ajax dispatcher. -# if( $wgUseAjax && $action == 'ajax' ) { - require_once( $IP . '/includes/AjaxDispatcher.php' ); $dispatcher = new AjaxDispatcher(); $dispatcher->performAction(); + wfProfileOut( 'index.php' ); $mediaWiki->restInPeace(); exit; } -if( $wgUseFileCache && isset($wgTitle) ) { - wfProfileIn( 'main-try-filecache' ); +if( $wgUseFileCache && $wgTitle !== null ) { + wfProfileIn( 'index.php-filecache' ); // Raw pages should handle cache control on their own, // even when using file cache. This reduces hits from clients. if( $action != 'raw' && HTMLFileCache::useFileCache() ) { @@ -89,33 +82,29 @@ if( $wgUseFileCache && isset($wgTitle) ) { $wgArticle = MediaWiki::articleFromTitle( $wgTitle ); $wgArticle->viewUpdates(); # Tell $wgOut that output is taken care of - wfProfileOut( 'main-try-filecache' ); + $wgOut->disable(); + wfProfileOut( 'index.php-filecache' ); + $mediaWiki->finalCleanup( $wgOut ); + wfProfileOut( 'index.php' ); $mediaWiki->restInPeace(); exit; } } - wfProfileOut( 'main-try-filecache' ); + wfProfileOut( 'index.php-filecache' ); } # Setting global variables in mediaWiki -$mediaWiki->setVal( 'action', $action ); -$mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode ); -$mediaWiki->setVal( 'DisabledActions', $wgDisabledActions ); $mediaWiki->setVal( 'DisableHardRedirects', $wgDisableHardRedirects ); -$mediaWiki->setVal( 'DisableInternalSearch', $wgDisableInternalSearch ); $mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf ); $mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf ); -$mediaWiki->setVal( 'JobRunRate', $wgJobRunRate ); $mediaWiki->setVal( 'Server', $wgServer ); $mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage ); $mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor ); $mediaWiki->setVal( 'UsePathInfo', $wgUsePathInfo ); -$mediaWiki->initialize( $wgTitle, $wgArticle, $wgOut, $wgUser, $wgRequest ); -$mediaWiki->finalCleanup( $wgDeferredUpdateList, $wgOut ); +$mediaWiki->performRequestForTitle( $wgTitle, $wgArticle, $wgOut, $wgUser, $wgRequest ); +$mediaWiki->finalCleanup( $wgOut ); -# Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup -$mediaWiki->doUpdates( $wgPostCommitUpdateList ); +wfProfileOut( 'index.php' ); $mediaWiki->restInPeace(); -