Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7422778
VisualEditorParsoidClientFactory.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
VisualEditorParsoidClientFactory.php
View Options
<?php
namespace
MediaWiki\Extension\VisualEditor
;
use
MediaWiki\Context\RequestContext
;
use
MediaWiki\Permissions\Authority
;
use
MediaWiki\Rest\Handler\Helper\PageRestHelperFactory
;
/**
* @since 1.40
*/
class
VisualEditorParsoidClientFactory
{
/**
* @internal For use by ServiceWiring.php only or when locating the service
*/
public
const
SERVICE_NAME
=
'VisualEditor.ParsoidClientFactory'
;
private
PageRestHelperFactory
$pageRestHelperFactory
;
public
function
__construct
(
PageRestHelperFactory
$pageRestHelperFactory
)
{
$this
->
pageRestHelperFactory
=
$pageRestHelperFactory
;
}
/**
* Create a ParsoidClient for accessing Parsoid.
*
* @param string|string[]|false $cookiesToForward
* @param Authority|null $performer
*
* @return ParsoidClient
*/
public
function
createParsoidClient
(
/* Kept for compatibility with other extensions */
$cookiesToForward
,
?
Authority
$performer
=
null
):
ParsoidClient
{
if
(
$performer
===
null
)
{
$performer
=
RequestContext
::
getMain
()->
getAuthority
();
}
return
$this
->
createDirectClient
(
$performer
);
}
/**
* Create a ParsoidClient for accessing Parsoid.
*/
private
function
createDirectClient
(
Authority
$performer
):
ParsoidClient
{
return
new
DirectParsoidClient
(
$this
->
pageRestHelperFactory
,
$performer
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 06:12 (14 m, 24 s)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
42/13/2a87ab67562bf43fb97a6886e95a
Default Alt Text
VisualEditorParsoidClientFactory.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment