mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
f2bb8cf45d
This follows the event of VE no longer using RESTBase anything. All actions related to stashing and Parsoid and now handled in MW core. Bug: T339227 Change-Id: I50b20ed5abb721a6ac8987cac37a6f395a4816dc
39 lines
1 KiB
PHP
39 lines
1 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\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->getPageRestHelperFactory()
|
|
);
|
|
},
|
|
];
|