[MediaWiki-commits] [Gerrit] Move function from Resources.php to Hooks.php - change (mediawiki...Flow)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/214424 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 (cherry picked from commit 8f0ebd655882fd1d773e1a9cb1645bdd90439b86) --- M Flow.php M Hooks.php M Resources.php 3 files changed, 21 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/24/214424/1 diff --git a/Flow.php b/Flow.php index e66bd23..4dc9e4d 100644 --- a/Flow.php +++ b/Flow.php @@ -77,6 +77,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 8151b58..6360b8a 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 67637fb..3482521 100644 --- a/Resources.php +++ b/Resources.php @@ -527,22 +527,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/214424 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: REL1_25 Gerrit-Owner: Paladox thomasmulhall...@yahoo.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move function from Resources.php to Hooks.php - change (mediawiki...Flow)
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 thomasmulhall...@yahoo.com Gerrit-Reviewer: Alex Monk kren...@gmail.com Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Mattflaschen mflasc...@wikimedia.org Gerrit-Reviewer: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move function from Resources.php to Hooks.php - change (mediawiki...Flow)
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