jenkins-bot has submitted this change and it was merged.

Change subject: Move function from Resources.php to Hooks.php
......................................................................


Move function from Resources.php to Hooks.php

Moves ResourceLoaderRegisterModules function to Hooks.php in preparation
for extension.json.

Change-Id: I5c168b4f13d763064cfa8c2fa71bbbeb9a785e7a
---
M Flow.php
M Hooks.php
M Resources.php
3 files changed, 21 insertions(+), 19 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Flow.php b/Flow.php
index 0f8b458..9a3a6ce 100644
--- a/Flow.php
+++ b/Flow.php
@@ -81,6 +81,8 @@
 $dir = __DIR__ . '/';
 require $dir . 'Resources.php';
 
+$wgHooks['ResourceLoaderRegisterModules'][] = 
'FlowHooks::onResourceLoaderRegisterModules';
+
 $wgMessagesDirs['Flow'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['FlowNamespaces'] = $dir . '/Flow.namespaces.php';
 
diff --git a/Hooks.php b/Hooks.php
index 245bca3..6b5b31f 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -22,6 +22,25 @@
         */
        protected static $abuseFilter;
 
+       public static function onResourceLoaderRegisterModules( ResourceLoader 
&$resourceLoader ) {
+               global $wgFlowEventLogging, $wgResourceModules;
+
+               // Only if EventLogging in Flow is enabled & EventLogging exists
+               if ( $wgFlowEventLogging && class_exists( 
'ResourceLoaderSchemaModule' ) ) {
+                       $resourceLoader->register( 'schema.FlowReplies', array(
+                               'class' => 'ResourceLoaderSchemaModule',
+                               'schema' => 'FlowReplies',
+                               // See 
https://meta.wikimedia.org/wiki/Schema:FlowReplies, below title
+                               'revision' => 10561344,
+                       ) );
+
+                       // Add as dependency to Flow JS
+                       $wgResourceModules['ext.flow']['dependencies'][] = 
'schema.FlowReplies';
+               }
+
+               return true;
+       }
+
        /**
         * Initialized during extension initialization rather than
         * in container so that non-flow pages don't load the container.
diff --git a/Resources.php b/Resources.php
index de03a2b..a96dbda 100644
--- a/Resources.php
+++ b/Resources.php
@@ -523,22 +523,3 @@
                ),
        ) + $mobile,
 );
-
-$wgHooks['ResourceLoaderRegisterModules'][] = function ( ResourceLoader 
&$resourceLoader ) {
-       global $wgFlowEventLogging, $wgResourceModules;
-
-       // Only if EventLogging in Flow is enabled & EventLogging exists
-       if ( $wgFlowEventLogging && class_exists( 'ResourceLoaderSchemaModule' 
) ) {
-               $resourceLoader->register( 'schema.FlowReplies', array(
-                       'class' => 'ResourceLoaderSchemaModule',
-                       'schema' => 'FlowReplies',
-                       // See 
https://meta.wikimedia.org/wiki/Schema:FlowReplies, below title
-                       'revision' => 10561344,
-               ) );
-
-               // Add as dependency to Flow JS
-               $wgResourceModules['ext.flow']['dependencies'][] = 
'schema.FlowReplies';
-       }
-
-       return true;
-};

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5c168b4f13d763064cfa8c2fa71bbbeb9a785e7a
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to