MediaWiki REL1_31
|
Service for looking up page revisions. More...
Public Member Functions | |
__construct (LoadBalancer $loadBalancer, SqlBlobStore $blobStore, WANObjectCache $cache, CommentStore $commentStore, ActorMigration $actorMigration, $wikiId=false) | |
countRevisionsByPageId (IDatabase $db, $id) | |
Get count of revisions per page...not very efficient. | |
countRevisionsByTitle (IDatabase $db, $title) | |
Get count of revisions per page...not very efficient. | |
getArchiveQueryInfo () | |
Return the tables, fields, and join conditions to be selected to create a new archived revision object. | |
getContentHandlerUseDB () | |
getKnownCurrentRevision (Title $title, $revId) | |
Load a revision based on a known page ID and current revision ID from the DB. | |
getNextRevision (RevisionRecord $rev, Title $title=null) | |
Get next revision for this title. | |
getPreviousRevision (RevisionRecord $rev, Title $title=null) | |
Get previous revision for this title. | |
getQueryInfo ( $options=[]) | |
Return the tables, fields, and join conditions to be selected to create a new revision 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) | |
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 ( $title, $timestamp) | |
Load the revision for the given title with the given timestamp. | |
getRevisionByTitle (LinkTarget $linkTarget, $revId=0, $flags=0) | |
Load either the current, or a specified, revision that's attached to a given link target. | |
getRevisionSizes (array $revIds) | |
Do a batched query for the sizes of a set of revisions. | |
getTimestampFromId ( $title, $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. | |
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. | |
loadRevisionFromId (IDatabase $db, $id) | |
Load a page revision from a given revision ID number. | |
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, Title $title=null) | |
Constructs a new MutableRevisionRecord based on the given associative array following the MW1.29 convention for the Revision constructor. | |
newNullRevision (IDatabase $dbw, Title $title, CommentStoreComment $comment, $minor, User $user) | |
Create a new null-revision for insertion into a page's history. | |
newRevisionFromArchiveRow ( $row, $queryFlags=0, Title $title=null, array $overrides=[]) | |
Make a fake revision object from an archive table row. | |
newRevisionFromRow ( $row, $queryFlags=0, Title $title=null) | |
setContentHandlerUseDB ( $contentHandlerUseDB) | |
setLogger (LoggerInterface $logger) | |
userWasLastToEdit (IDatabase $db, $pageId, $userId, $since) | |
Check if no edits were made by other users since the time a user started editing the page. | |
Private Member Functions | |
checkContentModel (Content $content, Title $title) | |
MCR migration note: this corresponds to Revision::checkContentModel. | |
checkDatabaseWikiId (IDatabase $db) | |
Throws an exception if the given database connection does not belong to the wiki this RevisionStore is bound to. | |
emulateMainSlot_1_29 ( $row, $queryFlags, Title $title) | |
Constructs a RevisionRecord for the revisions main slot, based on the MW1.29 schema. | |
failOnEmpty ( $value, $name) | |
failOnNull ( $value, $name) | |
fetchRevisionRowFromConds (IDatabase $db, $conditions, $flags=0) | |
Given a set of conditions, return a row with the fields necessary to build RevisionRecord objects. | |
getDBConnection ( $mode) | |
getDBConnectionRef ( $mode) | |
getDBLoadBalancer () | |
getPreviousRevisionId (IDatabase $db, RevisionRecord $rev) | |
Get previous revision Id for this page_id This is used to populate rev_parent_id on save. | |
initializeMutableRevisionFromArray (MutableRevisionRecord $record, array $fields) | |
loadRevisionFromConds (IDatabase $db, $conditions, $flags=0, Title $title=null) | |
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. | |
newRevisionFromConds ( $conditions, $flags=0, Title $title=null) | |
Given a set of conditions, fetch a revision. | |
newRevisionFromRow_1_29 ( $row, $queryFlags=0, Title $title=null) | |
releaseDBConnection (IDatabase $connection) | |
Static Private Member Functions | |
static | mapArchiveFields ( $archiveRow) |
Maps fields of the archive row to corresponding revision rows. | |
Private Attributes | |
ActorMigration | $actorMigration |
SqlBlobStore | $blobStore |
WANObjectCache | $cache |
CommentStore | $commentStore |
boolean | $contentHandlerUseDB = true |
LoadBalancer | $loadBalancer |
LoggerInterface | $logger |
bool string | $wikiId |
Additional Inherited Members | |
Public Attributes inherited from IDBAccessObject | |
const | READ_LOCKING = 3 |
Constants for object loading bitfield flags (higher => higher QoS) | |
const | READ_NONE = -1 |
Service for looking up page revisions.
Definition at line 68 of file RevisionStore.php.
MediaWiki\Storage\RevisionStore::__construct | ( | LoadBalancer | $loadBalancer, |
SqlBlobStore | $blobStore, | ||
WANObjectCache | $cache, | ||
CommentStore | $commentStore, | ||
ActorMigration | $actorMigration, | ||
$wikiId = false ) |
LoadBalancer | $loadBalancer | |
SqlBlobStore | $blobStore | |
WANObjectCache | $cache | |
CommentStore | $commentStore | |
ActorMigration | $actorMigration | |
bool | string | $wikiId |
Definition at line 121 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\$actorMigration, MediaWiki\Storage\RevisionStore\$blobStore, MediaWiki\Storage\RevisionStore\$cache, MediaWiki\Storage\RevisionStore\$commentStore, MediaWiki\Storage\RevisionStore\$loadBalancer, MediaWiki\Storage\RevisionStore\$wikiId, and cache.
MCR migration note: this corresponds to Revision::checkContentModel.
MWException | |
MWUnknownContentModelException |
Definition at line 504 of file RevisionStore.php.
References $handler, Content\getContentHandler(), Content\getDefaultFormat(), Content\getModel(), and Content\isValid().
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
|
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 1533 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\$wikiId, Wikimedia\Rdbms\IDatabase\getDomainID(), and wfWikiID().
Referenced by MediaWiki\Storage\RevisionStore\countRevisionsByPageId(), MediaWiki\Storage\RevisionStore\fetchRevisionRowFromConds(), MediaWiki\Storage\RevisionStore\getPreviousRevisionId(), MediaWiki\Storage\RevisionStore\insertRevisionOn(), MediaWiki\Storage\RevisionStore\listRevisionSizes(), MediaWiki\Storage\RevisionStore\newNullRevision(), and MediaWiki\Storage\RevisionStore\userWasLastToEdit().
MediaWiki\Storage\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 1877 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\checkDatabaseWikiId(), and Wikimedia\Rdbms\IDatabase\selectRow().
Referenced by MediaWiki\Storage\RevisionStore\countRevisionsByTitle().
MediaWiki\Storage\RevisionStore::countRevisionsByTitle | ( | IDatabase | $db, |
$title ) |
Get count of revisions per page...not very efficient.
MCR migration note: this replaces Revision::countByTitle
IDatabase | $db | |
Title | $title |
Definition at line 1900 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\countRevisionsByPageId().
|
private |
Constructs a RevisionRecord for the revisions main slot, based on the MW1.29 schema.
object | array | $row | Either a database row or an array |
int | $queryFlags | for callbacks |
Title | $title |
MWException |
Definition at line 747 of file RevisionStore.php.
References $handler, MediaWiki\Storage\RevisionStore\loadSlotContent(), and MediaWiki\Storage\RevisionStore\mapArchiveFields().
Referenced by MediaWiki\Storage\RevisionStore\newMutableRevisionFromArray(), MediaWiki\Storage\RevisionStore\newNullRevision(), MediaWiki\Storage\RevisionStore\newRevisionFromArchiveRow(), and MediaWiki\Storage\RevisionStore\newRevisionFromRow_1_29().
|
private |
mixed | $value | |
string | $name |
IncompleteRevisionException | if $value is empty |
Definition at line 306 of file RevisionStore.php.
References $value.
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
|
private |
mixed | $value | |
string | $name |
IncompleteRevisionException | if $value is null |
Definition at line 289 of file RevisionStore.php.
References $value.
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
|
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) |
Definition at line 1573 of file RevisionStore.php.
References $options, $revQuery, MediaWiki\Storage\RevisionStore\checkDatabaseWikiId(), MediaWiki\Storage\RevisionStore\getQueryInfo(), and Wikimedia\Rdbms\IDatabase\selectRow().
Referenced by MediaWiki\Storage\RevisionStore\getKnownCurrentRevision(), and MediaWiki\Storage\RevisionStore\loadRevisionFromConds().
MediaWiki\Storage\RevisionStore::getArchiveQueryInfo | ( | ) |
Return the tables, fields, and join conditions to be selected to create a new archived revision object.
MCR migration note: this replaces Revision::getArchiveQueryInfo
Definition at line 1691 of file RevisionStore.php.
References $ret.
MediaWiki\Storage\RevisionStore::getContentHandlerUseDB | ( | ) |
Definition at line 154 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\$contentHandlerUseDB.
|
private |
int | $mode | DB_MASTER or DB_REPLICA |
Definition at line 177 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\getDBLoadBalancer().
Referenced by MediaWiki\Storage\RevisionStore\getRecentChange(), MediaWiki\Storage\RevisionStore\getRevisionByPageId(), MediaWiki\Storage\RevisionStore\getRevisionByTimestamp(), MediaWiki\Storage\RevisionStore\getRevisionByTitle(), MediaWiki\Storage\RevisionStore\getRevisionSizes(), MediaWiki\Storage\RevisionStore\getTimestampFromId(), MediaWiki\Storage\RevisionStore\newRevisionFromArchiveRow(), MediaWiki\Storage\RevisionStore\newRevisionFromConds(), and MediaWiki\Storage\RevisionStore\newRevisionFromRow_1_29().
|
private |
int | $mode | DB_MASTER or DB_REPLICA |
Definition at line 195 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\getDBLoadBalancer().
Referenced by MediaWiki\Storage\RevisionStore\getKnownCurrentRevision(), and MediaWiki\Storage\RevisionStore\getTitle().
|
private |
Definition at line 168 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\$loadBalancer.
Referenced by MediaWiki\Storage\RevisionStore\getDBConnection(), MediaWiki\Storage\RevisionStore\getDBConnectionRef(), MediaWiki\Storage\RevisionStore\newRevisionFromConds(), and MediaWiki\Storage\RevisionStore\releaseDBConnection().
MediaWiki\Storage\RevisionStore::getKnownCurrentRevision | ( | Title | $title, |
$revId ) |
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
Title | $title | the associated page title |
int | $revId | current revision of this page. Defaults to $title->getLatestRevID(). |
Implements MediaWiki\Storage\RevisionLookup.
Definition at line 1968 of file RevisionStore.php.
References cache, DB_REPLICA, MediaWiki\Storage\RevisionStore\fetchRevisionRowFromConds(), function, MediaWiki\Storage\RevisionStore\getDBConnectionRef(), MediaWiki\Storage\RevisionStore\newRevisionFromRow(), and wfWarn().
MediaWiki\Storage\RevisionStore::getNextRevision | ( | RevisionRecord | $rev, |
Title | $title = null ) |
Get next revision for this title.
MCR migration note: this replaces Revision::getNext
RevisionRecord | $rev | |
Title | $title | if known (optional) |
Implements MediaWiki\Storage\RevisionLookup.
Definition at line 1799 of file RevisionStore.php.
References $rev, MediaWiki\Storage\RevisionRecord\getPageId(), MediaWiki\Storage\RevisionStore\getRevisionByTitle(), and MediaWiki\Storage\RevisionStore\getTitle().
MediaWiki\Storage\RevisionStore::getPreviousRevision | ( | RevisionRecord | $rev, |
Title | $title = null ) |
Get previous revision for this title.
MCR migration note: this replaces Revision::getPrevious
RevisionRecord | $rev | |
Title | $title | if known (optional) |
Implements MediaWiki\Storage\RevisionLookup.
Definition at line 1778 of file RevisionStore.php.
References $rev, MediaWiki\Storage\RevisionRecord\getPageId(), MediaWiki\Storage\RevisionStore\getRevisionByTitle(), and MediaWiki\Storage\RevisionStore\getTitle().
|
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 1821 of file RevisionStore.php.
References $rev, MediaWiki\Storage\RevisionStore\checkDatabaseWikiId(), and Wikimedia\Rdbms\IDatabase\selectField().
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
MediaWiki\Storage\RevisionStore::getQueryInfo | ( | $options = [] | ) |
Return the tables, fields, and join conditions to be selected to create a new revision object.
MCR migration note: this replaces Revision::getQueryInfo
array | $options | Any combination of the following strings
|
Definition at line 1609 of file RevisionStore.php.
References $options, and $ret.
Referenced by MediaWiki\Storage\RevisionStore\fetchRevisionRowFromConds(), and MediaWiki\Storage\RevisionStore\userWasLastToEdit().
MediaWiki\Storage\RevisionStore::getRcIdIfUnpatrolled | ( | RevisionRecord | $rev | ) |
MCR migration note: this replaces Revision::isUnpatrolled.
RevisionRecord | $rev |
Definition at line 637 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\getRecentChange(), and RecentChange\PRC_UNPATROLLED.
MediaWiki\Storage\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 659 of file RevisionStore.php.
References $dbr, $rev, DB_REPLICA, MediaWiki\Storage\RevisionStore\getDBConnection(), list, RecentChange\newFromConds(), MediaWiki\Storage\RevisionRecord\RAW, and MediaWiki\Storage\RevisionStore\releaseDBConnection().
Referenced by MediaWiki\Storage\RevisionStore\getRcIdIfUnpatrolled().
MediaWiki\Storage\RevisionStore::getRevisionById | ( | $id, | |
$flags = 0 ) |
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) |
Implements MediaWiki\Storage\RevisionLookup.
Definition at line 950 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\newRevisionFromConds().
MediaWiki\Storage\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\Storage\RevisionLookup.
Definition at line 1015 of file RevisionStore.php.
References $rev, DB_MASTER, DB_REPLICA, MediaWiki\Storage\RevisionStore\getDBConnection(), MediaWiki\Storage\RevisionStore\loadRevisionFromConds(), MediaWiki\Storage\RevisionStore\newRevisionFromConds(), and MediaWiki\Storage\RevisionStore\releaseDBConnection().
MediaWiki\Storage\RevisionStore::getRevisionByTimestamp | ( | $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
Title | $title | |
string | $timestamp |
Definition at line 1052 of file RevisionStore.php.
References DB_REPLICA, MediaWiki\Storage\RevisionStore\getDBConnection(), and MediaWiki\Storage\RevisionStore\newRevisionFromConds().
MediaWiki\Storage\RevisionStore::getRevisionByTitle | ( | LinkTarget | $linkTarget, |
$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 | $linkTarget | |
int | $revId | (optional) |
int | $flags | Bitfield (optional) |
Implements MediaWiki\Storage\RevisionLookup.
Definition at line 970 of file RevisionStore.php.
References $rev, DB_MASTER, DB_REPLICA, MediaWiki\Storage\RevisionStore\getDBConnection(), MediaWiki\Linker\LinkTarget\getDBkey(), MediaWiki\Linker\LinkTarget\getNamespace(), MediaWiki\Storage\RevisionStore\loadRevisionFromConds(), MediaWiki\Storage\RevisionStore\newRevisionFromConds(), and MediaWiki\Storage\RevisionStore\releaseDBConnection().
Referenced by MediaWiki\Storage\RevisionStore\getNextRevision(), and MediaWiki\Storage\RevisionStore\getPreviousRevision().
MediaWiki\Storage\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 1730 of file RevisionStore.php.
References DB_REPLICA, MediaWiki\Storage\RevisionStore\getDBConnection(), and MediaWiki\Storage\RevisionStore\listRevisionSizes().
MediaWiki\Storage\RevisionStore::getTimestampFromId | ( | $title, | |
$id, | |||
$flags = 0 ) |
Get rev_timestamp from rev_id, without loading the rest of the row.
MCR migration note: this replaces Revision::getTimestampFromId
Title | $title | |
int | $id | |
int | $flags |
Definition at line 1855 of file RevisionStore.php.
References DB_MASTER, DB_REPLICA, MediaWiki\Storage\RevisionStore\getDBConnection(), MediaWiki\Storage\RevisionStore\releaseDBConnection(), and wfTimestamp().
MediaWiki\Storage\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 214 of file RevisionStore.php.
References $dbr, $title, DB_MASTER, false, MediaWiki\Storage\RevisionStore\getDBConnectionRef(), MediaWiki\Storage\RevisionStore\getTitle(), list, and wfBacktrace().
Referenced by MediaWiki\Storage\RevisionStore\getNextRevision(), MediaWiki\Storage\RevisionStore\getPreviousRevision(), MediaWiki\Storage\RevisionStore\getTitle(), MediaWiki\Storage\RevisionStore\newMutableRevisionFromArray(), and MediaWiki\Storage\RevisionStore\newRevisionFromRow_1_29().
|
private |
MutableRevisionRecord | $record | |
array | $fields |
Definition at line 1288 of file RevisionStore.php.
References User\newFromAnyId(), and wfTimestampNow().
Referenced by MediaWiki\Storage\RevisionStore\newMutableRevisionFromArray(), and MediaWiki\Storage\RevisionStore\newNullRevision().
MediaWiki\Storage\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) |
InvalidArgumentException |
Definition at line 328 of file RevisionStore.php.
References $rev, MediaWiki\Storage\RevisionStore\checkContentModel(), MediaWiki\Storage\RevisionStore\checkDatabaseWikiId(), MediaWiki\Storage\BlobStore\DESIGNATION_HINT, MediaWiki\Storage\RevisionStore\failOnEmpty(), MediaWiki\Storage\RevisionStore\failOnNull(), MediaWiki\Storage\BlobStore\FORMAT_HINT, MediaWiki\Storage\RevisionRecord\getComment(), MediaWiki\Storage\RevisionRecord\getPageId(), MediaWiki\Storage\RevisionStore\getPreviousRevisionId(), MediaWiki\Storage\RevisionRecord\getSha1(), MediaWiki\Storage\RevisionRecord\getSize(), MediaWiki\Storage\RevisionRecord\getTimestamp(), MediaWiki\Storage\RevisionRecord\getUser(), Wikimedia\Rdbms\IDatabase\insert(), Wikimedia\Rdbms\IDatabase\insertId(), list, MediaWiki\Storage\BlobStore\MODEL_HINT, MediaWiki\Storage\SlotRecord\newSaved(), MediaWiki\Storage\BlobStore\PAGE_HINT, MediaWiki\Storage\BlobStore\PARENT_HINT, MediaWiki\Storage\RevisionRecord\RAW, MediaWiki\Storage\BlobStore\ROLE_HINT, MediaWiki\Storage\BlobStore\SHA1_HINT, and Wikimedia\Rdbms\IDatabase\timestamp().
MediaWiki\Storage\RevisionStore::isReadOnly | ( | ) |
Definition at line 147 of file RevisionStore.php.
MediaWiki\Storage\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 1746 of file RevisionStore.php.
References $res, MediaWiki\Storage\RevisionStore\checkDatabaseWikiId(), and Wikimedia\Rdbms\IDatabase\select().
Referenced by MediaWiki\Storage\RevisionStore\getRevisionSizes().
|
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) |
Title | $title |
Definition at line 1510 of file RevisionStore.php.
References $rev, MediaWiki\Storage\RevisionStore\fetchRevisionRowFromConds(), and MediaWiki\Storage\RevisionStore\newRevisionFromRow().
Referenced by MediaWiki\Storage\RevisionStore\getRevisionByPageId(), MediaWiki\Storage\RevisionStore\getRevisionByTitle(), MediaWiki\Storage\RevisionStore\loadRevisionFromId(), MediaWiki\Storage\RevisionStore\loadRevisionFromPageId(), MediaWiki\Storage\RevisionStore\loadRevisionFromTimestamp(), MediaWiki\Storage\RevisionStore\loadRevisionFromTitle(), and MediaWiki\Storage\RevisionStore\newRevisionFromConds().
MediaWiki\Storage\RevisionStore::loadRevisionFromId | ( | IDatabase | $db, |
$id ) |
Load a page revision from a given revision ID number.
Returns null if no such revision can be found.
MCR migration note: this corresponds to Revision::loadFromId
IDatabase | $db | |
int | $id |
Definition at line 1368 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\loadRevisionFromConds().
MediaWiki\Storage\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 1387 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\loadRevisionFromConds().
MediaWiki\Storage\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 1447 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\loadRevisionFromConds(), and Wikimedia\Rdbms\IDatabase\timestamp().
MediaWiki\Storage\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 1413 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\loadRevisionFromConds().
|
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 893 of file RevisionStore.php.
References $e, $handler, MediaWiki\Storage\SlotRecord\getAddress(), MediaWiki\Storage\SlotRecord\getModel(), and MediaWiki\Storage\SlotRecord\hasAddress().
Referenced by MediaWiki\Storage\RevisionStore\emulateMainSlot_1_29().
|
staticprivate |
Maps fields of the archive row to corresponding revision rows.
object | $archiveRow |
Definition at line 697 of file RevisionStore.php.
Referenced by MediaWiki\Storage\RevisionStore\emulateMainSlot_1_29().
MediaWiki\Storage\RevisionStore::newMutableRevisionFromArray | ( | array | $fields, |
$queryFlags = 0, | |||
Title | $title = 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 | |
Title | null | $title |
MWException | |
RevisionAccessException |
Implements MediaWiki\Storage\RevisionFactory.
Definition at line 1217 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\emulateMainSlot_1_29(), MediaWiki\Storage\RevisionStore\getTitle(), and MediaWiki\Storage\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Storage\RevisionStore::newNullRevision | ( | IDatabase | $dbw, |
Title | $title, | ||
CommentStoreComment | $comment, | ||
$minor, | |||
User | $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 | |
Title | $title | Title of the page to read from |
CommentStoreComment | $comment | RevisionRecord's summary |
bool | $minor | Whether the revision should be considered as minor |
User | $user | The user to attribute the revision to |
Definition at line 567 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\checkDatabaseWikiId(), MediaWiki\Storage\RevisionStore\emulateMainSlot_1_29(), MediaWiki\Storage\RevisionStore\initializeMutableRevisionFromArray(), and Wikimedia\Rdbms\IDatabase\selectRow().
MediaWiki\Storage\RevisionStore::newRevisionFromArchiveRow | ( | $row, | |
$queryFlags = 0, | |||
Title | $title = 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
object | $row | |
int | $queryFlags | |
Title | null | $title | |
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\Storage\RevisionFactory.
Definition at line 1082 of file RevisionStore.php.
References $value, DB_REPLICA, MediaWiki\Storage\RevisionStore\emulateMainSlot_1_29(), MediaWiki\Storage\RevisionStore\getDBConnection(), User\newFromAnyId(), and wfWarn().
|
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) |
Title | $title |
Definition at line 1474 of file RevisionStore.php.
References $rev, DB_MASTER, DB_REPLICA, MediaWiki\Storage\RevisionStore\getDBConnection(), MediaWiki\Storage\RevisionStore\getDBLoadBalancer(), MediaWiki\Storage\RevisionStore\loadRevisionFromConds(), and MediaWiki\Storage\RevisionStore\releaseDBConnection().
Referenced by MediaWiki\Storage\RevisionStore\getRevisionById(), MediaWiki\Storage\RevisionStore\getRevisionByPageId(), MediaWiki\Storage\RevisionStore\getRevisionByTimestamp(), and MediaWiki\Storage\RevisionStore\getRevisionByTitle().
MediaWiki\Storage\RevisionStore::newRevisionFromRow | ( | $row, | |
$queryFlags = 0, | |||
Title | $title = null ) |
MCR migration note: this replaces Revision::newFromRow
object | $row | |
int | $queryFlags | |
Title | null | $title |
Implements MediaWiki\Storage\RevisionFactory.
Definition at line 1199 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\newRevisionFromRow_1_29().
Referenced by MediaWiki\Storage\RevisionStore\getKnownCurrentRevision(), and MediaWiki\Storage\RevisionStore\loadRevisionFromConds().
|
private |
MCR migration note: this replaces Revision::newFromRow
object | $row | |
int | $queryFlags | |
Title | null | $title |
MWException | |
RevisionAccessException |
Definition at line 1150 of file RevisionStore.php.
References DB_REPLICA, MediaWiki\Storage\RevisionStore\emulateMainSlot_1_29(), MediaWiki\Storage\RevisionStore\getDBConnection(), MediaWiki\Storage\RevisionStore\getTitle(), User\newFromAnyId(), and wfWarn().
Referenced by MediaWiki\Storage\RevisionStore\newRevisionFromRow().
|
private |
IDatabase | $connection |
Definition at line 185 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\getDBLoadBalancer().
Referenced by MediaWiki\Storage\RevisionStore\getRecentChange(), MediaWiki\Storage\RevisionStore\getRevisionByPageId(), MediaWiki\Storage\RevisionStore\getRevisionByTitle(), MediaWiki\Storage\RevisionStore\getTimestampFromId(), and MediaWiki\Storage\RevisionStore\newRevisionFromConds().
MediaWiki\Storage\RevisionStore::setContentHandlerUseDB | ( | $contentHandlerUseDB | ) |
bool | $contentHandlerUseDB |
Definition at line 161 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\$contentHandlerUseDB.
MediaWiki\Storage\RevisionStore::setLogger | ( | LoggerInterface | $logger | ) |
Definition at line 140 of file RevisionStore.php.
References MediaWiki\Storage\RevisionStore\$logger.
MediaWiki\Storage\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 1926 of file RevisionStore.php.
References $res, $revQuery, Wikimedia\Rdbms\IDatabase\addQuotes(), MediaWiki\Storage\RevisionStore\checkDatabaseWikiId(), MediaWiki\Storage\RevisionStore\getQueryInfo(), Wikimedia\Rdbms\IDatabase\select(), and Wikimedia\Rdbms\IDatabase\timestamp().
|
private |
Definition at line 104 of file RevisionStore.php.
Referenced by MediaWiki\Storage\RevisionStore\__construct().
|
private |
Definition at line 74 of file RevisionStore.php.
Referenced by MediaWiki\Storage\RevisionStore\__construct().
|
private |
Definition at line 94 of file RevisionStore.php.
Referenced by MediaWiki\Storage\RevisionStore\__construct().
|
private |
Definition at line 99 of file RevisionStore.php.
Referenced by MediaWiki\Storage\RevisionStore\__construct().
|
private |
Definition at line 84 of file RevisionStore.php.
Referenced by MediaWiki\Storage\RevisionStore\getContentHandlerUseDB(), and MediaWiki\Storage\RevisionStore\setContentHandlerUseDB().
|
private |
Definition at line 89 of file RevisionStore.php.
Referenced by MediaWiki\Storage\RevisionStore\__construct(), and MediaWiki\Storage\RevisionStore\getDBLoadBalancer().
|
private |
Definition at line 109 of file RevisionStore.php.
Referenced by MediaWiki\Storage\RevisionStore\setLogger().
|
private |
Definition at line 79 of file RevisionStore.php.
Referenced by MediaWiki\Storage\RevisionStore\__construct(), and MediaWiki\Storage\RevisionStore\checkDatabaseWikiId().