|
MediaWiki master
|
Inherits MediaWiki\Diff\TextDiffer\BaseTextDiffer.

Public Member Functions | ||||
| __construct ( $externalPath) | ||||
| 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. | ||||
Public Member Functions inherited from MediaWiki\Diff\TextDiffer\BaseTextDiffer | ||||
| 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. | ||||
| 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. | ||||
| 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. | ||||
| setLocalizer (MessageLocalizer $localizer) | ||||
Protected Member Functions | |
| doRenderBatch (string $oldText, string $newText, array $formats) | |
| Subclasses should override this to render diffs in the specified formats. | |
Protected Member Functions inherited from MediaWiki\Diff\TextDiffer\BaseTextDiffer | |
| getLocalizer () | |
| Provide a MessageLocalizer, or throw if setLocalizer() has not been called. | |
| localizeLineNumbers ( $text, $reducedLineNumbers) | |
| Replace a common convention for language-independent line numbers with the text in the language of the current localizer. | |
| validateFormats ( $formats) | |
| Throw an exception if any of the formats in the array is not supported. | |
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. | |
Definition at line 11 of file ExternalTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ExternalTextDiffer::__construct | ( | $externalPath | ) |
| string | $externalPath | The path to the executable file which provides the diff |
Definition at line 18 of file ExternalTextDiffer.php.
|
protected |
Subclasses should override this to render diffs in the specified formats.
The $formats array is guaranteed to not be empty and to contain only formats supported by the subclass.
| string | $oldText | |
| string | $newText | |
| array | $formats |
Reimplemented from MediaWiki\Diff\TextDiffer\BaseTextDiffer.
Definition at line 35 of file ExternalTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ExternalTextDiffer::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 31 of file ExternalTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ExternalTextDiffer::getFormats | ( | ) |
Get the supported format names.
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 26 of file ExternalTextDiffer.php.
| MediaWiki\Diff\TextDiffer\ExternalTextDiffer::getName | ( | ) |
Get a stable unique name to identify this differ in a cache key.
Implements MediaWiki\Diff\TextDiffer\TextDiffer.
Definition at line 22 of file ExternalTextDiffer.php.