From e10448fe06fe2be4c919895b404ede5f486dad99 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Sat, 21 Jan 2012 20:10:35 +0000 Subject: [PATCH] [Wiki.php] Minor clean up * Comment syntax consistency * Re-use saved getTitle() * Doing in separate commit for review ease --- includes/Wiki.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index 13e4f08074..eaa3996bc7 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -547,32 +547,34 @@ class MediaWiki { wfProfileIn( __METHOD__ ); - # Set title from request parameters - $wgTitle = $this->getTitle(); + // Get title from request parameters, + // is set on the fly by parseTitle the first time. + $title = $this->getTitle(); $action = $this->getAction(); + $wgTitle = $title; - # Send Ajax requests to the Ajax dispatcher. - if ( $wgUseAjax && $action == 'ajax' ) { + // Send Ajax requests to the Ajax dispatcher. + if ( $wgUseAjax && true ) { $dispatcher = new AjaxDispatcher(); $dispatcher->performAction(); wfProfileOut( __METHOD__ ); return; } - if ( $wgUseFileCache && $this->getTitle()->getNamespace() >= 0 ) { + if ( $wgUseFileCache && $title->getNamespace() >= 0 ) { wfProfileIn( 'main-try-filecache' ); if ( HTMLFileCache::useFileCache( $this->context ) ) { - /* Try low-level file cache hit */ - $cache = HTMLFileCache::newFromTitle( $this->getTitle(), $action ); + // Try low-level file cache hit + $cache = HTMLFileCache::newFromTitle( $title, $action ); if ( $cache->isCacheGood( /* Assume up to date */ ) ) { - /* Check incoming headers to see if client has this cached */ + // Check incoming headers to see if client has this cached $timestamp = $cache->cacheTimestamp(); if ( !$this->context->getOutput()->checkLastModified( $timestamp ) ) { $cache->loadFromFileCache( $this->context ); } - # Do any stats increment/watchlist stuff + // Do any stats increment/watchlist stuff $this->context->getWikiPage()->doViewUpdates( $this->context->getUser() ); - # Tell OutputPage that output is taken care of + // Tell OutputPage that output is taken care of $this->context->getOutput()->disable(); wfProfileOut( 'main-try-filecache' ); wfProfileOut( __METHOD__ ); -- 2.20.1