[BREAKING CHANGE] Drop support for contacting Parsoid without VirtualRestConfig

Change-Id: I3f7c3f8326c6fa76bd49e53c9fd2a24de9568f13
This commit is contained in:
James D. Forrester 2016-02-05 12:37:55 -08:00
parent db24f81138
commit 89e043452d
2 changed files with 7 additions and 17 deletions

View file

@ -43,7 +43,7 @@ class ApiVisualEditor extends ApiBase {
// the VRS class to use, defaults to Parsoid
$class = ParsoidVirtualRESTService::class;
$config = $this->veConfig;
// the global virtual rest service config object, if any
// The global virtual rest service config object, if any
$vrs = $this->getConfig()->get( 'VirtualRestConfig' );
if ( isset( $vrs['modules'] ) && isset( $vrs['modules']['restbase'] ) ) {
// if restbase is available, use it
@ -56,16 +56,12 @@ class ApiVisualEditor extends ApiBase {
$params = $vrs['modules']['parsoid'];
$params['restbaseCompat'] = true;
} else {
// no global modules defined, fall back to old defaults
$params = [
'URL' => $config->get( 'VisualEditorParsoidURL' ),
'prefix' => $config->get( 'VisualEditorParsoidPrefix' ),
'domain' => $config->get( 'VisualEditorParsoidDomain' ),
'timeout' => $config->get( 'VisualEditorParsoidTimeout' ),
'HTTPProxy' => $config->get( 'VisualEditorParsoidHTTPProxy' ),
'forwardCookies' => $config->get( 'VisualEditorParsoidForwardCookies' ),
'restbaseCompat' => true
];
// No global modules defined, so no way to contact the document server.
$this->dieUsage(
'The VirtualRESTService for the document server is not defined; see ' .
'https://www.mediawiki.org/wiki/Extension:VisualEditor',
'no_vrs'
);
}
// merge the global and service-specific params
if ( isset( $vrs['global'] ) ) {

View file

@ -37,11 +37,8 @@
"VisualEditorFeedbackTitle": false,
"VisualEditorSerializationCacheTimeout": 3600,
"VisualEditorUseChangeTagging": true,
"VisualEditorParsoidPrefix": "localhost",
"VisualEditorParsoidDomain": "localhost",
"VisualEditorDisableForAnons": false,
"VisualEditorPluginModules": [],
"VisualEditorParsoidForwardCookies": false,
"VisualEditorTabMessages": {
"edit": null,
"editsource": "visualeditor-ca-editsource",
@ -53,7 +50,6 @@
"editsectionsource": "visualeditor-ca-editsource-section"
},
"VisualEditorShowBetaWelcome": true,
"VisualEditorParsoidHTTPProxy": false,
"VisualEditorBrowserBlacklist": {
"android": [
[
@ -89,7 +85,6 @@
"silk": null
},
"VisualEditorTabPosition": "before",
"VisualEditorParsoidURL": "http://localhost:8000",
"VisualEditorNewAccountEnableProportion": false,
"VisualEditorEnableTocWidget": false,
"VisualEditorEnableWikitext": false,
@ -106,7 +101,6 @@
"_merge_strategy": "array_plus"
},
"VisualEditorSkinToolbarScrollOffset": [],
"VisualEditorParsoidTimeout": 100,
"VisualEditorUseSingleEditTab": false,
"VisualEditorSingleEditTabSwitchTime": 20160101000000
},