[Wiki.php] Minor clean up
authorKrinkle <krinkle@users.mediawiki.org>
Sat, 21 Jan 2012 20:10:35 +0000 (20:10 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Sat, 21 Jan 2012 20:10:35 +0000 (20:10 +0000)
* Comment syntax consistency
* Re-use saved getTitle()
* Doing in separate commit for review ease

includes/Wiki.php

index 13e4f08..eaa3996 100644 (file)
@@ -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__ );