r113491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113490‎ | r113491 | r113492 >
Date:17:54, 9 March 2012
Author:j
Status:deferred
Tags:
Comment:
compute remoteExtPath once per module
Modified paths:
  • /trunk/extensions/MwEmbedSupport/MwEmbedResourceManager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MwEmbedSupport/MwEmbedResourceManager.php
@@ -93,9 +93,12 @@
9494 global $IP, $wgEnableMwEmbedStandAlone, $wgScriptPath;
9595 // Register all the resources with the resource loader
9696 foreach( self::$moduleSet as $path => $modules ) {
 97+ //remove 'extension' prefix from path
 98+ $remoteExtPath = explode( '/', $path );
 99+ array_shift( $remoteExtPath );
 100+ $remoteExtPath = implode( '/', $remoteExtPath);
97101 foreach ( $modules as $name => $resources ) {
98 - //remove 'extension' prefix from path
99 - $resources['remoteExtPath'] = implode( '/', array_shift(explode( '/', $path )));
 102+ $resources['remoteExtPath'] = $remoteExtPath;
100103
101104 // Register the resource with MwEmbed extended class if in standAlone resource loader mode:
102105 if( $wgEnableMwEmbedStandAlone === true ){

Status & tagging log