Legoktm has uploaded a new change for review.

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

Change subject: Remove GlobalUserPageLoadRemoteModules configuration option
......................................................................

Remove GlobalUserPageLoadRemoteModules configuration option

After further thought, this actually isn't that scary, since only
parserfunctions or tag extensions can add to the ParserOutput.
So, just enable the feature by default since it doesn't make sense
not to.

Change-Id: I9614d55e7a7999267669716d4e99ed1438098edf
---
M GlobalUserPage.body.php
M GlobalUserPage.php
2 files changed, 18 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalUserPage 
refs/changes/65/165965/1

diff --git a/GlobalUserPage.body.php b/GlobalUserPage.body.php
index 20b954b..162ad48 100644
--- a/GlobalUserPage.body.php
+++ b/GlobalUserPage.body.php
@@ -49,33 +49,30 @@
                        );
                }
 
-               // Scary ResourceLoader things...
-               $this->loadExtensionModules( $out, $parsedOutput );
+               // Load ParserOutput modules...
+               $this->loadModules( $out, $parsedOutput );
        }
 
        /**
-        * Attempts to load modules provided by extensions
-        * through the ParserOutput on the local wiki, if
-        * they exist. This entire feature is experimental
-        * and disabled by default.
+        * Attempts to load modules through the
+        * ParserOutput on the local wiki, if
+        * they exist.
         *
         * @param OutputPage $out
         * @param array $parsedOutput
         */
-       private function loadExtensionModules( OutputPage $out, array 
$parsedOutput ) {
-               if ( $this->config->get( 'GlobalUserPageLoadRemoteModules' ) ) {
-                       $rl = $out->getResourceLoader();
-                       $map = array(
-                               'modules' => 'addModules',
-                               'modulestyles' => 'addModuleStyles',
-                               'modulescripts' => 'addModuleScripts',
-                               //'modulemessages' => 'addModuleMessages', // 
@todo how does this work?
-                       );
-                       foreach ( $map as $type => $func ) {
-                               foreach ( $parsedOutput[$type] as $module ) {
-                                       if ( strpos( $module, 'ext.' ) === 0 && 
$rl->getModule( $module ) !== null ) {
-                                               $out->$func( $module );
-                                       }
+       private function loadModules( OutputPage $out, array $parsedOutput ) {
+               $rl = $out->getResourceLoader();
+               $map = array(
+                       'modules' => 'addModules',
+                       'modulestyles' => 'addModuleStyles',
+                       'modulescripts' => 'addModuleScripts',
+                       'modulemessages' => 'addModuleMessages',
+               );
+               foreach ( $map as $type => $func ) {
+                       foreach ( $parsedOutput[$type] as $module ) {
+                               if ( $rl->getModule( $module ) !== null ) {
+                                       $out->$func( $module );
                                }
                        }
                }
diff --git a/GlobalUserPage.php b/GlobalUserPage.php
index e8f3424..5e4f534 100644
--- a/GlobalUserPage.php
+++ b/GlobalUserPage.php
@@ -38,13 +38,6 @@
 $wgGlobalUserPageAPIUrl = 'http://www.shoutwiki.com/w/api.php';
 
 /**
- * Set this to true to load modules from the
- * parsed output. Will only load those that start
- * with "ext."
- */
-$wgGlobalUserPageLoadRemoteModules = false;
-
-/**
  * By default enables global userpage for all users
  * @see https://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions
  */
@@ -79,7 +72,7 @@
 $wgExtensionCredits['other'][] = array(
        'path' => __FILE__,
        'name' => 'GlobalUserPage',
-       'version' => '0.8',
+       'version' => '0.9',
        'author' => array( 'Kunal Mehta', 'Jack Phoenix' ),
        'url' => 'https://www.mediawiki.org/wiki/Extension:GlobalUserPage',
        'descriptionmsg' => 'globaluserpage-desc',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9614d55e7a7999267669716d4e99ed1438098edf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalUserPage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

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

Reply via email to