MediaWiki REL1_36
|
Service for looking up page revisions. More...
Public Member Functions | |
__construct (ILoadBalancer $loadBalancer, SqlBlobStore $blobStore, WANObjectCache $cache, CommentStore $commentStore, NameTableStore $contentModelStore, NameTableStore $slotRoleStore, SlotRoleRegistry $slotRoleRegistry, ActorMigration $actorMigration, ActorStore $actorStore, IContentHandlerFactory $contentHandlerFactory, PageStore $pageStore, TitleFactory $titleFactory, HookContainer $hookContainer, $wikiId=WikiAwareEntity::LOCAL) | |
countAuthorsBetween ( $pageId, RevisionRecord $old=null, RevisionRecord $new=null, Authority $performer=null, $max=null, $options=[]) | |
Get the number of authors between the given revisions. | |
countRevisionsBetween ( $pageId, RevisionRecord $old=null, RevisionRecord $new=null, $max=null, $options=[]) | |
Get the number of revisions between the given revisions. | |
countRevisionsByPageId (IDatabase $db, $id) | |
Get count of revisions per page...not very efficient. | |
countRevisionsByTitle (IDatabase $db, PageIdentity $page) | |
Get count of revisions per page...not very efficient. | |
getArchiveQueryInfo () | |
Return the tables, fields, and join conditions to be selected to create a new RevisionArchiveRecord object. | |
getAuthorsBetween ( $pageId, RevisionRecord $old=null, RevisionRecord $new=null, Authority $performer=null, $max=null, $options=[]) | |
Get the authors between the given revisions or revisions. | |
getContentBlobsForBatch ( $rowsOrIds, $slots=null, $queryFlags=0) | |
Gets raw (serialized) content blobs for the given set of revisions. | |
getFirstRevision ( $page, int $flags=IDBAccessObject::READ_NORMAL) | |
Get the first revision of a given page. | |
getKnownCurrentRevision (PageIdentity $page, $revId=0) | |
Load a revision based on a known page ID and current revision ID from the DB. | |
getNextRevision (RevisionRecord $rev, $flags=self::READ_NORMAL) | |
Get the revision after $rev in the page's history, if any. | |
getPreviousRevision (RevisionRecord $rev, $flags=self::READ_NORMAL) | |
Get the revision before $rev in the page's history, if any. | |
getQueryInfo ( $options=[]) | |
Return the tables, fields, and join conditions to be selected to create a new RevisionStoreRecord object. | |
getRcIdIfUnpatrolled (RevisionRecord $rev) | |
MCR migration note: this replaces Revision::isUnpatrolled. | |
getRecentChange (RevisionRecord $rev, $flags=0) | |
Get the RC object belonging to the current revision, if there's one. | |
getRevisionById ( $id, $flags=0, PageIdentity $page=null) | |
Load a page revision from a given revision ID number. | |
getRevisionByPageId ( $pageId, $revId=0, $flags=0) | |
Load either the current, or a specified, revision that's attached to a given page ID. | |
getRevisionByTimestamp ( $page, string $timestamp, int $flags=IDBAccessObject::READ_NORMAL) | |
Load the revision for the given title with the given timestamp. | |
getRevisionByTitle ( $page, $revId=0, $flags=0) | |
Load either the current, or a specified, revision that's attached to a given link target. | |
getRevisionIdsBetween (int $pageId, RevisionRecord $old=null, RevisionRecord $new=null, ?int $max=null, $options=[], ?string $order=null, int $flags=IDBAccessObject::READ_NORMAL) | |
Get IDs of revisions between the given revisions. | |
getRevisionSizes (array $revIds) | |
Do a batched query for the sizes of a set of revisions. | |
getSlotsQueryInfo ( $options=[]) | |
Return the tables, fields, and join conditions to be selected to create a new SlotRecord. | |
getTimestampFromId ( $id, $flags=0) | |
Get rev_timestamp from rev_id, without loading the rest of the row. | |
getTitle ( $pageId, $revId, $queryFlags=self::READ_NORMAL) | |
Determines the page Title based on the available information. | |
getWikiId () | |
Get the ID of the wiki this revision belongs to. | |
insertRevisionOn (RevisionRecord $rev, IDatabase $dbw) | |
Insert a new revision into the database, returning the new revision record on success and dies horribly on failure. | |
isReadOnly () | |
listRevisionSizes (IDatabase $db, array $revIds) | |
Do a batched query for the sizes of a set of revisions. | |
loadRevisionFromPageId (IDatabase $db, $pageid, $id=0) | |
Load either the current, or a specified, revision that's attached to a given page. | |
loadRevisionFromTimestamp (IDatabase $db, $title, $timestamp) | |
Load the revision for the given title with the given timestamp. | |
loadRevisionFromTitle (IDatabase $db, $title, $id=0) | |
Load either the current, or a specified, revision that's attached to a given page. | |
newMutableRevisionFromArray (array $fields, $queryFlags=0, PageIdentity $page=null) | |
Constructs a new MutableRevisionRecord based on the given associative array following the MW1.29 convention for the Revision constructor. | |
newNullRevision (IDatabase $dbw, PageIdentity $page, CommentStoreComment $comment, $minor, UserIdentity $user) | |
Create a new null-revision for insertion into a page's history. | |
newRevisionFromArchiveRow ( $row, $queryFlags=0, PageIdentity $page=null, array $overrides=[]) | |
Make a fake revision object from an archive table row. | |
newRevisionFromArchiveRowAndSlots ( $row, $slots, $queryFlags=0, PageIdentity $page=null, array $overrides=[]) | |
newRevisionFromRow ( $row, $queryFlags=0, PageIdentity $page=null, $fromCache=false) | |
newRevisionFromRowAndSlots ( $row, $slots, $queryFlags=0, PageIdentity $page=null, $fromCache=false) | |
newRevisionsFromBatch ( $rows, array $options=[], $queryFlags=0, PageIdentity $page=null) | |
Construct a RevisionRecord instance for each row in $rows, and return them as an associative array indexed by revision ID. | |
setLogger (LoggerInterface $logger) | |
updateSlotsOn (RevisionRecord $revision, RevisionSlotsUpdate $revisionSlotsUpdate, IDatabase $dbw) | |
Update derived slots in an existing revision into the database, returning the modified slots on success. | |
userWasLastToEdit (IDatabase $db, $pageId, $userId, $since) | |
Check if no edits were made by other users since the time a user started editing the page. | |
Public Member Functions inherited from MediaWiki\Revision\RevisionFactory | |
newRevisionFromRow ( $row, $queryFlags=self::READ_NORMAL, PageIdentity $page=null) | |
Constructs a RevisionRecord given a database row and content slots. | |
Public Attributes | |
const | INCLUDE_BOTH = 'include_both' |
const | INCLUDE_NEW = 'include_new' |
const | INCLUDE_OLD = 'include_old' |
const | ORDER_NEWEST_TO_OLDEST = 'DESC' |
const | ORDER_OLDEST_TO_NEWEST = 'ASC' |
const | ROW_CACHE_KEY = 'revision-row-1.29' |
Public Attributes inherited from IDBAccessObject | |
const | READ_NONE = -1 |
Constants for object loading bitfield flags (higher => higher QoS) | |
Private Member Functions | |
assertRevisionParameter ( $paramName, $pageId, RevisionRecord $rev=null) | |
Asserts that if revision is provided, it's saved and belongs to the page with provided pageId. | |
checkContent (Content $content, PageIdentity $page, string $role) | |
MCR migration note: this corresponds to Revision::checkContentModel. | |
checkDatabaseDomain (IDatabase $db) | |
Throws an exception if the given database connection does not belong to the wiki this RevisionStore is bound to. | |
constructSlotRecords ( $revId, $slotRows, $queryFlags, PageIdentity $page, $slotContents=null) | |
Factory method for SlotRecords based on known slot rows. | |
ensureRevisionRowMatchesPage ( $row, PageIdentity $page, $context=[]) | |
Check that the given row matches the given PageIdentity object. | |
ensureRevisionRowMatchesTitle ( $row, Title $title, $context=[]) | |
Check that the given row matches the given Title object. | |
failOnEmpty ( $value, $name) | |
failOnNull ( $value, $name) | |
fetchRevisionRowFromConds (IDatabase $db, array $conditions, int $flags=IDBAccessObject::READ_NORMAL, array $options=[]) | |
Given a set of conditions, return a row with the fields necessary to build RevisionRecord objects. | |
getBaseRevisionRow (IDatabase $dbw, RevisionRecord $rev, $parentId) | |
getDBConnectionRef ( $mode, $groups=[]) | |
getDBConnectionRefForQueryFlags ( $queryFlags) | |
getDBLoadBalancer () | |
getPage (?int $pageId, ?int $revId, int $queryFlags=self::READ_NORMAL) | |
Determines the page based on the available information. | |
getPreviousRevisionId (IDatabase $db, RevisionRecord $rev) | |
Get previous revision Id for this page_id This is used to populate rev_parent_id on save. | |
getRelativeRevision (RevisionRecord $rev, $flags, $dir) | |
Implementation of getPreviousRevision and getNextRevision. | |
getRevisionLimitConditions (IDatabase $dbr, RevisionRecord $old=null, RevisionRecord $new=null, $options=[]) | |
Converts revision limits to query conditions. | |
getRevisionRowCacheKey (IDatabase $db, $pageId, $revId) | |
Get a cache key for use with a row as selected with getQueryInfo( [ 'page', 'user' ] ) Caching rows without 'page' or 'user' could lead to issues. | |
getSlotRowsForBatch ( $rowsOrIds, array $options=[], $queryFlags=0) | |
Gets the slot rows associated with a batch of revisions. | |
initializeMutableRevisionFromArray (MutableRevisionRecord $record, array $fields) | |
insertContentRowOn (SlotRecord $slot, IDatabase $dbw, $blobAddress) | |
insertIpChangesRow (IDatabase $dbw, UserIdentity $user, RevisionRecord $rev, $revisionId) | |
Insert IP revision into ip_changes for use when querying for a range. | |
insertRevisionInternal (RevisionRecord $rev, IDatabase $dbw, UserIdentity $user, CommentStoreComment $comment, PageIdentity $page, $pageId, $parentId) | |
insertRevisionRowOn (IDatabase $dbw, RevisionRecord $rev, $parentId) | |
insertSlotOn (IDatabase $dbw, $revisionId, SlotRecord $protoSlot, PageIdentity $page, array $blobHints=[]) | |
insertSlotRowOn (SlotRecord $slot, IDatabase $dbw, $revisionId, $contentId) | |
loadRevisionFromConds (IDatabase $db, array $conditions, int $flags=IDBAccessObject::READ_NORMAL, PageIdentity $page=null, array $options=[]) | |
Given a set of conditions, fetch a revision from the given database connection. | |
loadSlotContent (SlotRecord $slot, $blobData=null, $blobFlags=null, $blobFormat=null, $queryFlags=0) | |
Loads a Content object based on a slot row. | |
loadSlotRecords ( $revId, $queryFlags, PageIdentity $page) | |
newRevisionFromConds (array $conditions, int $flags=IDBAccessObject::READ_NORMAL, PageIdentity $page=null, array $options=[]) | |
Given a set of conditions, fetch a revision. | |
newRevisionSlots ( $revId, $revisionRow, $slotRows, $queryFlags, PageIdentity $page) | |
Factory method for RevisionSlots based on a revision ID. | |
storeContentBlob (SlotRecord $slot, PageIdentity $page, array $blobHints=[]) | |
updateSlotsInternal (RevisionRecord $revision, RevisionSlotsUpdate $revisionSlotsUpdate, IDatabase $dbw) | |
wrapPage (PageIdentity $page) | |
Service for looking up page revisions.
Definition at line 88 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::__construct | ( | ILoadBalancer | $loadBalancer, |
SqlBlobStore | $blobStore, | ||
WANObjectCache | $cache, | ||
CommentStore | $commentStore, | ||
NameTableStore | $contentModelStore, | ||
NameTableStore | $slotRoleStore, | ||
SlotRoleRegistry | $slotRoleRegistry, | ||
ActorMigration | $actorMigration, | ||
ActorStore | $actorStore, | ||
IContentHandlerFactory | $contentHandlerFactory, | ||
PageStore | $pageStore, | ||
TitleFactory | $titleFactory, | ||
HookContainer | $hookContainer, | ||
$wikiId = WikiAwareEntity::LOCAL |
|||
) |
ILoadBalancer | $loadBalancer | |
SqlBlobStore | $blobStore | |
WANObjectCache | $cache | A cache for caching revision rows. This can be the local wiki's default instance even if $wikiId refers to a different wiki, since makeGlobalKey() is used to constructed a key that allows cached revision rows from the same database to be re-used between wikis. For example, enwiki and frwiki will use the same cache keys for revision rows from the wikidatawiki database, regardless of the cache's default key space. |
CommentStore | $commentStore | |
NameTableStore | $contentModelStore | |
NameTableStore | $slotRoleStore | |
SlotRoleRegistry | $slotRoleRegistry | |
ActorMigration | $actorMigration | |
ActorStore | $actorStore | |
IContentHandlerFactory | $contentHandlerFactory | |
PageStore | $pageStore | |
TitleFactory | $titleFactory | |
HookContainer | $hookContainer | |
false | string | $wikiId | Relevant wiki id or WikiAwareEntity::LOCAL for the current one |
Definition at line 193 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$actorMigration, MediaWiki\Revision\RevisionStore\$actorStore, MediaWiki\Revision\RevisionStore\$blobStore, MediaWiki\Revision\RevisionStore\$cache, MediaWiki\Revision\RevisionStore\$commentStore, MediaWiki\Revision\RevisionStore\$contentHandlerFactory, MediaWiki\Revision\RevisionStore\$contentModelStore, MediaWiki\Revision\RevisionStore\$hookContainer, MediaWiki\Revision\RevisionStore\$loadBalancer, MediaWiki\Revision\RevisionStore\$pageStore, MediaWiki\Revision\RevisionStore\$slotRoleRegistry, MediaWiki\Revision\RevisionStore\$slotRoleStore, MediaWiki\Revision\RevisionStore\$titleFactory, and MediaWiki\Revision\RevisionStore\$wikiId.
|
private |
Asserts that if revision is provided, it's saved and belongs to the page with provided pageId.
string | $paramName | |
int | $pageId | |
RevisionRecord | null | $rev |
InvalidArgumentException |
Definition at line 3280 of file RevisionStore.php.
|
private |
MCR migration note: this corresponds to Revision::checkContentModel.
Content | $content | |
PageIdentity | $page | |
string | $role |
MWException | |
MWUnknownContentModelException |
Definition at line 993 of file RevisionStore.php.
References $content.
|
private |
Throws an exception if the given database connection does not belong to the wiki this RevisionStore is bound to.
IDatabase | $db |
MWException |
Definition at line 2610 of file RevisionStore.php.
References Wikimedia\Rdbms\IDatabase\getDomainID().
|
private |
Factory method for SlotRecords based on known slot rows.
int | $revId | The revision to load slots for. |
\\stdClass[] | IResultWrapper | $slotRows | |
int | $queryFlags | |
PageIdentity | $page | |
array | null | $slotContents | a map from blobAddress to slot content blob or Content object. |
Definition at line 1424 of file RevisionStore.php.
References $blob, and wfBacktrace().
MediaWiki\Revision\RevisionStore::countAuthorsBetween | ( | $pageId, | |
RevisionRecord | $old = null , |
||
RevisionRecord | $new = null , |
||
Authority | $performer = null , |
||
$max = null , |
|||
$options = [] |
|||
) |
Get the number of authors between the given revisions.
Used for diffs and other things that really need it.
int | $pageId | The id of the page |
RevisionRecord | null | $old | Old revision . If null is provided, count starting from the first revision (inclusive). |
RevisionRecord | null | $new | New revision. If null is provided, count until the last revision (inclusive). |
Authority | null | $performer | the user who's access rights to apply |
int | null | $max | Limit of Revisions to count, will be incremented to detect truncations. |
string | array | $options | Single option, or an array of options: RevisionStore::INCLUDE_OLD Include $old in the range; $new is excluded. RevisionStore::INCLUDE_NEW Include $new in the range; $old is excluded. RevisionStore::INCLUDE_BOTH Include both $old and $new in the range. |
InvalidArgumentException | in case either revision is unsaved or the revisions do not belong to the same page or unknown option is passed. |
Definition at line 3518 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::countRevisionsBetween | ( | $pageId, | |
RevisionRecord | $old = null , |
||
RevisionRecord | $new = null , |
||
$max = null , |
|||
$options = [] |
|||
) |
Get the number of revisions between the given revisions.
Used for diffs and other things that really need it.
int | $pageId | The id of the page |
RevisionRecord | null | $old | Old revision. If null is provided, count starting from the first revision (inclusive). |
RevisionRecord | null | $new | New revision. If null is provided, count until the last revision (inclusive). |
int | null | $max | Limit of Revisions to count, will be incremented to detect truncations. |
string | array | $options | Single option, or an array of options: RevisionStore::INCLUDE_OLD Include $old in the range; $new is excluded. RevisionStore::INCLUDE_NEW Include $new in the range; $old is excluded. RevisionStore::INCLUDE_BOTH Include both $old and $new in the range. |
InvalidArgumentException | in case either revision is unsaved or the revisions do not belong to the same page. |
Definition at line 3551 of file RevisionStore.php.
References $dbr, and DB_REPLICA.
MediaWiki\Revision\RevisionStore::countRevisionsByPageId | ( | IDatabase | $db, |
$id | |||
) |
Get count of revisions per page...not very efficient.
MCR migration note: this replaces Revision::countByPageId
IDatabase | $db | |
int | $id | Page id |
Definition at line 3066 of file RevisionStore.php.
References Wikimedia\Rdbms\IDatabase\selectRow().
MediaWiki\Revision\RevisionStore::countRevisionsByTitle | ( | IDatabase | $db, |
PageIdentity | $page | ||
) |
Get count of revisions per page...not very efficient.
MCR migration note: this replaces Revision::countByTitle
IDatabase | $db | |
PageIdentity | $page |
Definition at line 3089 of file RevisionStore.php.
|
private |
Check that the given row matches the given PageIdentity object.
When a mismatch is detected, this tries to re-load the title from master, to avoid spurious errors during page moves.
\\stdClass | $row | |
PageIdentity | $page | |
array | $context |
Definition at line 1820 of file RevisionStore.php.
|
private |
Check that the given row matches the given Title object.
When a mismatch is detected, this tries to re-load the title from master, to avoid spurious errors during page moves.
\\stdClass | $row | |
Title | $title | |
array | $context |
Definition at line 1781 of file RevisionStore.php.
References $title, and wfBacktrace().
|
private |
mixed | $value | |
string | $name |
IncompleteRevisionException | if $value is empty |
Definition at line 409 of file RevisionStore.php.
|
private |
mixed | $value | |
string | $name |
IncompleteRevisionException | if $value is null |
Definition at line 392 of file RevisionStore.php.
|
private |
Given a set of conditions, return a row with the fields necessary to build RevisionRecord objects.
MCR migration note: this corresponds to Revision::fetchFromConds
IDatabase | $db | |
array | $conditions | |
int | $flags | (optional) |
array | $options | (optional) additional query options |
Definition at line 2633 of file RevisionStore.php.
References $revQuery, and Wikimedia\Rdbms\IDatabase\selectRow().
MediaWiki\Revision\RevisionStore::getArchiveQueryInfo | ( | ) |
Return the tables, fields, and join conditions to be selected to create a new RevisionArchiveRecord object.
MCR migration note: this replaces Revision::getArchiveQueryInfo
$table
to IDatabase->select()
$vars
to IDatabase->select()
$join_conds
to IDatabase->select()
Definition at line 2821 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getAuthorsBetween | ( | $pageId, | |
RevisionRecord | $old = null , |
||
RevisionRecord | $new = null , |
||
Authority | $performer = null , |
||
$max = null , |
|||
$options = [] |
|||
) |
Get the authors between the given revisions or revisions.
Used for diffs and other things that really need it.
int | $pageId | The id of the page |
RevisionRecord | null | $old | Old revision. If null is provided, count starting from the first revision (inclusive). |
RevisionRecord | null | $new | New revision. If null is provided, count until the last revision (inclusive). |
Authority | null | $performer | the user who's access rights to apply |
int | null | $max | Limit of Revisions to count, will be incremented to detect truncations. |
string | array | $options | Single option, or an array of options: RevisionStore::INCLUDE_OLD Include $old in the range; $new is excluded. RevisionStore::INCLUDE_NEW Include $new in the range; $old is excluded. RevisionStore::INCLUDE_BOTH Include both $old and $new in the range. |
InvalidArgumentException | in case either revision is unsaved or the revisions do not belong to the same page or unknown option is passed. |
Definition at line 3441 of file RevisionStore.php.
References $dbr, and DB_REPLICA.
|
private |
IDatabase | $dbw | |
RevisionRecord | $rev | |
int | $parentId |
Definition at line 888 of file RevisionStore.php.
References MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getPageId(), MediaWiki\Revision\RevisionRecord\getSha1(), MediaWiki\Revision\RevisionRecord\getSize(), MediaWiki\Revision\RevisionRecord\getTimestamp(), MediaWiki\Revision\RevisionRecord\getVisibility(), MediaWiki\Revision\RevisionRecord\isMinor(), and Wikimedia\Rdbms\IDatabase\timestamp().
MediaWiki\Revision\RevisionStore::getContentBlobsForBatch | ( | $rowsOrIds, | |
$slots = null , |
|||
$queryFlags = 0 |
|||
) |
Gets raw (serialized) content blobs for the given set of revisions.
Callers are responsible for unserializing and interpreting the content blobs based on the model_name field and the slot role.
This method is intended for bulk operations in maintenance scripts. It may be chosen over newRevisionsFromBatch by code that are only interested in raw content, as opposed to meta data. Code that needs to access meta data of revisions, slots, or content objects should use newRevisionsFromBatch() instead.
Traversable | array | $rowsOrIds | list of revision ids, or revision rows from a db query. |
array | null | $slots | the role names for which to get slots. |
int | $queryFlags |
Definition at line 2191 of file RevisionStore.php.
|
private |
int | $mode | DB_MASTER or DB_REPLICA |
array | $groups |
Definition at line 272 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\getDBLoadBalancer().
Referenced by MediaWiki\Revision\RevisionStore\getDBConnectionRefForQueryFlags().
|
private |
int | $queryFlags | a bit field composed of READ_XXX flags |
Definition at line 261 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\getDBConnectionRef().
|
private |
Definition at line 243 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$loadBalancer.
Referenced by MediaWiki\Revision\RevisionStore\getDBConnectionRef().
MediaWiki\Revision\RevisionStore::getFirstRevision | ( | $page, | |
int | $flags = IDBAccessObject::READ_NORMAL |
||
) |
Get the first revision of a given page.
LinkTarget | PageIdentity | $page | Calling with LinkTarget is deprecated since 1.36 |
int | $flags |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 3231 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getKnownCurrentRevision | ( | PageIdentity | $page, |
$revId = 0 |
|||
) |
Load a revision based on a known page ID and current revision ID from the DB.
This method allows for the use of caching, though accessing anything that normally requires permission checks (aside from the text) will trigger a small DB lookup.
MCR migration note: this replaces Revision::newKnownCurrent
PageIdentity | $page | the associated page |
int | $revId | current revision of this page. Defaults to $title->getLatestRevID(). |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 3157 of file RevisionStore.php.
References $title, MediaWiki\DAO\WikiAwareEntity\assertWiki(), DB_REPLICA, and wfWarn().
MediaWiki\Revision\RevisionStore::getNextRevision | ( | RevisionRecord | $rev, |
$flags = self::READ_NORMAL |
|||
) |
Get the revision after $rev in the page's history, if any.
Will return null for the latest revision but also for deleted or unsaved revisions.
MCR migration note: this replaces Revision::getNext
RevisionRecord | $rev | |
int | $flags | (optional) $flags include: IDBAccessObject::READ_LATEST: Select the data from the master |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 2982 of file RevisionStore.php.
|
private |
Determines the page based on the available information.
int | null | $pageId | |
int | null | $revId | |
int | $queryFlags |
RevisionAccessException |
Definition at line 313 of file RevisionStore.php.
References $title, MediaWiki\Revision\RevisionStore\getPage(), wfBacktrace(), and MediaWiki\Revision\RevisionStore\wrapPage().
Referenced by MediaWiki\Revision\RevisionStore\getPage(), and MediaWiki\Revision\RevisionStore\getTitle().
MediaWiki\Revision\RevisionStore::getPreviousRevision | ( | RevisionRecord | $rev, |
$flags = self::READ_NORMAL |
|||
) |
Get the revision before $rev in the page's history, if any.
Will return null for the first revision but also for deleted or unsaved revisions.
MCR migration note: this replaces Revision::getPrevious
RevisionRecord | $rev | |
int | $flags | (optional) $flags include: IDBAccessObject::READ_LATEST: Select the data from the master |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 2965 of file RevisionStore.php.
|
private |
Get previous revision Id for this page_id This is used to populate rev_parent_id on save.
MCR migration note: this corresponds to Revision::getPreviousRevisionId
IDatabase | $db | |
RevisionRecord | $rev |
Definition at line 2997 of file RevisionStore.php.
References MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getPageId(), and Wikimedia\Rdbms\IDatabase\selectField().
MediaWiki\Revision\RevisionStore::getQueryInfo | ( | $options = [] | ) |
Return the tables, fields, and join conditions to be selected to create a new RevisionStoreRecord object.
MCR migration note: this replaces Revision::getQueryInfo
If the format of fields returned changes in any way then the cache key provided by self::getRevisionRowCacheKey should be updated.
array | $options | Any combination of the following strings
|
$table
to IDatabase->select()
$vars
to IDatabase->select()
$join_conds
to IDatabase->select()
Definition at line 2676 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getRcIdIfUnpatrolled | ( | RevisionRecord | $rev | ) |
MCR migration note: this replaces Revision::isUnpatrolled.
RevisionRecord | $rev |
Definition at line 1109 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getRecentChange | ( | RevisionRecord | $rev, |
$flags = 0 |
|||
) |
Get the RC object belonging to the current revision, if there's one.
MCR migration note: this replaces Revision::getRecentChange
RevisionRecord | $rev | |
int | $flags | (optional) $flags include: IDBAccessObject::READ_LATEST: Select the data from the master |
Definition at line 1131 of file RevisionStore.php.
References MediaWiki\Revision\RevisionRecord\getId().
|
private |
Implementation of getPreviousRevision and getNextRevision.
RevisionRecord | $rev | |
int | $flags | |
string | $dir | 'next' or 'prev' |
Definition at line 2900 of file RevisionStore.php.
References MediaWiki\Revision\RevisionRecord\getId(), and MediaWiki\Revision\RevisionRecord\getPageId().
MediaWiki\Revision\RevisionStore::getRevisionById | ( | $id, | |
$flags = 0 , |
|||
PageIdentity | $page = null |
||
) |
Load a page revision from a given revision ID number.
Returns null if no such revision can be found.
MCR migration note: this replaces Revision::newFromId
$flags include: IDBAccessObject::READ_LATEST: Select the data from the master IDBAccessObject::READ_LOCKING : Select & lock the data from the master
int | $id | |
int | $flags | (optional) |
PageIdentity | null | $page | The page the revision belongs to. Providing the page may improve performance. |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 1242 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getRevisionByPageId | ( | $pageId, | |
$revId = 0 , |
|||
$flags = 0 |
|||
) |
Load either the current, or a specified, revision that's attached to a given page ID.
Returns null if no such revision can be found.
MCR migration note: this replaces Revision::newFromPageId
$flags include: IDBAccessObject::READ_LATEST: Select the data from the master (since 1.20) IDBAccessObject::READ_LOCKING : Select & lock the data from the master
int | $pageId | |
int | $revId | (optional) |
int | $flags | Bitfield (optional) |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 1309 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getRevisionByTimestamp | ( | $page, | |
string | $timestamp, | ||
int | $flags = IDBAccessObject::READ_NORMAL |
||
) |
Load the revision for the given title with the given timestamp.
WARNING: Timestamps may in some circumstances not be unique, so this isn't the best key to use.
MCR migration note: this replaces Revision::loadFromTimestamp
LinkTarget | PageIdentity | $page | Calling with LinkTarget is deprecated since 1.36 |
string | $timestamp | |
int | $flags | Bitfield (optional) include: IDBAccessObject::READ_LATEST: Select the data from the master IDBAccessObject::READ_LOCKING: Select & lock the data from the master Default: IDBAccessObject::READ_NORMAL |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 1348 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getRevisionByTitle | ( | $page, | |
$revId = 0 , |
|||
$flags = 0 |
|||
) |
Load either the current, or a specified, revision that's attached to a given link target.
If not attached to that link target, will return null.
MCR migration note: this replaces Revision::newFromTitle
$flags include: IDBAccessObject::READ_LATEST: Select the data from the master IDBAccessObject::READ_LOCKING : Select & lock the data from the master
LinkTarget | PageIdentity | $page | Calling with LinkTarget is deprecated since 1.36 |
int | $revId | (optional) |
int | $flags | Bitfield (optional) |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 1262 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getRevisionIdsBetween | ( | int | $pageId, |
RevisionRecord | $old = null , |
||
RevisionRecord | $new = null , |
||
?int | $max = null , |
||
$options = [] , |
|||
?string | $order = null , |
||
int | $flags = IDBAccessObject::READ_NORMAL |
||
) |
Get IDs of revisions between the given revisions.
int | $pageId | The id of the page |
RevisionRecord | null | $old | Old revision. If null is provided, count starting from the first revision (inclusive). |
RevisionRecord | null | $new | New revision. If null is provided, count until the last revision (inclusive). |
int | null | $max | Limit of Revisions to count, will be incremented by one to detect truncations. |
string | array | $options | Single option, or an array of options: RevisionStore::INCLUDE_OLD Include $old in the range; $new is excluded. RevisionStore::INCLUDE_NEW Include $new in the range; $old is excluded. RevisionStore::INCLUDE_BOTH Include both $old and $new in the range. |
string | null | $order | The direction in which the revisions should be sorted. Possible values:
|
int | $flags |
InvalidArgumentException | in case either revision is unsaved or the revisions do not belong to the same page or unknown option is passed. |
Definition at line 3367 of file RevisionStore.php.
|
private |
Converts revision limits to query conditions.
IDatabase | $dbr | |
RevisionRecord | null | $old | Old revision. If null is provided, count starting from the first revision (inclusive). |
RevisionRecord | null | $new | New revision. If null is provided, count until the last revision (inclusive). |
string | array | $options | Single option, or an array of options: RevisionStore::INCLUDE_OLD Include $old in the range; $new is excluded. RevisionStore::INCLUDE_NEW Include $new in the range; $old is excluded. RevisionStore::INCLUDE_BOTH Include both $old and $new in the range. |
Definition at line 3307 of file RevisionStore.php.
References $dbr.
|
private |
Get a cache key for use with a row as selected with getQueryInfo( [ 'page', 'user' ] ) Caching rows without 'page' or 'user' could lead to issues.
If the format of the rows returned by the query provided by getQueryInfo changes the cache key should be updated to avoid conflicts.
IDatabase | $db | |
int | $pageId | |
int | $revId |
Definition at line 3264 of file RevisionStore.php.
References Wikimedia\Rdbms\IDatabase\getDomainID().
MediaWiki\Revision\RevisionStore::getRevisionSizes | ( | array | $revIds | ) |
Do a batched query for the sizes of a set of revisions.
MCR migration note: this replaces Revision::getParentLengths
int[] | $revIds |
Definition at line 2854 of file RevisionStore.php.
References $dbr, $res, and DB_REPLICA.
|
private |
Gets the slot rows associated with a batch of revisions.
The serialized content of each slot can be included by setting the 'blobs' option. Callers are responsible for unserializing and interpreting the content blobs based on the model_name and role_name fields.
Traversable | array | $rowsOrIds | list of revision ids, or revision or archive rows from a db query. |
array | $options | Supports the following options: 'slots' - a list of slot role names to fetch. If omitted or true or null, all slots are fetched 'blobs' - whether the serialized content of each slot should be loaded. If true, the serialiezd content will be present in the slot row in the blob_data field. |
int | $queryFlags |
Definition at line 2075 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getSlotsQueryInfo | ( | $options = [] | ) |
Return the tables, fields, and join conditions to be selected to create a new SlotRecord.
array | $options | Any combination of the following strings
|
$table
to IDatabase->select()
$vars
to IDatabase->select()
$join_conds
to IDatabase->select()
Definition at line 2756 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getTimestampFromId | ( | $id, | |
$flags = 0 |
|||
) |
Get rev_timestamp from rev_id, without loading the rest of the row.
Historically, there was an extra Title parameter that was passed before $id. This is no longer needed and is deprecated in 1.34.
MCR migration note: this replaces Revision::getTimestampFromId
int | $id | |
int | $flags |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 3033 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::getTitle | ( | $pageId, | |
$revId, | |||
$queryFlags = self::READ_NORMAL |
|||
) |
Determines the page Title based on the available information.
MCR migration note: this corresponds to Revision::getTitle
int | null | $pageId | |
int | null | $revId | |
int | $queryFlags |
RevisionAccessException |
Definition at line 293 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\getPage(), and wfDeprecatedMsg().
MediaWiki\Revision\RevisionStore::getWikiId | ( | ) |
Get the ID of the wiki this revision belongs to.
Definition at line 252 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$wikiId.
|
private |
MutableRevisionRecord | $record | |
array | $fields |
Definition at line 2336 of file RevisionStore.php.
References MediaWiki\Revision\MutableRevisionRecord\setComment(), MediaWiki\Revision\MutableRevisionRecord\setId(), MediaWiki\Revision\MutableRevisionRecord\setMinorEdit(), MediaWiki\Revision\MutableRevisionRecord\setPageId(), MediaWiki\Revision\MutableRevisionRecord\setParentId(), MediaWiki\Revision\MutableRevisionRecord\setSha1(), MediaWiki\Revision\MutableRevisionRecord\setSize(), MediaWiki\Revision\MutableRevisionRecord\setTimestamp(), MediaWiki\Revision\MutableRevisionRecord\setUser(), and MediaWiki\Revision\MutableRevisionRecord\setVisibility().
|
private |
SlotRecord | $slot | |
IDatabase | $dbw | |
string | $blobAddress |
Definition at line 972 of file RevisionStore.php.
References MediaWiki\Revision\SlotRecord\getModel(), MediaWiki\Revision\SlotRecord\getSha1(), MediaWiki\Revision\SlotRecord\getSize(), Wikimedia\Rdbms\IDatabase\insert(), and Wikimedia\Rdbms\IDatabase\insertId().
|
private |
Insert IP revision into ip_changes for use when querying for a range.
IDatabase | $dbw | |
UserIdentity | $user | |
RevisionRecord | $rev | |
int | $revisionId |
Definition at line 748 of file RevisionStore.php.
References MediaWiki\User\UserIdentity\getId(), MediaWiki\User\UserIdentity\getName(), MediaWiki\Revision\RevisionRecord\getTimestamp(), Wikimedia\Rdbms\IDatabase\insert(), and Wikimedia\Rdbms\IDatabase\timestamp().
|
private |
Definition at line 634 of file RevisionStore.php.
References MediaWiki\Revision\RevisionRecord\getSlot(), and MediaWiki\Revision\RevisionRecord\getSlotRoles().
MediaWiki\Revision\RevisionStore::insertRevisionOn | ( | RevisionRecord | $rev, |
IDatabase | $dbw | ||
) |
Insert a new revision into the database, returning the new revision record on success and dies horribly on failure.
MCR migration note: this replaces Revision::insertOn
RevisionRecord | $rev | |
IDatabase | $dbw | (master connection) |
Definition at line 430 of file RevisionStore.php.
References Wikimedia\Rdbms\IDatabase\doAtomicSection(), MediaWiki\Revision\RevisionRecord\getComment(), MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getPage(), MediaWiki\Revision\RevisionRecord\getPageId(), MediaWiki\Revision\RevisionRecord\getParentId(), MediaWiki\Revision\RevisionRecord\getSha1(), MediaWiki\Revision\RevisionRecord\getSize(), MediaWiki\Revision\RevisionRecord\getSlot(), MediaWiki\Revision\RevisionRecord\getSlotRoles(), MediaWiki\Revision\RevisionRecord\getTimestamp(), MediaWiki\Revision\RevisionRecord\getUser(), MediaWiki\Revision\RevisionRecord\isReadyForInsertion(), MediaWiki\Revision\SlotRecord\MAIN, and MediaWiki\Revision\RevisionRecord\RAW.
|
private |
IDatabase | $dbw | |
RevisionRecord | $rev | |
int | $parentId |
MWException | |
MWUnknownContentModelException |
Definition at line 774 of file RevisionStore.php.
References Wikimedia\Rdbms\IDatabase\delete(), MediaWiki\Revision\RevisionRecord\getComment(), Wikimedia\Rdbms\IDatabase\getType(), MediaWiki\Revision\RevisionRecord\getUser(), Wikimedia\Rdbms\IDatabase\insert(), Wikimedia\Rdbms\IDatabase\insertId(), Wikimedia\Rdbms\IDatabase\lock(), Wikimedia\Rdbms\IDatabase\onTransactionResolution(), Wikimedia\Rdbms\IDatabase\query(), Wikimedia\Rdbms\IDatabase\selectField(), Wikimedia\Rdbms\IDatabase\selectSQLText(), and Wikimedia\Rdbms\IDatabase\unlock().
|
private |
IDatabase | $dbw | |
int | $revisionId | |
SlotRecord | $protoSlot | |
PageIdentity | $page | |
array | $blobHints | See the BlobStore::XXX_HINT constants |
Definition at line 710 of file RevisionStore.php.
References MediaWiki\Revision\SlotRecord\getAddress(), MediaWiki\Revision\SlotRecord\getContentId(), MediaWiki\Revision\SlotRecord\hasAddress(), and MediaWiki\Revision\SlotRecord\hasContentId().
|
private |
SlotRecord | $slot | |
IDatabase | $dbw | |
int | $revisionId | |
int | $contentId |
Definition at line 954 of file RevisionStore.php.
References MediaWiki\Revision\SlotRecord\getOrigin(), MediaWiki\Revision\SlotRecord\getRole(), MediaWiki\Revision\SlotRecord\hasOrigin(), and Wikimedia\Rdbms\IDatabase\insert().
MediaWiki\Revision\RevisionStore::isReadOnly | ( | ) |
Definition at line 236 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::listRevisionSizes | ( | IDatabase | $db, |
array | $revIds | ||
) |
Do a batched query for the sizes of a set of revisions.
MCR migration note: this replaces Revision::getParentLengths
IDatabase | $db | |
int[] | $revIds |
Definition at line 2887 of file RevisionStore.php.
References wfDeprecated().
|
private |
Given a set of conditions, fetch a revision from the given database connection.
MCR migration note: this corresponds to Revision::loadFromConds
IDatabase | $db | |
array | $conditions | |
int | $flags | (optional) |
PageIdentity | null | $page | (optional) additional query options |
array | $options | (optional) additional query options |
Definition at line 2588 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::loadRevisionFromPageId | ( | IDatabase | $db, |
$pageid, | |||
$id = 0 |
|||
) |
Load either the current, or a specified, revision that's attached to a given page.
If not attached to that page, will return null.
MCR migration note: this replaces Revision::loadFromPageId
IDatabase | $db | |
int | $pageid | |
int | $id |
Definition at line 2457 of file RevisionStore.php.
References wfDeprecated().
MediaWiki\Revision\RevisionStore::loadRevisionFromTimestamp | ( | IDatabase | $db, |
$title, | |||
$timestamp | |||
) |
Load the revision for the given title with the given timestamp.
WARNING: Timestamps may in some circumstances not be unique, so this isn't the best key to use.
MCR migration note: this replaces Revision::loadFromTimestamp
IDatabase | $db | |
Title | $title | |
string | $timestamp |
Definition at line 2519 of file RevisionStore.php.
References $title, Wikimedia\Rdbms\IDatabase\timestamp(), and wfDeprecated().
MediaWiki\Revision\RevisionStore::loadRevisionFromTitle | ( | IDatabase | $db, |
$title, | |||
$id = 0 |
|||
) |
Load either the current, or a specified, revision that's attached to a given page.
If not attached to that page, will return null.
MCR migration note: this replaces Revision::loadFromTitle
IDatabase | $db | |
Title | $title | |
int | $id |
Definition at line 2485 of file RevisionStore.php.
References $title, and wfDeprecated().
|
private |
Loads a Content object based on a slot row.
This method does not call $slot->getContent(), and may be used as a callback called by $slot->getContent().
MCR migration note: this roughly corresponds to Revision::getContentInternal
SlotRecord | $slot | The SlotRecord to load content for |
string | null | $blobData | The content blob, in the form indicated by $blobFlags |
string | null | $blobFlags | Flags indicating how $blobData needs to be processed. Use null if no processing should happen. That is in constrast to the empty string, which causes the blob to be decoded according to the configured legacy encoding. |
string | null | $blobFormat | MIME type indicating how $dataBlob is encoded |
int | $queryFlags |
RevisionAccessException |
Definition at line 1163 of file RevisionStore.php.
References MediaWiki\Revision\SlotRecord\getAddress(), MediaWiki\Revision\SlotRecord\getModel(), MediaWiki\Revision\SlotRecord\getRevision(), MediaWiki\Revision\SlotRecord\getRole(), MediaWiki\Revision\SlotRecord\hasAddress(), and wfBacktrace().
|
private |
int | $revId | The revision to load slots for. |
int | $queryFlags | |
PageIdentity | $page |
Definition at line 1376 of file RevisionStore.php.
References $res, $revQuery, and wfBacktrace().
MediaWiki\Revision\RevisionStore::newMutableRevisionFromArray | ( | array | $fields, |
$queryFlags = 0 , |
|||
PageIdentity | $page = null |
||
) |
Constructs a new MutableRevisionRecord based on the given associative array following the MW1.29 convention for the Revision constructor.
MCR migration note: this replaces Revision::newFromRow
array | $fields | |
int | $queryFlags | |
PageIdentity | null | $page |
MWException | |
RevisionAccessException |
Implements MediaWiki\Revision\RevisionFactory.
Definition at line 2240 of file RevisionStore.php.
References $content, and wfDeprecated().
MediaWiki\Revision\RevisionStore::newNullRevision | ( | IDatabase | $dbw, |
PageIdentity | $page, | ||
CommentStoreComment | $comment, | ||
$minor, | |||
UserIdentity | $user | ||
) |
Create a new null-revision for insertion into a page's history.
This will not re-save the text, but simply refer to the text from the previous version.
Such revisions can for instance identify page rename operations and other such meta-modifications.
MCR migration note: this replaces Revision::newNullRevision
IDatabase | $dbw | used for obtaining the lock on the page table row |
PageIdentity | $page | the page to read from |
CommentStoreComment | $comment | RevisionRecord's summary |
bool | $minor | Whether the revision should be considered as minor |
UserIdentity | $user | The user to attribute the revision to |
Definition at line 1038 of file RevisionStore.php.
References Wikimedia\Rdbms\IDatabase\selectField().
MediaWiki\Revision\RevisionStore::newRevisionFromArchiveRow | ( | $row, | |
$queryFlags = 0 , |
|||
PageIdentity | $page = null , |
||
array | $overrides = [] |
||
) |
Make a fake revision object from an archive table row.
This is queried for permissions or even inserted (as in Special:Undelete)
MCR migration note: this replaces Revision::newFromArchiveRow
\\stdClass | $row | |
int | $queryFlags | |
PageIdentity | null | $page | |
array | $overrides | associative array with fields of $row to override. This may be used e.g. to force the parent revision ID or page ID. Keys in the array are fields names from the archive table without the 'ar_' prefix, i.e. use 'parent_id' to override ar_parent_id. |
MWException |
Implements MediaWiki\Revision\RevisionFactory.
Definition at line 1542 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::newRevisionFromArchiveRowAndSlots | ( | $row, | |
$slots, | |||
$queryFlags = 0 , |
|||
PageIdentity | $page = null , |
||
array | $overrides = [] |
||
) |
\\stdClass | $row | |
null | \\stdClass[] | RevisionSlots | $slots |
|
int | $queryFlags | |
PageIdentity | null | $page | |
array | $overrides | associative array with fields of $row to override. This may be used e.g. to force the parent revision ID or page ID. Keys in the array are fields names from the archive table without the 'ar_' prefix, i.e. use 'parent_id' to override ar_parent_id. |
MWException |
Definition at line 1591 of file RevisionStore.php.
|
private |
Given a set of conditions, fetch a revision.
This method should be used if we are pretty sure the revision exists. Unless $flags has READ_LATEST set, this method will first try to find the revision on a replica before hitting the master database.
MCR migration note: this corresponds to Revision::newFromConds
array | $conditions | |
int | $flags | (optional) |
PageIdentity | null | $page | (optional) |
array | $options | (optional) additional query options |
Definition at line 2548 of file RevisionStore.php.
References DB_MASTER.
MediaWiki\Revision\RevisionStore::newRevisionFromRow | ( | $row, | |
$queryFlags = 0 , |
|||
PageIdentity | $page = null , |
||
$fromCache = false |
|||
) |
MCR migration note: this replaces Revision::newFromRow
\\stdClass | $row | A database row generated from a query based on getQueryInfo() |
int | $queryFlags | |
PageIdentity | null | $page | Preloaded page object |
bool | $fromCache | if true, the returned RevisionRecord will ensure that no stale data is returned from getters, by querying the database as needed |
Definition at line 1563 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::newRevisionFromRowAndSlots | ( | $row, | |
$slots, | |||
$queryFlags = 0 , |
|||
PageIdentity | $page = null , |
||
$fromCache = false |
|||
) |
\\stdClass | $row | A database row generated from a query based on getQueryInfo() |
null | \\stdClass[] | RevisionSlots | $slots |
|
int | $queryFlags | |
PageIdentity | null | $page | |
bool | $fromCache | if true, the returned RevisionRecord will ensure that no stale data is returned from getters, by querying the database as needed |
MWException |
Definition at line 1670 of file RevisionStore.php.
References wfBacktrace().
MediaWiki\Revision\RevisionStore::newRevisionsFromBatch | ( | $rows, | |
array | $options = [] , |
||
$queryFlags = 0 , |
|||
PageIdentity | $page = null |
||
) |
Construct a RevisionRecord instance for each row in $rows, and return them as an associative array indexed by revision ID.
Use getQueryInfo() or getArchiveQueryInfo() to construct the query that produces the rows.
IResultWrapper | \\stdClass[] | $rows | the rows to construct revision records from |
array | $options | Supports the following options: 'slots' - whether metadata about revision slots should be loaded immediately. Supports falsy or truthy value as well as an explicit list of slot role names. The main slot will always be loaded. 'content' - whether the actual content of the slots should be preloaded. 'archive' - whether the rows where generated using getArchiveQueryInfo(), rather than getQueryInfo. |
int | $queryFlags | |
PageIdentity | null | $page | The page to which all the revision rows belong, if there is such a page and the caller has it handy, so we don't have to look it up again. If this parameter is given and any of the rows has a rev_page_id that is different from Article Id associated with the page, an InvalidArgumentException is thrown. |
Definition at line 1864 of file RevisionStore.php.
|
private |
Factory method for RevisionSlots based on a revision ID.
int | $revId | |
\\stdClass | $revisionRow | |
\\stdClass[] | null | $slotRows | |
int | $queryFlags | |
PageIdentity | $page |
MWException |
Definition at line 1502 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::setLogger | ( | LoggerInterface | $logger | ) |
Definition at line 229 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$logger.
|
private |
SlotRecord | $slot | |
PageIdentity | $page | |
array | $blobHints | See the BlobStore::XXX_HINT constants |
MWException |
Definition at line 920 of file RevisionStore.php.
References $content, MediaWiki\Revision\SlotRecord\getContent(), MediaWiki\Revision\SlotRecord\getRole(), and MediaWiki\Revision\SlotRecord\getSha1().
|
private |
RevisionRecord | $revision | |
RevisionSlotsUpdate | $revisionSlotsUpdate | |
IDatabase | $dbw |
Definition at line 612 of file RevisionStore.php.
References MediaWiki\Storage\RevisionSlotsUpdate\getModifiedSlot().
MediaWiki\Revision\RevisionStore::updateSlotsOn | ( | RevisionRecord | $revision, |
RevisionSlotsUpdate | $revisionSlotsUpdate, | ||
IDatabase | $dbw | ||
) |
Update derived slots in an existing revision into the database, returning the modified slots on success.
RevisionRecord | $revision | After this method returns, the $revision object will be obsolete in that it does not have the new slots. |
RevisionSlotsUpdate | $revisionSlotsUpdate | |
IDatabase | $dbw | (master connection) |
Definition at line 554 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::userWasLastToEdit | ( | IDatabase | $db, |
$pageId, | |||
$userId, | |||
$since | |||
) |
Check if no edits were made by other users since the time a user started editing the page.
Limit to 50 revisions for the sake of performance.
MCR migration note: this replaces Revision::userWasLastToEdit
IDatabase | $db | The Database to perform the check on. |
int | $pageId | The ID of the page in question |
int | $userId | The ID of the user in question |
string | $since | Look at edits since this time |
Definition at line 3115 of file RevisionStore.php.
References $res, $revQuery, Wikimedia\Rdbms\IDatabase\addQuotes(), Wikimedia\Rdbms\IDatabase\select(), and Wikimedia\Rdbms\IDatabase\timestamp().
|
private |
PageIdentity | $page |
Definition at line 371 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\getPage().
|
private |
Definition at line 131 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 134 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 106 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 121 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 126 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 155 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 144 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 158 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 161 of file RevisionStore.php.
|
private |
Definition at line 116 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct(), and MediaWiki\Revision\RevisionStore\getDBLoadBalancer().
|
private |
Definition at line 139 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\setLogger().
|
private |
Definition at line 164 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 152 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 149 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 167 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 111 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct(), and MediaWiki\Revision\RevisionStore\getWikiId().
const MediaWiki\Revision\RevisionStore::INCLUDE_BOTH = 'include_both' |
Definition at line 101 of file RevisionStore.php.
const MediaWiki\Revision\RevisionStore::INCLUDE_NEW = 'include_new' |
Definition at line 100 of file RevisionStore.php.
const MediaWiki\Revision\RevisionStore::INCLUDE_OLD = 'include_old' |
Definition at line 99 of file RevisionStore.php.
const MediaWiki\Revision\RevisionStore::ORDER_NEWEST_TO_OLDEST = 'DESC' |
Definition at line 96 of file RevisionStore.php.
const MediaWiki\Revision\RevisionStore::ORDER_OLDEST_TO_NEWEST = 'ASC' |
Definition at line 95 of file RevisionStore.php.
const MediaWiki\Revision\RevisionStore::ROW_CACHE_KEY = 'revision-row-1.29' |
Definition at line 93 of file RevisionStore.php.