Cscott has uploaded a new change for review.

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

Change subject: Always use VRS to configure Visual Editor
......................................................................

Always use VRS to configure Visual Editor

Remove the deprecated $wgVisualEditorParsoid* variables and just use
the VirtualRestService to configure Parsoid in all cases.

Change-Id: I32bfdd1469e6e635350eac92a51e05293b561bf7
---
M wmf-config/CommonSettings-labs.php
M wmf-config/CommonSettings.php
2 files changed, 25 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/39/233439/1

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 2e15698..0238c82 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -84,20 +84,8 @@
 
 if ( $wmgUseParsoid ) {
        $wmgParsoidURL = 'http://10.68.16.145'; // 
deployment-parsoidcache02.eqiad
-}
-
-if ( $wmgUseVisualEditor ) {
-       $wgVisualEditorParsoidURL = $wmgParsoidURL; // Re-link now it's been 
set to a new value
-
-       // RESTbase connection configuration
-       if ( $wmgVisualEditorAccessRESTbaseDirectly ) {
-               // HACK: $wgServerName is not available yet at this point, it's 
set by Setup.php
-               // so use a hook
-               $wgExtensionFunctions[] = function () {
-                       global $wgServerName, $wgVisualEditorRestbaseURL;
-                       $wgVisualEditorRestbaseURL = 
"http://$wgServerName/api/rest_v1/page/html/";;
-               };
-       }
+       // Re-link now it's been set to a new value
+       $wgVirtualRestConfig['modules']['parsoid']['url'] = $wmgParsoidURL;
 }
 
 if ( $wmgUseFlow ) {
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 18d1a55..d0ae4c2 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1931,17 +1931,19 @@
        $wgRestbaseServer = $wmgRestbaseServer;
 }
 
+if ( !isset( $wgVirtualRestConfig ) && ( $wmgUseRestbaseVRS || $wmgUseParsoid 
) ) {
+       $wgVirtualRestConfig = array(
+               'modules' => array(),
+               'global' => array(
+                       'domain' => $wgCanonicalServer,
+                       'timeout' => 360,
+                       'forwardCookies' => false,
+                       'HTTPProxy' => null,
+               )
+       );
+}
+
 if ( $wmgUseRestbaseVRS ) {
-       if( !isset( $wgVirtualRestConfig ) ) {
-               $wgVirtualRestConfig = array(
-                       'modules' => array(),
-                       'global' => array(
-                               'timeout' => 360,
-                               'forwardCookies' => false,
-                               'HTTPProxy' => null
-                       )
-               );
-       }
        $wgVirtualRestConfig['modules']['restbase'] = array(
                'url' => $wmgRestbaseServer,
                'domain' => $wgCanonicalServer,
@@ -1954,18 +1956,22 @@
        $wmgParsoidURL = 'http://10.2.2.29'; // parsoidcache.svc.eqiad.wmnet
 
        // The wiki prefix to use
-       $wgParsoidWikiPrefix = $wgDBname;
+       $wgParsoidWikiPrefix = $wgDBname; // deprecated
+       $wgVirtualRestConfig['modules']['parsoid'] = array(
+               'url' => $wmgParsoidURL,
+               'prefix' => $wgDBname, // deprecated
+               'domain' => $wgCanonicalServer,
+               'forwardCookies' => $wmgParsoidForwardCookies,
+               'restbaseCompat' => false
+       );
 }
 
 if ( $wmgUseVisualEditor ) {
        require_once( "$IP/extensions/VisualEditor/VisualEditor.php" );
 
-       // Parsoid connection configuration
-       $wgVisualEditorParsoidURL = $wmgParsoidURL;
-       $wgVisualEditorParsoidPrefix = $wgParsoidWikiPrefix;
-       if ( $wmgParsoidForwardCookies ) {
-               $wgVisualEditorParsoidForwardCookies = true;
-       }
+       // RESTBase connection configuration is done by $wmfUseRestbaseVRS 
above.
+       // Parsoid connection configuration is done by $wmgUseParsoid above.
+       // At least one of these should be set if you want to use Visual Editor.
 
        // RESTbase connection configuration
        if ( $wmgVisualEditorAccessRESTbaseDirectly ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32bfdd1469e6e635350eac92a51e05293b561bf7
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

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

Reply via email to