mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
35cb550747
* DirectParsoidClient makes use of parsoid directly for performing transformations on both wikitext and/or HTML contents. * Also, it's used to fetch HTML from parsoid's parser cache. Before, this operation was done via RESTBase but now it's being fetched in core's parsoid parser cache. * This patch also enables VE clients to transform HTML to Wikitext when switching from HTML to source mode on. It makes use of the HtmlInputTransformHelper to perform this transformation. * Now, VE client can make use of core code for switching between HTML to source mode and back without RESTBase. Change-Id: I5c7cfcc4086d8da7905897194d8601aa07418b59
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* ServiceWiring files for VisualEditor.
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @copyright 2011-2021 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license MIT
|
|
*/
|
|
|
|
namespace MediaWiki\Extension\VisualEditor;
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
return [
|
|
VisualEditorHookRunner::SERVICE_NAME => static function ( MediaWikiServices $services ): VisualEditorHookRunner {
|
|
return new VisualEditorHookRunner( $services->getHookContainer() );
|
|
},
|
|
|
|
VisualEditorParsoidClientFactory::SERVICE_NAME => static function (
|
|
MediaWikiServices $services
|
|
): VisualEditorParsoidClientFactory {
|
|
$isPrivateWiki = !$services->getPermissionManager()->isEveryoneAllowed( 'read' );
|
|
|
|
return new VisualEditorParsoidClientFactory(
|
|
new ServiceOptions(
|
|
VisualEditorParsoidClientFactory::CONSTRUCTOR_OPTIONS,
|
|
$services->getMainConfig(),
|
|
[
|
|
VisualEditorParsoidClientFactory::ENABLE_COOKIE_FORWARDING => $isPrivateWiki
|
|
]
|
|
),
|
|
$services->getHttpRequestFactory(),
|
|
LoggerFactory::getInstance( 'VisualEditor' ),
|
|
$services->getParsoidOutputStash(),
|
|
$services->getStatsdDataFactory(),
|
|
$services->getParsoidOutputAccess(),
|
|
$services->getHTMLTransformFactory()
|
|
);
|
|
},
|
|
];
|