|
MediaWiki master
|
A TextDiffer which acts as a container for other TextDiffers, and dispatches requests to them. More...
Inherits MediaWiki\Diff\TextDiffer\TextDiffer.

Public Member Functions | ||||
| __construct (MessageLocalizer $localizer, ?Language $contentLanguage, $diffEngine, $externalPath, $wikidiff2Options) | ||||
| addModules (OutputPage $out, string $format) | ||||
| Modify the OutputPage, adding any headers required by the specified format. | ||||
| addRowWrapper (string $format, string $diffText) | ||||
| Make the context consistent by adding a colspan=4 wrapper around plain HTML output. | ||||
| getCacheKeys (array $formats) | ||||
| Get additional cache keys required by the specified formats. | ||||
| getEngineForFormat (string $format) | ||||
| Get the text differ name which will be used for the specified format. | ||||
| getFormatContext (string $format) | ||||
Get the context for a given format.Returns one of the CONTEXT_* constants.
| ||||
| getFormats () | ||||
| Get the supported format names. | ||||
| getName () | ||||
| Get a stable unique name to identify this differ in a cache key. | ||||
| getPreferredFormatBatch (string $format) | ||||
| Given a format, get a list of formats which can be generated at the same time with minimal additional CPU cost. | ||||
| getTablePrefixes (string $format) | ||||
| Get table prefixes for the specified format. | ||||
| hasFormat (string $format) | ||||
| Determine whether we support the specified format. | ||||
| injectDeps (TextDiffer $differ) | ||||
| Initialize an object which may be a subclass of BaseTextDiffer, passing down injected dependencies. | ||||
| localize (string $format, string $diff, array $options=[]) | ||||
| Expand messages in the diff text using the current MessageLocalizer. | ||||
| render (string $oldText, string $newText, string $format) | ||||
| Generate a diff comparing $oldText with $newText. | ||||
| renderBatch (string $oldText, string $newText, array $formats) | ||||
| Render a diff in multiple formats. | ||||
| setEngine (string $name) | ||||
| Disable text differs apart from the one with the given name. | ||||
Additional Inherited Members | |
Public Attributes inherited from MediaWiki\Diff\TextDiffer\TextDiffer | |
| const | CONTEXT_PLAIN = 'plain' |
| The HTML returned is an ordinary block. | |
| const | CONTEXT_PRE = 'pre' |
| The return value is plain text and should be wrapped in a. | |
| const | CONTEXT_ROW = 'row' |
| The HTML returned is zero or more table rows. | |
A TextDiffer which acts as a container for other TextDiffers, and dispatches requests to them.
Definition at line 18 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::__construct | ( | MessageLocalizer | $localizer, |
| ?Language | $contentLanguage, | ||
| $diffEngine, | |||
| $externalPath, | |||
| $wikidiff2Options ) |
| MessageLocalizer | $localizer | |
| Language | null | $contentLanguage | |
| string | null | $diffEngine | The DiffEngine config variable |
| string | false | null | $externalPath | The ExternalDiffEngine config variable |
| array | $wikidiff2Options | The Wikidiff2Options config variable |
Definition at line 43 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::addModules | ( | OutputPage | $out, |
| string | $format ) |
Modify the OutputPage, adding any headers required by the specified format.
| OutputPage | $out | |
| string | $format |
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 99 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::addRowWrapper | ( | string | $format, |
| string | $diffText ) |
Make the context consistent by adding a colspan=4 wrapper around plain HTML output.
| string | $format | |
| string | $diffText |
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 95 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::getCacheKeys | ( | array | $formats | ) |
Get additional cache keys required by the specified formats.
The result should have unique string keys, so that cache keys can be deduplicated.
| string[] | $formats |
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 103 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::getEngineForFormat | ( | string | $format | ) |
Get the text differ name which will be used for the specified format.
| string | $format |
Definition at line 174 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::getFormatContext | ( | string | $format | ) |
Get the context for a given format.Returns one of the CONTEXT_* constants.
| string | $format |
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 91 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::getFormats | ( | ) |
Get the supported format names.
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 61 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::getName | ( | ) |
Get a stable unique name to identify this differ in a cache key.
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 57 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::getPreferredFormatBatch | ( | string | $format | ) |
Given a format, get a list of formats which can be generated at the same time with minimal additional CPU cost.
| string | $format |
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 124 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::getTablePrefixes | ( | string | $format | ) |
Get table prefixes for the specified format.
These are HTML fragments placed above all slot diffs. The key should be a string, used for sorting and deduplication.
| string | $format |
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 120 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::hasFormat | ( | string | $format | ) |
Determine whether we support the specified format.
| string | $format |
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 66 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::injectDeps | ( | TextDiffer | $differ | ) |
Initialize an object which may be a subclass of BaseTextDiffer, passing down injected dependencies.
Definition at line 215 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::localize | ( | string | $format, |
| string | $diff, | ||
| array | $options = [] ) |
Expand messages in the diff text using the current MessageLocalizer.
Perform any other necessary post-cache transformations.
| string | $format | |
| string | $diff | |
| array | $options | An associative array of options, may contain:
|
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 116 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::render | ( | string | $oldText, |
| string | $newText, | ||
| string | $format ) |
Generate a diff comparing $oldText with $newText.
The result must be passed through localize() before being sent to the user.
| string | $oldText | |
| string | $newText | |
| string | $format |
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 71 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::renderBatch | ( | string | $oldText, |
| string | $newText, | ||
| array | $formats ) |
Render a diff in multiple formats.
The results must be passed through localize() before being sent to the user.
| string | $oldText | |
| string | $newText | |
| string[] | $formats |
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 80 of file ManifoldTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ManifoldTextDiffer::setEngine | ( | string | $name | ) |
Disable text differs apart from the one with the given name.
Definition at line 162 of file ManifoldTextDiffer.php.