Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/236188
Change subject: Update CX VRS code
......................................................................
Update CX VRS code
This matches the latest version of the VRS access code used in Visual
Editor and Flow. It changes the URL scheme used to the latest RESTBase
API -- although as it turns out, the URL used by CX doesn't change at
all.
Change-Id: Ifa492a84f7d95b6695133d06378e7819b0eecab9
---
M api/ApiContentTranslationPublish.php
M extension.json
2 files changed, 12 insertions(+), 7 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/88/236188/1
diff --git a/api/ApiContentTranslationPublish.php
b/api/ApiContentTranslationPublish.php
index bf2fe20..ad59262 100755
--- a/api/ApiContentTranslationPublish.php
+++ b/api/ApiContentTranslationPublish.php
@@ -26,7 +26,7 @@
public function __construct( ApiMain $main, $name ) {
parent::__construct( $main, $name );
$this->serviceClient = new VirtualRESTServiceClient( new
MultiHttpClient( array() ) );
- $this->serviceClient->mount( '/parsoid/', $this->getVRSObject()
);
+ $this->serviceClient->mount( '/restbase/',
$this->getVRSObject() );
}
/**
@@ -49,12 +49,12 @@
if ( isset( $vrs['modules'] ) && isset(
$vrs['modules']['restbase'] ) ) {
// if restbase is available, use it
$params = $vrs['modules']['restbase'];
+ $params['parsoidCompat'] = false; // backward
compatibility
$class = 'RestbaseVirtualRESTService';
- // remove once VE generates restbase paths
- $params['parsoidCompat'] = true;
} elseif ( isset( $vrs['modules'] ) && isset(
$vrs['modules']['parsoid'] ) ) {
// there's a global parsoid config, use it next
$params = $vrs['modules']['parsoid'];
+ $params['restbaseCompat'] = true;
} else {
// no global modules defined, fall back to old defaults
$config = $this->getConfig()->get(
'ContentTranslationParsoid' );
@@ -63,6 +63,9 @@
'prefix' => $config['prefix'],
'domain' => $config['domain'],
'timeout' => $config['timeout'],
+ 'HTTPProxy' => $config['HTTPProxy'],
+ 'forwardCookies' => $config['forwardCookies'],
+ 'restbaseCompat' => true
);
}
// merge the global and service-specific params
@@ -79,10 +82,10 @@
return new $class( $params );
}
- private function requestParsoid( $method, $path, $params ) {
+ private function requestRestbase( $method, $path, $params ) {
$request = array(
'method' => $method,
- 'url' => '/parsoid/local/v1/' . $path
+ 'url' => '/restbase/local/v1/' . $path
);
if ( $method === 'GET' ) {
$request['query'] = $params;
@@ -107,7 +110,7 @@
* @return string wikitext
*/
protected function convertHtmlToWikitext( Title $title, $html ) {
- $wikitext = $this->requestParsoid(
+ $wikitext = $this->requestRestbase(
'POST',
'transform/html/to/wikitext/' . urlencode(
$title->getPrefixedDBkey() ),
array(
diff --git a/extension.json b/extension.json
index a8e1a8e..87d3de9 100644
--- a/extension.json
+++ b/extension.json
@@ -102,7 +102,9 @@
"url": "http://parsoid-lb.eqiad.wikimedia.org/",
"timeout": 100000,
"prefix": "enwiki",
- "domain": "en.wikipedia.org"
+ "domain": "en.wikipedia.org",
+ "HTTPProxy": false,
+ "forwardCookies": false
},
"ContentTranslationDatabase": null,
"ContentTranslationCluster": false,
--
To view, visit https://gerrit.wikimedia.org/r/236188
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa492a84f7d95b6695133d06378e7819b0eecab9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits