mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-09-23 10:21:31 +00:00
Remove references to VisualEditorFullRestbaseURL
The VisualEditorFullRestbaseURL config variable is no longer used by VisualEditor and is no longer set in Wikimedia production configuration. Bug: T344458 Change-Id: Ifd0b9f919f7a9bdceb8761125588fe72e8d1e50c
This commit is contained in:
parent
17c5d8a734
commit
8c05a71beb
|
@ -131,7 +131,7 @@
|
|||
"value": "https://mathoid-beta.wmflabs.org"
|
||||
},
|
||||
"MathUseInternalRestbasePath": {
|
||||
"description": "Whether to allow to use of internal RESTBase path instead of $wgMathFullRestbaseURL and $wgVisualEditorFullRestbaseURL. Set false if you want to use external RESTBase in any case.",
|
||||
"description": "Whether to allow to use of internal RESTBase path instead of $wgMathFullRestbaseURL. Set false if you want to use external RESTBase in any case.",
|
||||
"value": true,
|
||||
"public": true
|
||||
},
|
||||
|
|
|
@ -30,24 +30,18 @@ class Hooks implements
|
|||
public static function onConfig( array $extInfo, SettingsBuilder $settings ) {
|
||||
$config = $settings->getConfig();
|
||||
|
||||
// Documentation of MathRestbaseInterface::getUrl() should be updated when this is changed.
|
||||
|
||||
$fullRestbaseUrl = $config->get( 'MathFullRestbaseURL' );
|
||||
$internalRestbaseURL = $config->get( 'MathInternalRestbaseURL' );
|
||||
$useInternalRestbasePath = $config->get( 'MathUseInternalRestbasePath' );
|
||||
$virtualRestConfig = $config->get( 'VirtualRestConfig' );
|
||||
|
||||
if ( !$fullRestbaseUrl ) {
|
||||
if ( $config->has( 'VisualEditorFullRestbaseURL' ) ) {
|
||||
$settings->warning( "MathFullRestbaseURL is falling back to using VisualEditorFullRestbaseURL. " .
|
||||
"Please configure the Mathoid API URL explicitly." );
|
||||
|
||||
$fullRestbaseUrl = $config->get( 'VisualEditorFullRestbaseURL' );
|
||||
$settings->overrideConfigValue( 'MathFullRestbaseURL', $fullRestbaseUrl );
|
||||
} else {
|
||||
throw new ConfigException(
|
||||
'Math extension can not find Restbase URL. Please specify $wgMathFullRestbaseURL.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$useInternalRestbasePath ) {
|
||||
if ( $internalRestbaseURL ) {
|
||||
|
|
|
@ -205,16 +205,13 @@ class MathRestbaseInterface {
|
|||
* Case A: <code>$internal = false</code>, which means one needs a URL that is accessible from
|
||||
* outside:
|
||||
*
|
||||
* --> If <code>$wgMathFullRestbaseURL</code> is configured use it, otherwise fall back try to
|
||||
* <code>$wgVisualEditorFullRestbaseURL</code>. (Note, that this is not be worse than failing
|
||||
* immediately.)
|
||||
* --> Use <code>$wgMathFullRestbaseURL</code>. It must always be configured.
|
||||
*
|
||||
* Case B: <code>$internal = true</code>, which means one needs to access content from Restbase
|
||||
* which does not need to be accessible from outside:
|
||||
*
|
||||
* --> Use the mount point when it is available and <code>$wgMathUseInternalRestbasePath =
|
||||
* true</code>. If not, use <code>$wgMathFullRestbaseURL</code> with fallback to
|
||||
* <code>wgVisualEditorFullRestbaseURL</code>
|
||||
* true</code>. If not, use <code>$wgMathFullRestbaseURL</code>.
|
||||
*
|
||||
* @param string $path
|
||||
* @param bool|true $internal
|
||||
|
|
|
@ -39,17 +39,6 @@ class HooksTest extends MediaWikiUnitTestCase {
|
|||
]
|
||||
];
|
||||
|
||||
yield 'use VisualEditorFullRestbaseURL' => [
|
||||
[
|
||||
'MathFullRestbaseURL' => null,
|
||||
'VisualEditorFullRestbaseURL' => 'https://wikimedia.org/api/rest_',
|
||||
] + $defaults,
|
||||
[
|
||||
'MathFullRestbaseURL' => 'https://wikimedia.org/api/rest_',
|
||||
'MathInternalRestbaseURL' => 'https://wikimedia.org/api/rest_',
|
||||
]
|
||||
];
|
||||
|
||||
yield 'explicit MathInternalRestbaseURL' => [
|
||||
[
|
||||
'MathInternalRestbaseURL' => 'https://localhost:12345/rest/',
|
||||
|
|
Loading…
Reference in a new issue