mediawiki-extensions-Visual.../includes/ServiceWiring.php
msantos 72b4f8cdbb Rename HTMLTransform related classes
* Rename imported classes in VE that will be renamed in core
* Re-enable tests that would fail when the core patch is merged

Depends-On: I506f3303ae8f9e4db17299211366bef1558f142c
Change-Id: I59ebeb24fa0de5f10d1501cc0830c7e4805e1003
2022-11-04 11:43:36 +00:00

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()
);
},
];