Seb35 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/299412

Change subject: Correct path for extension.json in case of multiversion
......................................................................

Correct path for extension.json in case of multiversion
---
M MediaWikiFarm.php
M src/MediaWikiFarm.php
2 files changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm 
refs/changes/12/299412/1

diff --git a/MediaWikiFarm.php b/MediaWikiFarm.php
index aa2b861..7e0c71f 100644
--- a/MediaWikiFarm.php
+++ b/MediaWikiFarm.php
@@ -25,3 +25,4 @@
        # Load MediaWiki configuration
        require_once MediaWikiFarm::getInstance()->loadConfigDirectory();
 }
+
diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index ee4a288..6ccb7b6 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -212,6 +212,12 @@
                if( $this->unusable )
                        return;
                
+               # Register this extension MediaWikiFarm to appear in 
Special:Version
+               if( function_exists( 'wfLoadExtension' ) ) {
+                       wfLoadExtension( 'MediaWikiFarm', $this->codeDir ? 
$this->farmDir . '/extension.json' : null );
+                       unset( 
$this->params['globals']['extensions']['MediaWikiFarm']['_loading'] );
+               }
+               
                // Load extensions with the wfLoadExtension mechanism
                foreach( $this->params['globals']['extensions'] as $extension 
=> $value ) {
                        
@@ -590,9 +596,6 @@
                        # Extract from the general configuration skin and 
extension configuration
                        $this->extractSkinsAndExtensions();
                        
-                       # Register this extension MediaWikiFarm to appear in 
Special:Version
-                       $globals['extensions']['MediaWikiFarm'] = array( 
'_loading' => 'wfLoadExtension' );
-                       
                        # Save this configuration in a serialised file
                        $this->cacheFile( $globals, $cacheFile );
                }
@@ -756,7 +759,7 @@
                        return null;
                
                # An extension.json/skin.json file is in the directory -> 
assume it is the loading mechanism
-               if( is_file( 
$this->params['code'].'/'.$type.'s/'.$name.'/'.$type.'.json' ) )
+               if( function_exists( 'wfLoad'.ucfirst($type) ) && is_file( 
$this->params['code'].'/'.$type.'s/'.$name.'/'.$type.'.json' ) )
                        return 'wfLoad'.ucfirst($type);
                
                # A MyExtension.php file is in the directory -> assume it is 
the loading mechanism

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia74a21caf51c0076fa5b84fcd559a99efe64996a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MediaWikiFarm
Gerrit-Branch: master
Gerrit-Owner: Seb35 <seb35wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to