Paladox has uploaded a new change for review.

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

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 preperation
for extension.json.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/45/213845/1

diff --git a/Flow.php b/Flow.php
index 88917f4..17bb5a4 100644
--- a/Flow.php
+++ b/Flow.php
@@ -69,7 +69,9 @@
        'version' => '1.0',
 );
 
-require_once __DIR__ . '/defines.php';
+// Constants
+define( 'RC_FLOW', 142 ); // Random number chosen.  Can be replaced with 
rc_source; see bug 72157.
+define( 'NS_TOPIC', 2600 );
 
 // Only matters when $wgCapitalLinks has non-default setting, but always safe
 $wgCapitalLinkOverrides[NS_TOPIC] = true;
@@ -81,6 +83,8 @@
 $dir = __DIR__ . '/';
 require $dir . 'Resources.php';
 
+$wgHooks['ResourceLoaderRegisterModules'][] = 
'FlowHooks::onResourceLoaderRegisterModules';
+
 $wgMessagesDirs['Flow'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['Flow'] = $dir . 'Flow.i18n.php';
 $wgExtensionMessagesFiles['FlowNamespaces'] = $dir . '/Flow.namespaces.php';
diff --git a/Hooks.php b/Hooks.php
index 245bca3..123de72 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -22,6 +22,25 @@
         */
        protected static $abuseFilter;
 
+       public static 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;
+       }
+
        /**
         * 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: newchange
Gerrit-Change-Id: I5c168b4f13d763064cfa8c2fa71bbbeb9a785e7a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>

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

Reply via email to