MediaWiki
1.32.5
|
RenderedRevision represents the rendered representation of a revision. More...
Public Member Functions | |
__construct (Title $title, RevisionRecord $revision, ParserOptions $options, callable $combineOutput, $audience=RevisionRecord::FOR_PUBLIC, User $forUser=null) | |
getOptions () | |
getRevision () | |
getRevisionParserOutput (array $hints=[]) | |
getSlotParserOutput ( $role, array $hints=[]) | |
isContentDeleted () | |
setSaveParseLogger (LoggerInterface $saveParseLogger) | |
updateRevision (RevisionRecord $rev) | |
Updates the RevisionRecord after the revision has been saved. More... | |
Private Member Functions | |
getSlotParserOutputUncached (Content $content, $withHtml) | |
outputVariesOnRevisionMetaData (ParserOutput $out, $actualRevId) | |
pruneRevisionSensitiveOutput ( $actualRevId) | |
Prune any output that depends on the revision ID. More... | |
setRevisionInternal (RevisionRecord $revision) | |
Private Attributes | |
int | $audience = RevisionRecord::FOR_PUBLIC |
Audience to check when accessing content. More... | |
callable | $combineOutput |
Callback for combining slot output into revision output. More... | |
User null | $forUser = null |
The user to use for audience checks during content access. More... | |
ParserOptions | $options |
RevisionRecord | $revision |
ParserOutput null | $revisionOutput = null |
The combined ParserOutput for the revision, initialized lazily by getRevisionParserOutput(). More... | |
LoggerInterface | $saveParseLogger |
For profiling ParserOutput re-use. More... | |
ParserOutput[] | $slotsOutput = [] |
The ParserOutput for each slot, initialized lazily by getSlotParserOutput(). More... | |
Title | $title |
RenderedRevision represents the rendered representation of a revision.
It acts as a lazy provider of ParserOutput objects for the revision's individual slots, as well as a combined ParserOutput of all slots.
Definition at line 44 of file RenderedRevision.php.
Revision\RenderedRevision::__construct | ( | Title | $title, |
RevisionRecord | $revision, | ||
ParserOptions | $options, | ||
callable | $combineOutput, | ||
$audience = RevisionRecord::FOR_PUBLIC , |
|||
User | $forUser = null |
||
) |
Title | $title | |
RevisionRecord | $revision | The revision to render. The content for rendering will be taken from this RevisionRecord. However, if the RevisionRecord is not complete according isReadyForInsertion(), but a revision ID is known, the parser may load the revision from the database if it needs revision meta data to handle magic words like {{REVISIONUSER}}. |
ParserOptions | $options | |
callable | $combineOutput | Callback for combining slot output into revision output. Signature: function ( RenderedRevision $this ): ParserOutput. |
int | $audience | Use RevisionRecord::FOR_PUBLIC, FOR_THIS_USER, or RAW. |
User | null | $forUser | Required if $audience is FOR_THIS_USER. |
Definition at line 108 of file RenderedRevision.php.
References Revision\RenderedRevision\$audience, Revision\RenderedRevision\$combineOutput, Revision\RenderedRevision\$forUser, Revision\RenderedRevision\$options, Revision\RenderedRevision\$title, Revision\RevisionRecord\FOR_THIS_USER, options(), Revision\RenderedRevision\setRevisionInternal(), and title.
Revision\RenderedRevision::getOptions | ( | ) |
Definition at line 158 of file RenderedRevision.php.
References Revision\RenderedRevision\$options.
Referenced by Revision\RevisionRenderer\combineSlotOutput().
Revision\RenderedRevision::getRevision | ( | ) |
Definition at line 151 of file RenderedRevision.php.
References Revision\RenderedRevision\$revision.
Referenced by MediaWiki\Tests\Revision\RenderedRevisionTest\combineOutput(), and Revision\RevisionRenderer\combineSlotOutput().
Revision\RenderedRevision::getRevisionParserOutput | ( | array | $hints = [] | ) |
array | $hints | Hints given as an associative array. Known keys:
|
Definition at line 169 of file RenderedRevision.php.
References $output, and Revision\RenderedRevision\$revisionOutput.
Revision\RenderedRevision::getSlotParserOutput | ( | $role, | |
array | $hints = [] |
||
) |
string | $role | |
array | $hints | Hints given as an associative array. Known keys:
|
SuppressedDataException | if the content is not accessible for the audience specified in the constructor. |
Implements Revision\SlotRenderingProvider.
Definition at line 198 of file RenderedRevision.php.
References $content, $output, Revision\RenderedRevision\getSlotParserOutputUncached(), options(), and revision.
Referenced by MediaWiki\Tests\Revision\RenderedRevisionTest\combineOutput(), and Revision\RevisionRenderer\combineSlotOutput().
|
private |
Content | $content | |
bool | $withHtml |
Definition at line 237 of file RenderedRevision.php.
References $content, Revision\RenderedRevision\$options, revision, and title.
Referenced by Revision\RenderedRevision\getSlotParserOutput().
Revision\RenderedRevision::isContentDeleted | ( | ) |
Definition at line 144 of file RenderedRevision.php.
References Revision\RevisionRecord\DELETED_TEXT, and revision.
|
private |
ParserOutput | $out | |
int | bool | $actualRevId | The actual rev id, to check the used speculative rev ID against, or false to not purge on vary-revision-id, or true to purge on vary-revision-id unconditionally. |
Definition at line 356 of file RenderedRevision.php.
References $out, and wfDebug().
Referenced by Revision\RenderedRevision\pruneRevisionSensitiveOutput().
|
private |
Prune any output that depends on the revision ID.
int | bool | $actualRevId | The actual rev id, to check the used speculative rev ID against, or false to not purge on vary-revision-id, or true to purge on vary-revision-id unconditionally. |
Definition at line 281 of file RenderedRevision.php.
References $output, as, and Revision\RenderedRevision\outputVariesOnRevisionMetaData().
Referenced by Revision\RenderedRevision\updateRevision().
|
private |
RevisionRecord | $revision |
Definition at line 300 of file RenderedRevision.php.
References $parser, Revision\RenderedRevision\$revision, Revision\RenderedRevision\$title, Title\equals(), options(), revision, and use.
Referenced by Revision\RenderedRevision\__construct(), and Revision\RenderedRevision\updateRevision().
Revision\RenderedRevision::setSaveParseLogger | ( | LoggerInterface | $saveParseLogger | ) |
LoggerInterface | $saveParseLogger |
Definition at line 137 of file RenderedRevision.php.
References Revision\RenderedRevision\$saveParseLogger.
Referenced by Revision\RevisionRenderer\getRenderedRevision().
Revision\RenderedRevision::updateRevision | ( | RevisionRecord | $rev | ) |
Updates the RevisionRecord after the revision has been saved.
This can be used to discard and cached ParserOutput so parser functions like {{REVISIONTIMESTAMP}} or {{REVISIONID}} are re-evaluated.
RevisionRecord | $rev |
Definition at line 255 of file RenderedRevision.php.
References $rev, Revision\RevisionRecord\getId(), Revision\RevisionRecord\getSlots(), Revision\RenderedRevision\pruneRevisionSensitiveOutput(), revision, and Revision\RenderedRevision\setRevisionInternal().
|
private |
Audience to check when accessing content.
Definition at line 62 of file RenderedRevision.php.
Referenced by Revision\RenderedRevision\__construct().
|
private |
Callback for combining slot output into revision output.
Signature: function ( RenderedRevision $this ): ParserOutput.
Definition at line 85 of file RenderedRevision.php.
Referenced by Revision\RenderedRevision\__construct().
|
private |
The user to use for audience checks during content access.
Definition at line 67 of file RenderedRevision.php.
Referenced by Revision\RenderedRevision\__construct().
|
private |
Definition at line 57 of file RenderedRevision.php.
Referenced by Revision\RenderedRevision\__construct(), Revision\RenderedRevision\getOptions(), and Revision\RenderedRevision\getSlotParserOutputUncached().
|
private |
Definition at line 52 of file RenderedRevision.php.
Referenced by Revision\RenderedRevision\getRevision(), and Revision\RenderedRevision\setRevisionInternal().
|
private |
The combined ParserOutput for the revision, initialized lazily by getRevisionParserOutput().
Definition at line 73 of file RenderedRevision.php.
Referenced by Revision\RenderedRevision\getRevisionParserOutput().
|
private |
For profiling ParserOutput re-use.
Definition at line 90 of file RenderedRevision.php.
Referenced by Revision\RenderedRevision\setSaveParseLogger().
|
private |
The ParserOutput for each slot, initialized lazily by getSlotParserOutput().
Definition at line 79 of file RenderedRevision.php.
|
private |
Definition at line 49 of file RenderedRevision.php.
Referenced by Revision\RenderedRevision\__construct(), and Revision\RenderedRevision\setRevisionInternal().