r78797 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78796‎ | r78797 | r78798 >
Date:15:24, 22 December 2010
Author:ialex
Status:ok
Tags:
Comment:
No need to recreate a second object if we already have the good one ;)
Modified paths:
  • /trunk/phase3/maintenance/updateSpecialPages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updateSpecialPages.php
@@ -83,11 +83,15 @@
8484 $this->output( "No such special page: $special\n" );
8585 exit;
8686 }
87 - if ( !class_exists( $class ) ) {
88 - $file = $specialObj->getFile();
89 - require_once( $file );
 87+ if ( $specialObj instanceof QueryPage ) {
 88+ $queryPage = $specialObj;
 89+ } else {
 90+ if ( !class_exists( $class ) ) {
 91+ $file = $specialObj->getFile();
 92+ require_once( $file );
 93+ }
 94+ $queryPage = new $class;
9095 }
91 - $queryPage = new $class;
9296
9397 if ( !$this->hasOption( 'only' ) || $this->getOption( 'only' ) == $queryPage->getName() ) {
9498 $this->output( sprintf( '%-30s ', $special ) );

Status & tagging log