Legoktm has uploaded a new change for review.

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

Change subject: installer: Read from extension.json if possible
......................................................................

installer: Read from extension.json if possible

We still have to keep in the hacky include code to support extensions
not using extension registration yet.

Bug: T94668
Change-Id: Ifedbf8026d46e376181e957725cd91d365295fcb
---
M includes/installer/Installer.php
1 file changed, 16 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/201417/1

diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 4c31387..985ece8 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -1489,16 +1489,31 @@
                 */
                global $wgAutoloadClasses;
                $wgAutoloadClasses = array();
+               $queue = array();
 
                require "$IP/includes/DefaultSettings.php";
 
                foreach ( $exts as $e ) {
-                       require_once "$IP/extensions/$e/$e.php";
+                       if ( file_exists( "$IP/extensions/$e/extension.json" ) 
) {
+                               $queue["$IP/extensions/$e/extension.json"] = 1;
+                       } else {
+                               require_once "$IP/extensions/$e/$e.php";
+                       }
                }
+
+               $registry = new ExtensionRegistry();
+               $data = $registry->readFromQueue( $queue );
+               $wgAutoloadClasses += $data['autoload'];
 
                $hooksWeWant = isset( $wgHooks['LoadExtensionSchemaUpdates'] ) ?
                        $wgHooks['LoadExtensionSchemaUpdates'] : array();
 
+               if ( isset( 
$data['globals']['wgHooks']['LoadExtensionSchemaUpdates'] ) ) {
+                       $hooksWeWant = array_merge_recursive(
+                               $hooksWeWant,
+                               
$data['globals']['wgHooks']['LoadExtensionSchemaUpdates']
+                       );
+               }
                // Unset everyone else's hooks. Lord knows what someone might 
be doing
                // in ParserFirstCallInit (see bug 27171)
                $GLOBALS['wgHooks'] = array( 'LoadExtensionSchemaUpdates' => 
$hooksWeWant );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifedbf8026d46e376181e957725cd91d365295fcb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

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

Reply via email to