r44891 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44890‎ | r44891 | r44892 >
Date:07:26, 22 December 2008
Author:aaron
Status:deferred
Tags:
Comment:
Cut way down on profile time by delaying isInstalled() checks
Modified paths:
  • /trunk/extensions/Configure/Configure.api.php (modified) (history)
  • /trunk/extensions/Configure/Configure.settings.php (modified) (history)
  • /trunk/extensions/Configure/SpecialExtensions.php (modified) (history)
  • /trunk/extensions/Configure/findSettings.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.api.php
@@ -103,6 +103,7 @@
104104 $conf = ConfigurationSettings::singleton( CONF_SETTINGS_EXT );
105105 $ret = array();
106106 foreach ( $conf->getAllExtensionsObjects() as $ext ) {
 107+ if( !$ext->isInstalled() ) continue; // must exist
107108 $extArr = array();
108109 $extArr['name'] = $ext->getName();
109110 if ( $ext->isActivated() )
Index: trunk/extensions/Configure/findSettings.php
@@ -69,6 +69,7 @@
7070 'wgTitleBlacklist',
7171 );
7272 foreach ( $exts as $ext ) {
 73+ if( !$ext->isInstalled() ) continue; // must exist
7374 $file = file_get_contents( $ext->getFile() );
7475 $name = $ext->getName();
7576 $m = array();
Index: trunk/extensions/Configure/Configure.settings.php
@@ -68,9 +68,9 @@
6969 usort( $extensions, array( __CLASS__, 'compExt' ) );
7070 foreach( $extensions as $ext ) {
7171 $ext = new WebExtension( $ext );
72 - if( $ext->isInstalled() ) {
 72+ #if( $ext->isInstalled() ) {
7373 $list[] = $ext;
74 - }
 74+ #}
7575 }
7676 wfProfileOut( __METHOD__ );
7777 return $list;
Index: trunk/extensions/Configure/SpecialExtensions.php
@@ -61,6 +61,7 @@
6262 return array();
6363 $arr = array();
6464 foreach ( $this->mConfSettings->getAllExtensionsObjects() as $ext ) {
 65+ if( !$ext->isInstalled() ) continue; // must exist
6566 if ( $ext->useVariable() )
6667 continue;
6768 if ( $wgRequest->getCheck( $ext->getCheckName() ) )
@@ -92,6 +93,7 @@
9394 $ret = '';
9495 $globalDone = false;
9596 foreach ( $this->mConfSettings->getAllExtensionsObjects() as $ext ) {
 97+ if( !$ext->isInstalled() ) continue; // must exist
9698 $settings = $ext->getSettings();
9799 foreach ( $settings as $setting => $type ) {
98100 if ( !isset( $GLOBALS[$setting] ) && !isset( $this->conf[$setting] ) && file_exists( $ext->getFile() ) ) {

Status & tagging log