MarkAHershberger has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334647 )

Change subject: Allow end user to enable or disable extensions w/ ext. 
dependencies
......................................................................

Allow end user to enable or disable extensions w/ ext. dependencies

Because of the way the array_merge strategy works for extension.json,
if a config is set to an array in extension.json, it cannot be
overriden in LocalSettings.php.

This change disables those modes that depend on external services by
default (mathml and latexml).  They can be enabled by using

    $wgMathValidModes = [ 'latexml' => true, 'mathml' => true ];

Bug: T150011
Change-Id: I5622eca17af6d718b6fbb1919e0b970e9a506e67
---
M MathRenderer.php
M extension.json
2 files changed, 12 insertions(+), 6 deletions(-)


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

diff --git a/MathRenderer.php b/MathRenderer.php
index e5ed804..75b6fbc 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -665,7 +665,12 @@
 
        public static function getValidModes() {
                global $wgMathValidModes;
-               return array_map( "MathHooks::mathModeToString", 
$wgMathValidModes );
+               $ret = [];
+               foreach( array_map( "MathHooks::mathModeToString",
+                                                       array_keys( 
array_filter( $wgMathValidModes ) ) ) as $trash => $mode ) {
+                       $ret[MathHooks::mathModeToHashKey( $mode )] = $mode;
+               }
+               return $ret;
        }
 
        public static function getDisableTexFilter() {
diff --git a/extension.json b/extension.json
index 4f2a525..4350c6c 100644
--- a/extension.json
+++ b/extension.json
@@ -111,11 +111,12 @@
                "MathConcurrentReqs": 50,
                "MathPath": false,
                "MathTexvcCheckExecutable": false,
-               "MathValidModes": [
-                       "png",
-                       "source",
-                       "mathml"
-               ],
+               "MathValidModes": {
+                       "png": true,
+                       "source": true,
+                       "mathml": false,
+                       "latexml": false
+               },
                "MathEnableWikibaseDataType": true,
                "Texvc": false,
                "TexvcBackgroundColor": "transparent"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5622eca17af6d718b6fbb1919e0b970e9a506e67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: REL1_27
Gerrit-Owner: MarkAHershberger <[email protected]>

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

Reply via email to