Hoo man has uploaded a new change for review.

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

Change subject: Introduce a "MathEnableWikibaseDataType" config
......................................................................

Introduce a "MathEnableWikibaseDataType" config

Set to true per default.
In order to be able to switch it off in production
for a coordinated deployment.

Change-Id: I520b2ff1ae6dc3bad4b6067f0b673821d3c01cb4
---
M MathWikidataHook.php
M extension.json
2 files changed, 15 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/57/263657/1

diff --git a/MathWikidataHook.php b/MathWikidataHook.php
index 04c488f..62183de 100644
--- a/MathWikidataHook.php
+++ b/MathWikidataHook.php
@@ -3,14 +3,20 @@
 use ValueFormatters\FormatterOptions;
 use ValueParsers\StringParser;
 use Wikibase\Repo\Parsers\WikibaseStringValueNormalizer;
-use Wikibase\Repo\Validators\CompositeValidator;
 use Wikibase\Repo\WikibaseRepo;
 
 class MathWikidataHook {
-       /*
+
+       /**
         * Add Datatype "Math" to the Wikibase Repository
         */
        public static function onWikibaseRepoDataTypes( array 
&$dataTypeDefinitions ) {
+               global $wgMathEnableWikibaseDataType;
+
+               if ( !$wgMathEnableWikibaseDataType ) {
+                       return;
+               }
+
                $dataTypeDefinitions['PT:math'] = array(
                        'value-type'                 => 'string',
                        'validator-factory-callback' => function() {
@@ -42,6 +48,12 @@
         * Add Datatype "Math" to the Wikibase Client
         */
        public static function onWikibaseClientDataTypes( array 
&$dataTypeDefinitions ) {
+               global $wgMathEnableWikibaseDataType;
+
+               if ( !$wgMathEnableWikibaseDataType ) {
+                       return;
+               }
+
                $dataTypeDefinitions['PT:math'] = array(
                        'value-type'                 => 'string',
                        'formatter-factory-callback' => function( $format, 
FormatterOptions $options ) {
diff --git a/extension.json b/extension.json
index b7fcf0c..23a3c5b 100644
--- a/extension.json
+++ b/extension.json
@@ -110,6 +110,7 @@
                        "source",
                        "mathml"
                ],
+               "MathEnableWikibaseDataType": true,
                "Texvc": false,
                "TexvcBackgroundColor": "transparent"
        },

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I520b2ff1ae6dc3bad4b6067f0b673821d3c01cb4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>

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

Reply via email to