r109688 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109687‎ | r109688 | r109689 >
Date:20:10, 21 January 2012
Author:krinkle
Status:resolved
Tags:core 
Comment:
[Wiki.php] Minor clean up
* Comment syntax consistency
* Re-use saved getTitle()
* Doing in separate commit for review ease
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -547,32 +547,34 @@
548548
549549 wfProfileIn( __METHOD__ );
550550
551 - # Set title from request parameters
552 - $wgTitle = $this->getTitle();
 551+ // Get title from request parameters,
 552+ // is set on the fly by parseTitle the first time.
 553+ $title = $this->getTitle();
553554 $action = $this->getAction();
 555+ $wgTitle = $title;
554556
555 - # Send Ajax requests to the Ajax dispatcher.
556 - if ( $wgUseAjax && $action == 'ajax' ) {
 557+ // Send Ajax requests to the Ajax dispatcher.
 558+ if ( $wgUseAjax && true ) {
557559 $dispatcher = new AjaxDispatcher();
558560 $dispatcher->performAction();
559561 wfProfileOut( __METHOD__ );
560562 return;
561563 }
562564
563 - if ( $wgUseFileCache && $this->getTitle()->getNamespace() >= 0 ) {
 565+ if ( $wgUseFileCache && $title->getNamespace() >= 0 ) {
564566 wfProfileIn( 'main-try-filecache' );
565567 if ( HTMLFileCache::useFileCache( $this->context ) ) {
566 - /* Try low-level file cache hit */
567 - $cache = HTMLFileCache::newFromTitle( $this->getTitle(), $action );
 568+ // Try low-level file cache hit
 569+ $cache = HTMLFileCache::newFromTitle( $title, $action );
568570 if ( $cache->isCacheGood( /* Assume up to date */ ) ) {
569 - /* Check incoming headers to see if client has this cached */
 571+ // Check incoming headers to see if client has this cached
570572 $timestamp = $cache->cacheTimestamp();
571573 if ( !$this->context->getOutput()->checkLastModified( $timestamp ) ) {
572574 $cache->loadFromFileCache( $this->context );
573575 }
574 - # Do any stats increment/watchlist stuff
 576+ // Do any stats increment/watchlist stuff
575577 $this->context->getWikiPage()->doViewUpdates( $this->context->getUser() );
576 - # Tell OutputPage that output is taken care of
 578+ // Tell OutputPage that output is taken care of
577579 $this->context->getOutput()->disable();
578580 wfProfileOut( 'main-try-filecache' );
579581 wfProfileOut( __METHOD__ );

Follow-up revisions

RevisionCommit summaryAuthorDate
r109689[Action] Fix action=ajax...krinkle20:13, 21 January 2012

Status & tagging log