36 private $differenceEngine;
42 $this->differenceEngine = clone $differenceEngine;
46 $fakeContent = MediaWikiServices::getInstance()
47 ->getContentHandlerFactory()
50 $this->differenceEngine->
setContent( $fakeContent, $fakeContent );
52 $this->differenceEngine->markAsSlotDiffRenderer();
58 return $this->differenceEngine->generateContentDiffBody( $oldContent, $newContent );
64 if ( $output !== $this->differenceEngine->
getOutput() ) {
65 $oldContext = $this->differenceEngine->getContext();
67 $newContext->setOutput( $output );
68 $this->differenceEngine->setContext( $newContext );
70 $this->differenceEngine->showDiffStyle();
72 $this->differenceEngine->setContext( $oldContext );
78 return $this->differenceEngine->getExtraCacheKeys();
const CONTENT_MODEL_WIKITEXT
An IContextSource implementation which will inherit context from another source but allow individual ...
B/C adapter for turning a DifferenceEngine into a SlotDiffRenderer.
addModules(OutputPage $output)
Add modules needed for correct styling/behavior of the diff.Stability: stableto override
__construct(DifferenceEngine $differenceEngine)
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 remov...
getExtraCacheKeys()
Return any extra keys to split the diff cache by.Stability: stableto override string[]
DifferenceEngine is responsible for rendering the difference between two revisions as HTML.
setContent(Content $oldContent, Content $newContent)
Use specified text instead of loading from the database.
This is one of the Core classes and should be read at least once by any new developers.
Renders a diff for a single slot (that is, a diff between two content objects).
normalizeContents(Content &$oldContent=null, Content &$newContent=null, $allowedClasses=null)
Helper method to normalize the input of getDiff().
Base interface for representing page content.