MediaWiki REL1_33
|
Controller-like object for creating and updating pages by creating new revisions. More...
Public Member Functions | |
__construct (User $user, WikiPage $wikiPage, DerivedPageDataUpdater $derivedDataUpdater, LoadBalancer $loadBalancer, RevisionStore $revisionStore, SlotRoleRegistry $slotRoleRegistry) | |
addTag ( $tag) | |
Sets a tag to apply to this update. | |
addTags (array $tags) | |
Sets tags to apply to this update. | |
getExplicitTags () | |
Returns the list of tags set using the addTag() method. | |
getNewRevision () | |
The new revision created by saveRevision(), or null if saveRevision() has not yet been called, failed, or did not create a new revision because the content did not change. | |
getOriginalRevisionId () | |
Returns the ID of an earlier revision that is being repeated or restored by this update. | |
getStatus () | |
The Status object indicating whether saveRevision() was successful, or null if saveRevision() was not yet called on this instance. | |
getUndidRevisionId () | |
Returns the revision ID set by setUndidRevisionId(), indicating what revision is being undone by this edit. | |
grabParentRevision () | |
Returns the revision that was the page's current revision when grabParentRevision() was first called. | |
hasEditConflict ( $expectedParentRevision) | |
Checks whether this update conflicts with another update performed between the client loading data to prepare an edit, and the client committing the edit. | |
inheritSlot (SlotRecord $originalSlot) | |
Explicitly inherit a slot from some earlier revision. | |
isNew () | |
Whether saveRevision() was called and created a new page. | |
isUnchanged () | |
Whether saveRevision() did not create a revision because the content didn't change (null-edit). | |
removeSlot ( $role) | |
Removes the slot with the given role. | |
saveRevision (CommentStoreComment $summary, $flags=0) | |
Change an existing article or create a new article. | |
setAjaxEditStash ( $ajaxEditStash) | |
setContent ( $role, Content $content) | |
Set the new content for the given slot role. | |
setOriginalRevisionId ( $originalRevId) | |
Sets the ID of an earlier revision that is being repeated or restored by this update. | |
setRcPatrolStatus ( $status) | |
Sets the "patrolled" status of the edit. | |
setSlot (SlotRecord $slot) | |
Set the new slot for the given slot role. | |
setUndidRevisionId ( $undidRevId) | |
Sets the ID of revision that was undone by the present update. | |
setUseAutomaticEditSummaries ( $useAutomaticEditSummaries) | |
Can be used to enable or disable automatic summaries that are applied to certain kinds of changes, like completely blanking a page. | |
setUsePageCreationLog ( $use) | |
Whether to create a log entry for new page creations. | |
wasCommitted () | |
Whether saveRevision() has been called on this instance. | |
wasSuccessful () | |
Whether saveRevision() completed successfully. | |
Private Member Functions | |
checkAllRequiredRoles (array $roles, Status $status) | |
checkAllRolesAllowed (array $roles, Status $status) | |
checkFlags ( $flags) | |
Check flags and add EDIT_NEW or EDIT_UPDATE to them as needed. | |
checkNoRolesRequired (array $roles, Status $status) | |
computeEffectiveTags ( $flags) | |
doCreate (CommentStoreComment $summary, User $user, $flags) | |
doModify (CommentStoreComment $summary, User $user, $flags) | |
ensureRoleAllowed ( $role) | |
ensureRoleNotRequired ( $role) | |
getAllowedSlotRoles () | |
getAtomicSectionUpdate (IDatabase $dbw, WikiPage $wikiPage, RevisionRecord $newRevisionRecord, User $user, CommentStoreComment $summary, $flags, Status $status, $hints=[]) | |
getContentHandler ( $role) | |
getDBConnectionRef ( $mode) | |
getLinkTarget () | |
getParentContent ( $role) | |
Returns the content of the given slot of the parent revision, with no audience checks applied. | |
getRequiredSlotRoles () | |
getTitle () | |
getWikiId () | |
getWikiPage () | |
makeAutoSummary ( $flags) | |
makeNewRevision (CommentStoreComment $comment, User $user, $flags, Status $status) | |
Constructs a MutableRevisionRecord based on the Content prepared by the DerivedPageDataUpdater. | |
Private Attributes | |
boolean | $ajaxEditStash = true |
see $wgAjaxEditStash | |
DerivedPageDataUpdater | $derivedDataUpdater |
LoadBalancer | $loadBalancer |
bool int | $originalRevId = false |
int | $rcPatrolStatus = RecentChange::PRC_UNPATROLLED |
the RC patrol status the new revision should be marked with. | |
RevisionStore | $revisionStore |
SlotRoleRegistry | $slotRoleRegistry |
RevisionSlotsUpdate | $slotsUpdate |
Status null | $status = null |
array | $tags = [] |
int | $undidRevId = 0 |
boolean | $useAutomaticEditSummaries = true |
see $wgUseAutomaticEditSummaries | |
bool | $usePageCreationLog = true |
whether to create a log entry for new page creations. | |
User | $user |
WikiPage | $wikiPage |
Controller-like object for creating and updating pages by creating new revisions.
PageUpdater instances provide compare-and-swap (CAS) protection against concurrent updates between the time grabParentRevision() is called and saveRevision() inserts a new revision. This allows application logic to safely perform edit conflict resolution using the parent revision's content.
MCR migration note: this replaces the relevant methods in WikiPage.
Definition at line 72 of file PageUpdater.php.
MediaWiki\Storage\PageUpdater::__construct | ( | User | $user, |
WikiPage | $wikiPage, | ||
DerivedPageDataUpdater | $derivedDataUpdater, | ||
LoadBalancer | $loadBalancer, | ||
RevisionStore | $revisionStore, | ||
SlotRoleRegistry | $slotRoleRegistry ) |
User | $user | |
WikiPage | $wikiPage | |
DerivedPageDataUpdater | $derivedDataUpdater | |
LoadBalancer | $loadBalancer | |
RevisionStore | $revisionStore | |
SlotRoleRegistry | $slotRoleRegistry |
Definition at line 158 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$derivedDataUpdater, MediaWiki\Storage\PageUpdater\$loadBalancer, MediaWiki\Storage\PageUpdater\$revisionStore, MediaWiki\Storage\PageUpdater\$slotRoleRegistry, MediaWiki\Storage\PageUpdater\$user, and MediaWiki\Storage\PageUpdater\$wikiPage.
MediaWiki\Storage\PageUpdater::addTag | ( | $tag | ) |
Sets a tag to apply to this update.
Callers are responsible for permission checks, using ChangeTags::canAddTagsAccompanyingChange.
string | $tag |
Definition at line 457 of file PageUpdater.php.
References and().
Referenced by MediaWiki\Storage\PageUpdater\addTags().
MediaWiki\Storage\PageUpdater::addTags | ( | array | $tags | ) |
Sets tags to apply to this update.
Callers are responsible for permission checks, using ChangeTags::canAddTagsAccompanyingChange.
string[] | $tags |
Definition at line 468 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$tags, and MediaWiki\Storage\PageUpdater\addTag().
Definition at line 1297 of file PageUpdater.php.
References and(), and MediaWiki\Storage\PageUpdater\getRequiredSlotRoles().
Referenced by MediaWiki\Storage\PageUpdater\makeNewRevision().
Definition at line 1271 of file PageUpdater.php.
References and(), and MediaWiki\Storage\PageUpdater\getAllowedSlotRoles().
Referenced by MediaWiki\Storage\PageUpdater\saveRevision().
|
private |
Check flags and add EDIT_NEW or EDIT_UPDATE to them as needed.
int | $flags |
Definition at line 334 of file PageUpdater.php.
References EDIT_NEW, and EDIT_UPDATE.
Referenced by MediaWiki\Storage\PageUpdater\saveRevision().
Definition at line 1284 of file PageUpdater.php.
References and(), and MediaWiki\Storage\PageUpdater\getRequiredSlotRoles().
Referenced by MediaWiki\Storage\PageUpdater\saveRevision().
|
private |
int | $flags | Bit mask: a bit mask of EDIT_XXX flags. |
Definition at line 488 of file PageUpdater.php.
References $content, $handler, MediaWiki\Storage\PageUpdater\$tags, and(), MediaWiki\Storage\PageUpdater\getContentHandler(), MediaWiki\Storage\PageUpdater\getParentContent(), and ChangeTags\getSoftwareTags().
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), and MediaWiki\Storage\PageUpdater\doModify().
|
private |
CommentStoreComment | $summary | The edit summary |
User | $user | The revision's author |
int | $flags | EXIT_XXX constants |
DBUnexpectedError | |
MWException |
Definition at line 1078 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$status, MediaWiki\Storage\PageUpdater\$tags, MediaWiki\Storage\PageUpdater\$wikiPage, and(), MediaWiki\Storage\PageUpdater\computeEffectiveTags(), DB_MASTER, EDIT_FORCE_BOT, EDIT_SUPPRESS_RC, MediaWiki\Storage\PageUpdater\getAtomicSectionUpdate(), MediaWiki\Storage\PageUpdater\getDBConnectionRef(), MediaWiki\Storage\PageUpdater\getTitle(), MediaWiki\Storage\PageUpdater\getWikiPage(), WikiPage\insertOn(), MediaWiki\Storage\PageUpdater\makeNewRevision(), and WikiPage\updateRevisionOn().
Referenced by MediaWiki\Storage\PageUpdater\saveRevision().
|
private |
CommentStoreComment | $summary | The edit summary |
User | $user | The revision's author |
int | $flags | EXIT_XXX constants |
MWException |
Definition at line 927 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$status, MediaWiki\Storage\PageUpdater\$tags, MediaWiki\Storage\PageUpdater\$wikiPage, and(), MediaWiki\Storage\PageUpdater\computeEffectiveTags(), DB_MASTER, EDIT_FORCE_BOT, EDIT_SUPPRESS_RC, MediaWiki\Storage\PageUpdater\getAtomicSectionUpdate(), MediaWiki\Storage\PageUpdater\getDBConnectionRef(), MediaWiki\Storage\PageUpdater\getOriginalRevisionId(), MediaWiki\Storage\PageUpdater\getTitle(), MediaWiki\Storage\PageUpdater\getWikiPage(), MediaWiki\Storage\PageUpdater\grabParentRevision(), WikiPage\lockAndGetLatest(), MediaWiki\Storage\PageUpdater\makeNewRevision(), and WikiPage\updateRevisionOn().
Referenced by MediaWiki\Storage\PageUpdater\saveRevision().
|
private |
Definition at line 1257 of file PageUpdater.php.
References and(), and MediaWiki\Storage\PageUpdater\getAllowedSlotRoles().
Referenced by MediaWiki\Storage\PageUpdater\setContent(), and MediaWiki\Storage\PageUpdater\setSlot().
|
private |
Definition at line 1264 of file PageUpdater.php.
References and(), and MediaWiki\Storage\PageUpdater\getRequiredSlotRoles().
Referenced by MediaWiki\Storage\PageUpdater\removeSlot().
|
private |
Definition at line 1253 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\getTitle().
Referenced by MediaWiki\Storage\PageUpdater\checkAllRolesAllowed(), and MediaWiki\Storage\PageUpdater\ensureRoleAllowed().
|
private |
Definition at line 1196 of file PageUpdater.php.
References $params, MediaWiki\Storage\PageUpdater\$status, MediaWiki\Storage\PageUpdater\$undidRevId, MediaWiki\Storage\PageUpdater\$user, MediaWiki\Storage\PageUpdater\$wikiPage, and(), EDIT_MINOR, and MediaWiki\Storage\PageUpdater\getOriginalRevisionId().
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), and MediaWiki\Storage\PageUpdater\doModify().
|
private |
string | $role | slot role name |
Definition at line 534 of file PageUpdater.php.
References $parent, and MediaWiki\Storage\PageUpdater\grabParentRevision().
Referenced by MediaWiki\Storage\PageUpdater\computeEffectiveTags(), and MediaWiki\Storage\PageUpdater\makeAutoSummary().
|
private |
int | $mode | DB_MASTER or DB_REPLICA |
Definition at line 229 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\getWikiId().
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), and MediaWiki\Storage\PageUpdater\doModify().
MediaWiki\Storage\PageUpdater::getExplicitTags | ( | ) |
Returns the list of tags set using the addTag() method.
Definition at line 480 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$tags.
|
private |
Definition at line 236 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\saveRevision().
MediaWiki\Storage\PageUpdater::getNewRevision | ( | ) |
The new revision created by saveRevision(), or null if saveRevision() has not yet been called, failed, or did not create a new revision because the content did not change.
Definition at line 850 of file PageUpdater.php.
MediaWiki\Storage\PageUpdater::getOriginalRevisionId | ( | ) |
Returns the ID of an earlier revision that is being repeated or restored by this update.
Definition at line 409 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$originalRevId.
Referenced by MediaWiki\Storage\PageUpdater\doModify(), and MediaWiki\Storage\PageUpdater\getAtomicSectionUpdate().
|
private |
Returns the content of the given slot of the parent revision, with no audience checks applied.
If there is no parent revision or the slot is not defined, this returns null.
string | $role | slot role name |
Definition at line 520 of file PageUpdater.php.
References $parent, and MediaWiki\Storage\PageUpdater\grabParentRevision().
Referenced by MediaWiki\Storage\PageUpdater\computeEffectiveTags(), and MediaWiki\Storage\PageUpdater\makeAutoSummary().
|
private |
Definition at line 1246 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\getTitle().
Referenced by MediaWiki\Storage\PageUpdater\checkAllRequiredRoles(), MediaWiki\Storage\PageUpdater\checkNoRolesRequired(), and MediaWiki\Storage\PageUpdater\ensureRoleNotRequired().
MediaWiki\Storage\PageUpdater::getStatus | ( | ) |
The Status object indicating whether saveRevision() was successful, or null if saveRevision() was not yet called on this instance.
Possible status errors: edit-hook-aborted: The ArticleSave hook aborted the update but didn't set the fatal flag of $status. edit-gone-missing: In update mode, but the article didn't exist. edit-conflict: In update mode, the article changed unexpectedly. edit-no-change: Warning that the text was the same as before. edit-already-exists: In creation mode, but the article already exists.
Extensions may define additional errors.
$return->value will contain an associative array with members as follows: new: Boolean indicating if the function attempted to create a new article. revision: The revision object for the inserted revision, or null.
Definition at line 809 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$status.
|
private |
Definition at line 244 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), MediaWiki\Storage\PageUpdater\doModify(), MediaWiki\Storage\PageUpdater\getAllowedSlotRoles(), MediaWiki\Storage\PageUpdater\getRequiredSlotRoles(), and MediaWiki\Storage\PageUpdater\makeNewRevision().
MediaWiki\Storage\PageUpdater::getUndidRevisionId | ( | ) |
Returns the revision ID set by setUndidRevisionId(), indicating what revision is being undone by this edit.
Definition at line 435 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$undidRevId.
|
private |
Definition at line 220 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\getDBConnectionRef().
|
private |
Definition at line 252 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$wikiPage.
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), MediaWiki\Storage\PageUpdater\doModify(), MediaWiki\Storage\PageUpdater\makeNewRevision(), and MediaWiki\Storage\PageUpdater\saveRevision().
MediaWiki\Storage\PageUpdater::grabParentRevision | ( | ) |
Returns the revision that was the page's current revision when grabParentRevision() was first called.
This revision is the expected parent revision of the update, and will be recorded as the new revision's parent revision (unless no new revision is created because the content was not changed).
This method MUST not be called after saveRevision() was called!
The current revision determined by the first call to this methods effectively acts a compare-and-swap (CAS) token which is checked by saveRevision(), which fails if any concurrent updates created a new revision.
Application code should call this method before applying transformations to the new content that depend on the parent revision, e.g. adding/replacing sections, or resolving conflicts via a 3-way merge. This protects against race conditions triggered by concurrent updates.
LogicException | if called after saveRevision(). |
Definition at line 324 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\doModify(), MediaWiki\Storage\PageUpdater\getContentHandler(), MediaWiki\Storage\PageUpdater\getParentContent(), MediaWiki\Storage\PageUpdater\hasEditConflict(), MediaWiki\Storage\PageUpdater\makeNewRevision(), and MediaWiki\Storage\PageUpdater\saveRevision().
MediaWiki\Storage\PageUpdater::hasEditConflict | ( | $expectedParentRevision | ) |
Checks whether this update conflicts with another update performed between the client loading data to prepare an edit, and the client committing the edit.
This is intended to detect user level "edit conflict" when the latest revision known to the client is no longer the current revision when processing the update.
An update expected to create a new page can be checked by setting $expectedParentRevision = 0. Such an update is considered to have a conflict if a current revision exists (that is, the page was created since the edit was initiated on the client).
This method returning true indicates to calling code that edit conflict resolution should be applied before saving any data. It does not prevent the update from being performed, and it should not be confused with a "late" conflict indicated by the "edit-conflict" status. A "late" conflict is a CAS failure caused by an update being performed concurrently between the time grabParentRevision() was called and the time saveRevision() trying to insert the new revision.
int | $expectedParentRevision | The ID of the revision the client expects to be the current one. Use 0 to indicate that the page is expected to not yet exist. |
Definition at line 290 of file PageUpdater.php.
References $parent, and(), and MediaWiki\Storage\PageUpdater\grabParentRevision().
MediaWiki\Storage\PageUpdater::inheritSlot | ( | SlotRecord | $originalSlot | ) |
Explicitly inherit a slot from some earlier revision.
The primary use case for this is rollbacks, when slots are to be inherited from the rollback target, overriding the content from the parent revision (which is the revision being rolled back).
This should typically not be used to inherit slots from the parent revision, which happens implicitly. Using this method causes the given slot to be treated as "modified" during revision creation, even if it has the same content as in the parent revision.
SlotRecord | $originalSlot | A slot already existing in the database, to be inherited by the new revision. |
Definition at line 379 of file PageUpdater.php.
MediaWiki\Storage\PageUpdater::isNew | ( | ) |
Whether saveRevision() was called and created a new page.
Definition at line 827 of file PageUpdater.php.
MediaWiki\Storage\PageUpdater::isUnchanged | ( | ) |
Whether saveRevision() did not create a revision because the content didn't change (null-edit).
Whether the content changed or not is determined by DerivedPageDataUpdater::isChange().
Definition at line 838 of file PageUpdater.php.
|
private |
int | $flags | Bit mask: a bit mask of EDIT_XXX flags. |
Definition at line 556 of file PageUpdater.php.
References $content, $handler, EDIT_AUTOSUMMARY, MediaWiki\Storage\PageUpdater\getContentHandler(), and MediaWiki\Storage\PageUpdater\getParentContent().
Referenced by MediaWiki\Storage\PageUpdater\saveRevision().
|
private |
Constructs a MutableRevisionRecord based on the Content prepared by the DerivedPageDataUpdater.
This takes care of inheriting slots, updating slots with PST applied, and removing discontinued slots.
This calls Content::prepareSave() to verify that the slot content can be saved. The $status parameter is updated with any errors or warnings found by Content::prepareSave().
CommentStoreComment | $comment | |
User | $user | |
int | $flags | |
Status | $status |
Definition at line 871 of file PageUpdater.php.
References $content, $parent, $rev, MediaWiki\Storage\PageUpdater\$wikiPage, MediaWiki\Storage\PageUpdater\checkAllRequiredRoles(), EDIT_MINOR, MediaWiki\Storage\PageUpdater\getTitle(), MediaWiki\Storage\PageUpdater\getWikiPage(), and MediaWiki\Storage\PageUpdater\grabParentRevision().
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), and MediaWiki\Storage\PageUpdater\doModify().
MediaWiki\Storage\PageUpdater::removeSlot | ( | $role | ) |
Removes the slot with the given role.
This discontinues the "stream" of slots with this role on the page, preventing the new revision, and any subsequent revisions, from inheriting the slot with this role.
string | $role | A slot role name (but not "main") |
Definition at line 397 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\ensureRoleNotRequired().
MediaWiki\Storage\PageUpdater::saveRevision | ( | CommentStoreComment | $summary, |
$flags = 0 ) |
Change an existing article or create a new article.
Updates RC and all necessary caches, optionally via the deferred update array. This does not check user permissions.
It is guaranteed that saveRevision() will fail if the current revision of the page changes after grabParentRevision() was called and before saveRevision() can insert a new revision, as per the CAS mechanism described above.
The caller is however responsible for calling hasEditConflict() to detect a user-level edit conflict, and to adjust the content of the new revision accordingly, e.g. by using a 3-way-merge.
MCR migration note: this replaces WikiPage::doEditContent. Callers that change to using saveRevision() now need to check the "minoredit" themselves before using EDIT_MINOR.
CommentStoreComment | $summary | Edit summary |
int | $flags | Bitfield: EDIT_NEW Create a new page, or fail with "edit-already-exists" if the page exists. EDIT_UPDATE Create a new revision, or fail with "edit-gone-missing" if the page does not exist. EDIT_MINOR Mark this revision as minor EDIT_SUPPRESS_RC Do not log the change in recentchanges EDIT_FORCE_BOT Mark the revision as automated ("bot edit") EDIT_AUTOSUMMARY Fill in blank summaries with generated text where possible EDIT_INTERNAL Signal that the page retrieve/save cycle happened entirely in this request. |
If neither EDIT_NEW nor EDIT_UPDATE is specified, the expected state is detected automatically via grabParentRevision(). In this case, the "edit-already-exists" or "edit-gone-missing" errors may still be triggered due to race conditions, if the page was unexpectedly created or deleted while revision creation is in progress. This can be viewed as part of the CAS mechanism described above.
MWException | |
RuntimeException |
Definition at line 624 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$ajaxEditStash, MediaWiki\Storage\PageUpdater\$status, MediaWiki\Storage\PageUpdater\$user, MediaWiki\Storage\PageUpdater\$wikiPage, and(), MediaWiki\Storage\PageUpdater\checkAllRolesAllowed(), MediaWiki\Storage\PageUpdater\checkFlags(), MediaWiki\Storage\PageUpdater\checkNoRolesRequired(), MediaWiki\Storage\PageUpdater\doCreate(), MediaWiki\Storage\PageUpdater\doModify(), EDIT_FORCE_BOT, EDIT_INTERNAL, EDIT_MINOR, EDIT_UPDATE, MediaWiki\Storage\PageUpdater\getLinkTarget(), MediaWiki\Storage\PageUpdater\getWikiPage(), MediaWiki\Storage\PageUpdater\grabParentRevision(), MediaWiki\Storage\PageUpdater\makeAutoSummary(), MediaWiki\Storage\PageUpdater\wasCommitted(), and wfMessage().
MediaWiki\Storage\PageUpdater::setAjaxEditStash | ( | $ajaxEditStash | ) |
bool | $ajaxEditStash |
Definition at line 216 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$ajaxEditStash.
MediaWiki\Storage\PageUpdater::setContent | ( | $role, | |
Content | $content ) |
Set the new content for the given slot role.
string | $role | A slot role name (such as "main") |
Content | $content |
Definition at line 348 of file PageUpdater.php.
References $content, and MediaWiki\Storage\PageUpdater\ensureRoleAllowed().
MediaWiki\Storage\PageUpdater::setOriginalRevisionId | ( | $originalRevId | ) |
Sets the ID of an earlier revision that is being repeated or restored by this update.
The new revision is expected to have the exact same content as the given original revision. This is used with rollbacks and with dummy "null" revisions which are created to record things like page moves.
This value is passed to the PageContentSaveComplete and NewRevisionFromEditComplete hooks.
int | bool | $originalRevId | The original revision id, or false if no earlier revision is known to be repeated or restored by this update. |
Definition at line 424 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$originalRevId.
MediaWiki\Storage\PageUpdater::setRcPatrolStatus | ( | $status | ) |
Sets the "patrolled" status of the edit.
Callers should check the "patrol" and "autopatrol" permissions as appropriate.
int | $status | RC patrol status, e.g. RecentChange::PRC_AUTOPATROLLED. |
Definition at line 197 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$status.
MediaWiki\Storage\PageUpdater::setSlot | ( | SlotRecord | $slot | ) |
Set the new slot for the given slot role.
SlotRecord | $slot |
Definition at line 359 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\ensureRoleAllowed(), and MediaWiki\Revision\SlotRecord\getRole().
MediaWiki\Storage\PageUpdater::setUndidRevisionId | ( | $undidRevId | ) |
Sets the ID of revision that was undone by the present update.
This is used with the "undo" action, and is expected to hold the oldest revision ID in case more then one revision is being undone.
int | $undidRevId |
Definition at line 446 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$undidRevId.
MediaWiki\Storage\PageUpdater::setUseAutomaticEditSummaries | ( | $useAutomaticEditSummaries | ) |
Can be used to enable or disable automatic summaries that are applied to certain kinds of changes, like completely blanking a page.
bool | $useAutomaticEditSummaries |
Definition at line 184 of file PageUpdater.php.
References MediaWiki\Storage\PageUpdater\$useAutomaticEditSummaries.
MediaWiki\Storage\PageUpdater::setUsePageCreationLog | ( | $use | ) |
Whether to create a log entry for new page creations.
bool | $use |
Definition at line 208 of file PageUpdater.php.
References and().
MediaWiki\Storage\PageUpdater::wasCommitted | ( | ) |
Whether saveRevision() has been called on this instance.
Definition at line 782 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\saveRevision().
MediaWiki\Storage\PageUpdater::wasSuccessful | ( | ) |
Whether saveRevision() completed successfully.
Definition at line 818 of file PageUpdater.php.
|
private |
see $wgAjaxEditStash
Definition at line 123 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\saveRevision(), and MediaWiki\Storage\PageUpdater\setAjaxEditStash().
|
private |
Definition at line 87 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\__construct().
|
private |
Definition at line 92 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\__construct().
|
private |
Definition at line 128 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\getOriginalRevisionId(), and MediaWiki\Storage\PageUpdater\setOriginalRevisionId().
|
private |
the RC patrol status the new revision should be marked with.
Definition at line 113 of file PageUpdater.php.
|
private |
Definition at line 97 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\__construct().
|
private |
Definition at line 102 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\__construct().
|
private |
Definition at line 143 of file PageUpdater.php.
Definition at line 148 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), MediaWiki\Storage\PageUpdater\doModify(), MediaWiki\Storage\PageUpdater\getAtomicSectionUpdate(), MediaWiki\Storage\PageUpdater\getStatus(), MediaWiki\Storage\PageUpdater\saveRevision(), and MediaWiki\Storage\PageUpdater\setRcPatrolStatus().
|
private |
|
private |
Definition at line 138 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\getAtomicSectionUpdate(), MediaWiki\Storage\PageUpdater\getUndidRevisionId(), and MediaWiki\Storage\PageUpdater\setUndidRevisionId().
|
private |
see $wgUseAutomaticEditSummaries
Definition at line 108 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\setUseAutomaticEditSummaries().
|
private |
whether to create a log entry for new page creations.
Definition at line 118 of file PageUpdater.php.
|
private |
Definition at line 77 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\__construct(), MediaWiki\Storage\PageUpdater\getAtomicSectionUpdate(), and MediaWiki\Storage\PageUpdater\saveRevision().
|
private |
Definition at line 82 of file PageUpdater.php.
Referenced by MediaWiki\Storage\PageUpdater\__construct(), MediaWiki\Storage\PageUpdater\doCreate(), MediaWiki\Storage\PageUpdater\doModify(), MediaWiki\Storage\PageUpdater\getAtomicSectionUpdate(), MediaWiki\Storage\PageUpdater\getWikiPage(), MediaWiki\Storage\PageUpdater\makeNewRevision(), and MediaWiki\Storage\PageUpdater\saveRevision().