MediaWiki
master
|
Adds the mw-reverted tag to reverted edits after a revert is made. More...
Public Member Functions | |
__construct (RevisionStore $revisionStore, LoggerInterface $logger, array $softwareTags, ILoadBalancer $loadBalancer, ServiceOptions $serviceOptions, int $revertId, EditResult $editResult) | |
doUpdate () | |
Marks reverted edits with mw-reverted tag. More... | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS = [ MainConfigNames::RevertedTagMaxDepth ] |
Protected Member Functions | |
getChangeTags (int $revisionId) | |
Protected function calling static ChangeTags class to allow for unit testing of this deferrable update. More... | |
markAsReverted (int $revisionId, array $extraParams) | |
Protected function calling static ChangeTags class to allow for unit testing of this deferrable update. More... | |
Private Member Functions | |
getNewestRevertedRevision () | |
Returns the newest revision record that was reverted. More... | |
getOldestRevertedRevision () | |
Returns the oldest revision record that was reverted. More... | |
getRevertRevision () | |
Returns the revision that performed the revert. More... | |
getTagExtraParams () | |
Returns additional data to be saved in ct_params field of table 'change_tag'. More... | |
handleSingleRevertedEdit () | |
Handles the case where only one edit was reverted. More... | |
shouldExecute () | |
Performs checks to determine whether the update should execute. More... | |
Private Attributes | |
EditResult | $editResult |
ILoadBalancer | $loadBalancer |
LoggerInterface | $logger |
RevisionRecord null | $newestRevertedRevision |
RevisionRecord null | $oldestRevertedRevision |
ServiceOptions | $options |
int | $revertId |
RevisionRecord null | $revertRevision |
RevisionStore | $revisionStore |
string[] | $softwareTags |
Adds the mw-reverted tag to reverted edits after a revert is made.
This class is used by RevertedTagUpdateJob to perform the actual update.
Definition at line 42 of file RevertedTagUpdate.php.
MediaWiki\Storage\RevertedTagUpdate::__construct | ( | RevisionStore | $revisionStore, |
LoggerInterface | $logger, | ||
array | $softwareTags, | ||
ILoadBalancer | $loadBalancer, | ||
ServiceOptions | $serviceOptions, | ||
int | $revertId, | ||
EditResult | $editResult | ||
) |
RevisionStore | $revisionStore | |
LoggerInterface | $logger | |
string[] | $softwareTags | Array of currently enabled software change tags. Can be obtained from ChangeTags::getSoftwareTags() |
ILoadBalancer | $loadBalancer | |
ServiceOptions | $serviceOptions | |
int | $revertId | ID of the revert |
EditResult | $editResult | EditResult object of this revert |
Definition at line 89 of file RevertedTagUpdate.php.
References MediaWiki\Storage\RevertedTagUpdate\$editResult, MediaWiki\Storage\RevertedTagUpdate\$loadBalancer, MediaWiki\Storage\RevertedTagUpdate\$logger, MediaWiki\Storage\RevertedTagUpdate\$revertId, MediaWiki\Storage\RevertedTagUpdate\$revisionStore, MediaWiki\Storage\RevertedTagUpdate\$softwareTags, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\Storage\RevertedTagUpdate::doUpdate | ( | ) |
Marks reverted edits with mw-reverted
tag.
Implements DeferrableUpdate.
Definition at line 112 of file RevertedTagUpdate.php.
References MediaWiki\Storage\RevertedTagUpdate\getNewestRevertedRevision(), MediaWiki\Storage\RevertedTagUpdate\getOldestRevertedRevision(), MediaWiki\Storage\RevertedTagUpdate\getTagExtraParams(), MediaWiki\Storage\RevertedTagUpdate\handleSingleRevertedEdit(), MediaWiki\Revision\RevisionStore\INCLUDE_BOTH, MediaWiki\Storage\RevertedTagUpdate\markAsReverted(), MediaWiki\MainConfigNames\RevertedTagMaxDepth, and MediaWiki\Storage\RevertedTagUpdate\shouldExecute().
|
protected |
Protected function calling static ChangeTags class to allow for unit testing of this deferrable update.
This class is not stable for extending, this is just to make the class testable.
ChangeTags should be passed by dependency injection when that becomes possible. See: T245964
int | $revisionId |
Definition at line 324 of file RevertedTagUpdate.php.
References DB_REPLICA, and ChangeTags\getTags().
|
private |
Returns the newest revision record that was reverted.
Definition at line 365 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\doUpdate().
|
private |
Returns the oldest revision record that was reverted.
Definition at line 380 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\doUpdate().
|
private |
Returns the revision that performed the revert.
Definition at line 351 of file RevertedTagUpdate.php.
|
private |
Returns additional data to be saved in ct_params field of table 'change_tag'.
Effectively a superset of what EditResult::jsonSerialize() returns.
Definition at line 339 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\doUpdate().
|
private |
Handles the case where only one edit was reverted.
Returns true if the update was handled by this method, false otherwise.
This is a much simpler case requiring less DB queries than when dealing with multiple reverted edits.
Definition at line 255 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\doUpdate().
|
protected |
Protected function calling static ChangeTags class to allow for unit testing of this deferrable update.
This class is not stable for extending, this is just to make the class testable.
ChangeTags should be passed by dependency injection when that becomes possible. See: T245964
int | $revisionId | ID of the revision to mark as reverted |
array | $extraParams | Params to put in the ct_params field of table 'change_tag' |
Definition at line 301 of file RevertedTagUpdate.php.
References ChangeTags\addTags(), FormatJson\encode(), and ChangeTags\TAG_REVERTED.
Referenced by MediaWiki\Storage\RevertedTagUpdate\doUpdate().
|
private |
Performs checks to determine whether the update should execute.
Definition at line 177 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\doUpdate().
|
private |
Definition at line 68 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\__construct().
|
private |
Definition at line 59 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\__construct().
|
private |
Definition at line 53 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\__construct().
|
private |
Definition at line 74 of file RevertedTagUpdate.php.
|
private |
Definition at line 77 of file RevertedTagUpdate.php.
|
private |
Definition at line 62 of file RevertedTagUpdate.php.
|
private |
Definition at line 65 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\__construct().
|
private |
Definition at line 71 of file RevertedTagUpdate.php.
|
private |
Definition at line 50 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\__construct().
|
private |
Definition at line 56 of file RevertedTagUpdate.php.
Referenced by MediaWiki\Storage\RevertedTagUpdate\__construct().
const MediaWiki\Storage\RevertedTagUpdate::CONSTRUCTOR_OPTIONS = [ MainConfigNames::RevertedTagMaxDepth ] |
Definition at line 47 of file RevertedTagUpdate.php.