MediaWiki master
MediaWiki\Diff\DifferenceEngineSlotDiffRenderer Class Reference

B/C adapter for turning a DifferenceEngine into a SlotDiffRenderer. More...

Inherits MediaWiki\Diff\SlotDiffRenderer.

Collaboration diagram for MediaWiki\Diff\DifferenceEngineSlotDiffRenderer:

Public Member Functions

 __construct (DifferenceEngine $differenceEngine)
 
 addModules (OutputPage $output)
 Add modules needed for correct styling/behavior of the diff.
Stability: stable
to override
Parameters
OutputPage$output

 
 getDiff (?Content $oldContent=null, ?Content $newContent=null)
 Get a diff between two content objects.One of them might be null (meaning a slot was created or removed), but both cannot be. $newContent (or if it's null then $oldContent) must have the same content model that was used to obtain this diff renderer.

Parameters
Content | null$oldContent
Content | null$newContent
Returns
string HTML. One or more

 
 getExtraCacheKeys ()
 Return any extra keys to split the diff cache by.
Stability: stable
to override
Returns
string[]

 
- Public Member Functions inherited from MediaWiki\Diff\SlotDiffRenderer
 getTablePrefix (IContextSource $context, Title $newTitle)
 Get the content to add above the main diff table.
 
 localizeDiff (string $diff, array $options=[])
 Localize language-independent text returned by getDiff(), making it suitable for display.
 

Additional Inherited Members

- Protected Member Functions inherited from MediaWiki\Diff\SlotDiffRenderer
 normalizeContents (?Content &$oldContent=null, ?Content &$newContent=null, $allowedClasses=null)
 Helper method to normalize the input of getDiff().
 

Detailed Description

B/C adapter for turning a DifferenceEngine into a SlotDiffRenderer.

Before SlotDiffRenderer was introduced, getDiff() functionality was provided by DifferenceEngine subclasses. Convert such a subclass into a SlotDiffRenderer.

Deprecated

Definition at line 24 of file DifferenceEngineSlotDiffRenderer.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Diff\DifferenceEngineSlotDiffRenderer::__construct ( DifferenceEngine $differenceEngine)

Member Function Documentation

◆ addModules()

MediaWiki\Diff\DifferenceEngineSlotDiffRenderer::addModules ( OutputPage $output)

Add modules needed for correct styling/behavior of the diff.

Stability: stable
to override
Parameters
OutputPage$output

Reimplemented from MediaWiki\Diff\SlotDiffRenderer.

Definition at line 50 of file DifferenceEngineSlotDiffRenderer.php.

References MediaWiki\Context\ContextSource\getOutput().

◆ getDiff()

MediaWiki\Diff\DifferenceEngineSlotDiffRenderer::getDiff ( ?Content $oldContent = null,
?Content $newContent = null )

Get a diff between two content objects.One of them might be null (meaning a slot was created or removed), but both cannot be. $newContent (or if it's null then $oldContent) must have the same content model that was used to obtain this diff renderer.

Parameters
Content | null$oldContent
Content | null$newContent
Returns
string HTML. One or more

Reimplemented from MediaWiki\Diff\SlotDiffRenderer.

Definition at line 44 of file DifferenceEngineSlotDiffRenderer.php.

References MediaWiki\Diff\SlotDiffRenderer\normalizeContents().

◆ getExtraCacheKeys()

MediaWiki\Diff\DifferenceEngineSlotDiffRenderer::getExtraCacheKeys ( )

Return any extra keys to split the diff cache by.

Stability: stable
to override
Returns
string[]

Reimplemented from MediaWiki\Diff\SlotDiffRenderer.

Definition at line 65 of file DifferenceEngineSlotDiffRenderer.php.


The documentation for this class was generated from the following file: