38 private $differenceEngine;
41 $this->differenceEngine = clone $differenceEngine;
45 $fakeContent = MediaWikiServices::getInstance()
46 ->getContentHandlerFactory()
49 $this->differenceEngine->
setContent( $fakeContent, $fakeContent );
51 $this->differenceEngine->markAsSlotDiffRenderer();
57 return $this->differenceEngine->generateContentDiffBody( $oldContent, $newContent );
63 if ( $output !== $this->differenceEngine->
getOutput() ) {
64 $oldContext = $this->differenceEngine->getContext();
66 $newContext->setOutput( $output );
67 $this->differenceEngine->setContext( $newContext );
69 $this->differenceEngine->showDiffStyle();
71 $this->differenceEngine->setContext( $oldContext );
77 return $this->differenceEngine->getExtraCacheKeys();
const CONTENT_MODEL_WIKITEXT
B/C adapter for turning a DifferenceEngine into a SlotDiffRenderer.
addModules(OutputPage $output)
Add modules needed for correct styling/behavior of the diff.to override
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...
__construct(DifferenceEngine $differenceEngine)
getExtraCacheKeys()
Return any extra keys to split the diff cache by.to 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.
An IContextSource implementation which will inherit context from another source but allow individual ...
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.