From 82ee110998ea8648a1f7b1c3c7435a0a1f152cf1 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 2 Apr 2011 18:59:47 +0000 Subject: [PATCH] Made index.php's profiling cosistent with other entry scripts --- index.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/index.php b/index.php index ff1bd0de9c..50c2ef5421 100644 --- a/index.php +++ b/index.php @@ -38,14 +38,14 @@ */ # 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 $mediaWiki = new MediaWiki(); -wfProfileIn( 'main-misc-setup' ); - $maxLag = $wgRequest->getVal( 'maxlag' ); if( !is_null( $maxLag ) && !$mediaWiki->checkMaxLag( $maxLag ) ) { exit; @@ -53,21 +53,21 @@ if( !is_null( $maxLag ) && !$mediaWiki->checkMaxLag( $maxLag ) ) { # Set title from request parameters $wgTitle = $mediaWiki->checkInitialQueries( $wgRequest ); - -wfProfileOut( 'main-misc-setup' ); - $action = $wgRequest->getVal( 'action', 'view' ); +wfProfileOut( 'index.php-setup' ); + # Send Ajax requests to the Ajax dispatcher. if( $wgUseAjax && $action == 'ajax' ) { $dispatcher = new AjaxDispatcher(); $dispatcher->performAction(); + wfProfileOut( 'index.php' ); $mediaWiki->restInPeace(); exit; } if( $wgUseFileCache && $wgTitle !== null ) { - wfProfileIn( 'main-try-filecache' ); + 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() ) { @@ -83,13 +83,14 @@ if( $wgUseFileCache && $wgTitle !== null ) { $wgArticle->viewUpdates(); # Tell $wgOut that output is taken care of $wgOut->disable(); - wfProfileOut( 'main-try-filecache' ); + 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 @@ -103,4 +104,7 @@ $mediaWiki->setVal( 'UsePathInfo', $wgUsePathInfo ); $mediaWiki->performRequestForTitle( $wgTitle, $wgArticle, $wgOut, $wgUser, $wgRequest ); $mediaWiki->finalCleanup( $wgOut ); + +wfProfileOut( 'index.php' ); + $mediaWiki->restInPeace(); -- 2.20.1