J has submitted this change and it was merged.

Change subject: Register resources with absolute path
......................................................................


Register resources with absolute path

that way extensions can also be in a path other than $IP/extensions.

Bug: 45918
Change-Id: I8ed60acf438fc895fe7153746833b4e9f4b04fec
---
M MwEmbedResourceManager.php
M MwEmbedSupport.php
2 files changed, 7 insertions(+), 4 deletions(-)

Approvals:
  Mdale: Looks good to me, but someone else must approve
  J: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/MwEmbedResourceManager.php b/MwEmbedResourceManager.php
index ada082b..5ca4fe9 100644
--- a/MwEmbedResourceManager.php
+++ b/MwEmbedResourceManager.php
@@ -19,12 +19,15 @@
         * @param $mwEmbedResourcePath string
         * @throws MWException
         */
-       public static function register( $mwEmbedResourcePath ) {
+       public static function register( $localResourcePath ) {
                global $IP, $wgExtensionMessagesFiles;
-               $localResourcePath = $IP .'/' . $mwEmbedResourcePath;
+
+               $mwEmbedResourcePath = substr( $localResourcePath, strlen( $IP 
. '/') );
+
                // Get the module name from the end of the path:
                $modulePathParts = explode( '/', $mwEmbedResourcePath );
                $moduleName =  array_pop ( $modulePathParts );
+
                if( !is_dir( $localResourcePath ) ){
                        throw new MWException( __METHOD__ . " not given 
readable path: "  . htmlspecialchars( $localResourcePath ) );
                }
diff --git a/MwEmbedSupport.php b/MwEmbedSupport.php
index da93165..baf74c4 100644
--- a/MwEmbedSupport.php
+++ b/MwEmbedSupport.php
@@ -53,7 +53,7 @@
 $wgHooks['ResourceLoaderGetConfigVars'][] =  
'MwEmbedResourceManager::registerConfigVars';
 
 // Register the core MwEmbed Support Module:
-MwEmbedResourceManager::register( 
'extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport' );
+MwEmbedResourceManager::register( dirname(__FILE__) . 
'/MwEmbedModules/MwEmbedSupport' );
 
 // Register the MwEmbed 'mediaWiki' Module:
-MwEmbedResourceManager::register( 
'extensions/MwEmbedSupport/MwEmbedModules/MediaWikiSupport' );
+MwEmbedResourceManager::register( dirname(__FILE__) . 
'/MwEmbedModules/MediaWikiSupport' );

-- 
To view, visit https://gerrit.wikimedia.org/r/69479
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8ed60acf438fc895fe7153746833b4e9f4b04fec
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MwEmbedSupport
Gerrit-Branch: master
Gerrit-Owner: J <[email protected]>
Gerrit-Reviewer: J <[email protected]>
Gerrit-Reviewer: Mdale <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to