MediaWiki REL1_33
|
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, $mcrMigrationStage, 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 RevisionArchiveRecord 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 the revision after $rev in the page's history, if any. | |
getPreviousRevision (RevisionRecord $rev, Title $title=null) | |
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) | |
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. | |
getSlotsQueryInfo ( $options=[]) | |
Return the tables, fields, and join conditions to be selected to create a new SlotRecord. | |
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, $fromCache=false) | |
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. | |
Public Member Functions inherited from MediaWiki\Revision\RevisionFactory | |
newRevisionFromRow ( $row, $queryFlags=0, Title $title=null) | |
Constructs a RevisionRecord given a database row and content slots. | |
Public Attributes | |
const | ROW_CACHE_KEY = 'revision-row-1.29' |
Public Attributes inherited from IDBAccessObject | |
const | READ_LOCKING = self::READ_LATEST | 2 |
Constants for object loading bitfield flags (higher => higher QoS) | |
const | READ_NONE = -1 |
Private Member Functions | |
assertCrossWikiContentLoadingIsSafe () | |
Throws a RevisionAccessException if this RevisionStore is configured for cross-wiki loading and still reading from the old DB schema. | |
checkContent (Content $content, Title $title, $role) | |
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. | |
emulateContentId ( $textId) | |
Provides a content ID to use with emulated SlotRecords in SCHEMA_COMPAT_OLD mode, based on the revision's text ID (rev_text_id or ar_text_id, respectively). | |
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. | |
findSlotContentId (IDatabase $db, $revId, $role) | |
Finds the ID of a content row for a given revision and slot role. | |
getBaseRevisionRow (IDatabase $dbw, RevisionRecord $rev, Title $title, $parentId) | |
getDBConnection ( $mode) | |
getDBConnectionRef ( $mode) | |
getDBConnectionRefForQueryFlags ( $queryFlags) | |
getDBLoadBalancer () | |
getPreviousRevisionId (IDatabase $db, RevisionRecord $rev) | |
Get previous revision Id for this page_id This is used to populate rev_parent_id on save. | |
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. | |
hasMcrSchemaFlags ( $flags) | |
initializeMutableRevisionFromArray (MutableRevisionRecord $record, array $fields) | |
insertContentRowOn (SlotRecord $slot, IDatabase $dbw, $blobAddress) | |
insertIpChangesRow (IDatabase $dbw, User $user, RevisionRecord $rev, $revisionId) | |
Insert IP revision into ip_changes for use when querying for a range. | |
insertRevisionInternal (RevisionRecord $rev, IDatabase $dbw, User $user, CommentStoreComment $comment, Title $title, $pageId, $parentId) | |
insertRevisionRowOn (IDatabase $dbw, RevisionRecord $rev, Title $title, $parentId) | |
insertSlotOn (IDatabase $dbw, $revisionId, SlotRecord $protoSlot, Title $title, array $blobHints=[]) | |
insertSlotRowOn (SlotRecord $slot, IDatabase $dbw, $revisionId, $contentId) | |
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. | |
loadSlotRecords ( $revId, $queryFlags) | |
newRevisionFromConds ( $conditions, $flags=0, Title $title=null) | |
Given a set of conditions, fetch a revision. | |
newRevisionSlots ( $revId, $revisionRow, $queryFlags, Title $title) | |
Factory method for RevisionSlots. | |
releaseDBConnection (IDatabase $connection) | |
storeContentBlob (SlotRecord $slot, Title $title, array $blobHints=[]) | |
updateRevisionTextId (IDatabase $dbw, $revisionId, &$blobAddress) | |
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 |
NameTableStore | $contentModelStore |
ILoadBalancer | $loadBalancer |
LoggerInterface | $logger |
int | $mcrMigrationStage |
An appropriate combination of SCHEMA_COMPAT_XXX flags. | |
SlotRoleRegistry | $slotRoleRegistry |
NameTableStore | $slotRoleStore |
bool string | $wikiId |
Service for looking up page revisions.
Definition at line 76 of file RevisionStore.php.
MediaWiki\Revision\RevisionStore::__construct | ( | ILoadBalancer | $loadBalancer, |
SqlBlobStore | $blobStore, | ||
WANObjectCache | $cache, | ||
CommentStore | $commentStore, | ||
NameTableStore | $contentModelStore, | ||
NameTableStore | $slotRoleStore, | ||
SlotRoleRegistry | $slotRoleRegistry, | ||
$mcrMigrationStage, | |||
ActorMigration | $actorMigration, | ||
$wikiId = false ) |
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 | |
int | $mcrMigrationStage | An appropriate combination of SCHEMA_COMPAT_XXX flags |
ActorMigration | $actorMigration | |
bool | string | $wikiId |
Definition at line 158 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$actorMigration, MediaWiki\Revision\RevisionStore\$blobStore, MediaWiki\Revision\RevisionStore\$cache, MediaWiki\Revision\RevisionStore\$commentStore, MediaWiki\Revision\RevisionStore\$contentModelStore, MediaWiki\Revision\RevisionStore\$loadBalancer, MediaWiki\Revision\RevisionStore\$mcrMigrationStage, MediaWiki\Revision\RevisionStore\$slotRoleRegistry, MediaWiki\Revision\RevisionStore\$slotRoleStore, MediaWiki\Revision\RevisionStore\$wikiId, cache, SCHEMA_COMPAT_READ_BOTH, SCHEMA_COMPAT_READ_NEW, SCHEMA_COMPAT_READ_OLD, SCHEMA_COMPAT_WRITE_BOTH, SCHEMA_COMPAT_WRITE_NEW, and SCHEMA_COMPAT_WRITE_OLD.
|
private |
Throws a RevisionAccessException if this RevisionStore is configured for cross-wiki loading and still reading from the old DB schema.
RevisionAccessException |
Definition at line 228 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), and SCHEMA_COMPAT_READ_OLD.
Referenced by MediaWiki\Revision\RevisionStore\checkContent(), MediaWiki\Revision\RevisionStore\emulateMainSlot_1_29(), and MediaWiki\Revision\RevisionStore\getBaseRevisionRow().
MCR migration note: this corresponds to Revision::checkContentModel.
MWException | |
MWUnknownContentModelException |
Definition at line 995 of file RevisionStore.php.
References $content, $handler, and MediaWiki\Revision\RevisionStore\assertCrossWikiContentLoadingIsSafe().
Referenced by MediaWiki\Revision\RevisionStore\storeContentBlob().
|
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 2171 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$wikiId, and(), Wikimedia\Rdbms\IDatabase\getDomainID(), and wfWikiID().
Referenced by MediaWiki\Revision\RevisionStore\countRevisionsByPageId(), MediaWiki\Revision\RevisionStore\fetchRevisionRowFromConds(), MediaWiki\Revision\RevisionStore\getPreviousRevisionId(), MediaWiki\Revision\RevisionStore\insertRevisionOn(), MediaWiki\Revision\RevisionStore\listRevisionSizes(), MediaWiki\Revision\RevisionStore\newNullRevision(), and MediaWiki\Revision\RevisionStore\userWasLastToEdit().
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 2689 of file RevisionStore.php.
References and(), MediaWiki\Revision\RevisionStore\checkDatabaseWikiId(), and Wikimedia\Rdbms\IDatabase\selectRow().
Referenced by MediaWiki\Revision\RevisionStore\countRevisionsByTitle().
MediaWiki\Revision\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 2712 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\countRevisionsByPageId().
|
private |
Provides a content ID to use with emulated SlotRecords in SCHEMA_COMPAT_OLD mode, based on the revision's text ID (rev_text_id or ar_text_id, respectively).
Note that in SCHEMA_COMPAT_WRITE_BOTH, a callback to findSlotContentId() should be used instead, since in that mode, some revision rows may already have a real content ID, while other's don't - and for the ones that don't, we should indicate that it is missing and cause SlotRecords::hasContentId() to return false.
int | $textId |
Definition at line 1407 of file RevisionStore.php.
References and().
Referenced by MediaWiki\Revision\RevisionStore\emulateMainSlot_1_29(), and MediaWiki\Revision\RevisionStore\insertSlotOn().
|
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 1239 of file RevisionStore.php.
References $content, $handler, and(), MediaWiki\Revision\RevisionStore\assertCrossWikiContentLoadingIsSafe(), MediaWiki\Revision\RevisionStore\emulateContentId(), MediaWiki\Revision\RevisionStore\findSlotContentId(), MediaWiki\Revision\RevisionStore\getDBConnectionRefForQueryFlags(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), MediaWiki\Revision\RevisionStore\loadSlotContent(), MediaWiki\Revision\SlotRecord\MAIN, MediaWiki\Revision\RevisionStore\mapArchiveFields(), SCHEMA_COMPAT_READ_NEW, and SCHEMA_COMPAT_WRITE_NEW.
Referenced by MediaWiki\Revision\RevisionStore\newMutableRevisionFromArray(), and MediaWiki\Revision\RevisionStore\newRevisionSlots().
|
private |
mixed | $value | |
string | $name |
IncompleteRevisionException | if $value is empty |
Definition at line 423 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\insertRevisionOn().
|
private |
mixed | $value | |
string | $name |
IncompleteRevisionException | if $value is null |
Definition at line 406 of file RevisionStore.php.
Referenced by MediaWiki\Revision\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 2211 of file RevisionStore.php.
References $options, $revQuery, MediaWiki\Revision\RevisionStore\checkDatabaseWikiId(), MediaWiki\Revision\RevisionStore\getQueryInfo(), and Wikimedia\Rdbms\IDatabase\selectRow().
Referenced by MediaWiki\Revision\RevisionStore\getKnownCurrentRevision(), MediaWiki\Revision\RevisionStore\loadRevisionFromConds(), and MediaWiki\Revision\RevisionStore\newRevisionFromRow().
|
private |
Finds the ID of a content row for a given revision and slot role.
This can be used to re-use content rows even while the content ID is still missing from SlotRecords, when writing to both the old and the new schema during MCR schema migration.
IDatabase | $db | |
int | $revId | |
string | $role |
Definition at line 2243 of file RevisionStore.php.
References and(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), SCHEMA_COMPAT_WRITE_NEW, and Wikimedia\Rdbms\IDatabase\selectField().
Referenced by MediaWiki\Revision\RevisionStore\emulateMainSlot_1_29().
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
Definition at line 2470 of file RevisionStore.php.
References $ret, MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), and SCHEMA_COMPAT_READ_OLD.
|
private |
IDatabase | $dbw | |
RevisionRecord | $rev | |
Title | $title | |
int | $parentId |
MWException | |
MWUnknownContentModelException |
Definition at line 871 of file RevisionStore.php.
References $rev, and(), MediaWiki\Revision\RevisionStore\assertCrossWikiContentLoadingIsSafe(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), MediaWiki\Revision\SlotRecord\MAIN, SCHEMA_COMPAT_WRITE_OLD, and Wikimedia\Rdbms\IDatabase\timestamp().
Referenced by MediaWiki\Revision\RevisionStore\insertRevisionRowOn().
MediaWiki\Revision\RevisionStore::getContentHandlerUseDB | ( | ) |
Definition at line 250 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$contentHandlerUseDB.
|
private |
int | $mode | DB_MASTER or DB_REPLICA |
Definition at line 284 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\getDBLoadBalancer().
Referenced by MediaWiki\Revision\RevisionStore\getRecentChange(), MediaWiki\Revision\RevisionStore\getRevisionByTimestamp(), MediaWiki\Revision\RevisionStore\getRevisionSizes(), and MediaWiki\Revision\RevisionStore\newRevisionFromConds().
|
private |
int | $mode | DB_MASTER or DB_REPLICA |
Definition at line 312 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\getDBLoadBalancer().
Referenced by MediaWiki\Revision\RevisionStore\getDBConnectionRefForQueryFlags(), MediaWiki\Revision\RevisionStore\getKnownCurrentRevision(), MediaWiki\Revision\RevisionStore\getSlotsQueryInfo(), MediaWiki\Revision\RevisionStore\getTitle(), and MediaWiki\Revision\RevisionStore\loadSlotRecords().
|
private |
int | $queryFlags | a bit field composed of READ_XXX flags |
Definition at line 294 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\getDBConnectionRef(), DBAccessObjectUtils\getDBOptions(), and list.
Referenced by MediaWiki\Revision\RevisionStore\emulateMainSlot_1_29(), MediaWiki\Revision\RevisionStore\getRevisionByPageId(), MediaWiki\Revision\RevisionStore\getRevisionByTitle(), MediaWiki\Revision\RevisionStore\getTimestampFromId(), MediaWiki\Revision\RevisionStore\newRevisionFromArchiveRow(), MediaWiki\Revision\RevisionStore\newRevisionFromConds(), and MediaWiki\Revision\RevisionStore\newRevisionFromRow().
|
private |
Definition at line 275 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$loadBalancer.
Referenced by MediaWiki\Revision\RevisionStore\getDBConnection(), MediaWiki\Revision\RevisionStore\getDBConnectionRef(), MediaWiki\Revision\RevisionStore\newRevisionFromConds(), and MediaWiki\Revision\RevisionStore\releaseDBConnection().
MediaWiki\Revision\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\Revision\RevisionLookup.
Definition at line 2780 of file RevisionStore.php.
References and(), array(), cache, DB_REPLICA, MediaWiki\Revision\RevisionStore\fetchRevisionRowFromConds(), MediaWiki\Revision\RevisionStore\getDBConnectionRef(), MediaWiki\Revision\RevisionStore\getRevisionRowCacheKey(), MediaWiki\Revision\RevisionStore\newRevisionFromRow(), and wfWarn().
MediaWiki\Revision\RevisionStore::getNextRevision | ( | RevisionRecord | $rev, |
Title | $title = null ) |
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 | |
Title | null | $title | if known (optional) |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 2601 of file RevisionStore.php.
References $rev, MediaWiki\Revision\RevisionRecord\getPageId(), MediaWiki\Revision\RevisionStore\getRevisionByTitle(), and MediaWiki\Revision\RevisionStore\getTitle().
MediaWiki\Revision\RevisionStore::getPreviousRevision | ( | RevisionRecord | $rev, |
Title | $title = null ) |
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 | |
Title | null | $title | if known (optional) |
Implements MediaWiki\Revision\RevisionLookup.
Definition at line 2564 of file RevisionStore.php.
References $rev, MediaWiki\Revision\RevisionRecord\getPageId(), MediaWiki\Revision\RevisionStore\getRevisionByTitle(), and MediaWiki\Revision\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 2636 of file RevisionStore.php.
References $rev, and(), MediaWiki\Revision\RevisionStore\checkDatabaseWikiId(), and Wikimedia\Rdbms\IDatabase\selectField().
Referenced by MediaWiki\Revision\RevisionStore\insertRevisionOn().
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
|
Definition at line 2288 of file RevisionStore.php.
References $options, $ret, and(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), SCHEMA_COMPAT_READ_OLD, and SCHEMA_COMPAT_WRITE_OLD.
Referenced by MediaWiki\Revision\RevisionStore\fetchRevisionRowFromConds(), and MediaWiki\Revision\RevisionStore\userWasLastToEdit().
MediaWiki\Revision\RevisionStore::getRcIdIfUnpatrolled | ( | RevisionRecord | $rev | ) |
MCR migration note: this replaces Revision::isUnpatrolled.
RevisionRecord | $rev |
Definition at line 1130 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\getRecentChange(), and RecentChange\PRC_UNPATROLLED.
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 1152 of file RevisionStore.php.
References $rev, and(), MediaWiki\Revision\RevisionStore\getDBConnection(), DBAccessObjectUtils\getDBOptions(), list, RecentChange\newFromConds(), MediaWiki\Revision\RevisionRecord\RAW, and MediaWiki\Revision\RevisionStore\releaseDBConnection().
Referenced by MediaWiki\Revision\RevisionStore\getRcIdIfUnpatrolled().
MediaWiki\Revision\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\Revision\RevisionLookup.
Definition at line 1490 of file RevisionStore.php.
References and(), and MediaWiki\Revision\RevisionStore\newRevisionFromConds().
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 1556 of file RevisionStore.php.
References $rev, MediaWiki\Revision\RevisionStore\getDBConnectionRefForQueryFlags(), MediaWiki\Revision\RevisionStore\loadRevisionFromConds(), and MediaWiki\Revision\RevisionStore\newRevisionFromConds().
MediaWiki\Revision\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 1592 of file RevisionStore.php.
References DB_REPLICA, MediaWiki\Revision\RevisionStore\getDBConnection(), and MediaWiki\Revision\RevisionStore\newRevisionFromConds().
MediaWiki\Revision\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\Revision\RevisionLookup.
Definition at line 1510 of file RevisionStore.php.
References $rev, MediaWiki\Revision\RevisionStore\getDBConnectionRefForQueryFlags(), MediaWiki\Revision\RevisionStore\loadRevisionFromConds(), and MediaWiki\Revision\RevisionStore\newRevisionFromConds().
Referenced by MediaWiki\Revision\RevisionStore\getNextRevision(), and MediaWiki\Revision\RevisionStore\getPreviousRevision().
|
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 2840 of file RevisionStore.php.
References cache, and Wikimedia\Rdbms\IDatabase\getDomainID().
Referenced by MediaWiki\Revision\RevisionStore\getKnownCurrentRevision().
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 2512 of file RevisionStore.php.
References DB_REPLICA, MediaWiki\Revision\RevisionStore\getDBConnection(), and MediaWiki\Revision\RevisionStore\listRevisionSizes().
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
|
Definition at line 2388 of file RevisionStore.php.
References $options, $ret, and(), DB_REPLICA, MediaWiki\Revision\RevisionStore\getDBConnectionRef(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), MediaWiki\Revision\SlotRecord\MAIN, and SCHEMA_COMPAT_READ_OLD.
Referenced by MediaWiki\Revision\RevisionStore\loadSlotRecords().
MediaWiki\Revision\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 2670 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\getDBConnectionRefForQueryFlags(), and wfTimestamp().
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 331 of file RevisionStore.php.
References $dbr, $title, and(), DB_MASTER, false, MediaWiki\Revision\RevisionStore\getDBConnectionRef(), DBAccessObjectUtils\getDBOptions(), MediaWiki\Revision\RevisionStore\getTitle(), DBAccessObjectUtils\hasFlags(), list, and wfBacktrace().
Referenced by MediaWiki\Revision\RevisionStore\getNextRevision(), MediaWiki\Revision\RevisionStore\getPreviousRevision(), MediaWiki\Revision\RevisionStore\getTitle(), MediaWiki\Revision\RevisionStore\newMutableRevisionFromArray(), and MediaWiki\Revision\RevisionStore\newRevisionFromRow().
|
private |
int | $flags | A combination of SCHEMA_COMPAT_XXX flags. |
Definition at line 218 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\assertCrossWikiContentLoadingIsSafe(), MediaWiki\Revision\RevisionStore\emulateMainSlot_1_29(), MediaWiki\Revision\RevisionStore\findSlotContentId(), MediaWiki\Revision\RevisionStore\getArchiveQueryInfo(), MediaWiki\Revision\RevisionStore\getBaseRevisionRow(), MediaWiki\Revision\RevisionStore\getQueryInfo(), MediaWiki\Revision\RevisionStore\getSlotsQueryInfo(), MediaWiki\Revision\RevisionStore\insertRevisionOn(), MediaWiki\Revision\RevisionStore\insertRevisionRowOn(), MediaWiki\Revision\RevisionStore\insertSlotOn(), MediaWiki\Revision\RevisionStore\newMutableRevisionFromArray(), MediaWiki\Revision\RevisionStore\newRevisionSlots(), and MediaWiki\Revision\RevisionStore\setContentHandlerUseDB().
|
private |
MutableRevisionRecord | $record | |
array | $fields |
Definition at line 1927 of file RevisionStore.php.
References and(), User\newFromAnyId(), and wfTimestampNow().
Referenced by MediaWiki\Revision\RevisionStore\newMutableRevisionFromArray().
|
private |
SlotRecord | $slot | |
IDatabase | $dbw | |
string | $blobAddress |
Definition at line 974 of file RevisionStore.php.
References and(), MediaWiki\Revision\SlotRecord\getModel(), MediaWiki\Revision\SlotRecord\getSha1(), MediaWiki\Revision\SlotRecord\getSize(), Wikimedia\Rdbms\IDatabase\insert(), and Wikimedia\Rdbms\IDatabase\insertId().
Referenced by MediaWiki\Revision\RevisionStore\insertSlotOn().
|
private |
Insert IP revision into ip_changes for use when querying for a range.
IDatabase | $dbw | |
User | $user | |
RevisionRecord | $rev | |
int | $revisionId |
Definition at line 727 of file RevisionStore.php.
References $rev, and(), Wikimedia\Rdbms\IDatabase\insert(), and Wikimedia\Rdbms\IDatabase\timestamp().
Referenced by MediaWiki\Revision\RevisionStore\insertRevisionInternal().
|
private |
Definition at line 561 of file RevisionStore.php.
References $rev, and(), MediaWiki\Revision\RevisionStore\insertIpChangesRow(), MediaWiki\Revision\RevisionStore\insertRevisionRowOn(), MediaWiki\Revision\RevisionStore\insertSlotOn(), MediaWiki\Revision\SlotRecord\MAIN, MediaWiki\Storage\BlobStore\PAGE_HINT, MediaWiki\Storage\BlobStore\PARENT_HINT, MediaWiki\Revision\RevisionRecord\RAW, MediaWiki\Storage\BlobStore\REVISION_HINT, SCHEMA_COMPAT_WRITE_OLD, and MediaWiki\Revision\RevisionStore\updateRevisionTextId().
Referenced by MediaWiki\Revision\RevisionStore\insertRevisionOn().
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) |
InvalidArgumentException |
Definition at line 445 of file RevisionStore.php.
References $fname, $rev, and(), MediaWiki\Revision\RevisionStore\checkDatabaseWikiId(), Wikimedia\Rdbms\IDatabase\doAtomicSection(), MediaWiki\Revision\RevisionStore\failOnEmpty(), MediaWiki\Revision\RevisionStore\failOnNull(), MediaWiki\Revision\RevisionRecord\getComment(), MediaWiki\Revision\RevisionRecord\getPageId(), MediaWiki\Revision\RevisionStore\getPreviousRevisionId(), MediaWiki\Revision\RevisionRecord\getSha1(), MediaWiki\Revision\RevisionRecord\getSize(), MediaWiki\Revision\RevisionRecord\getTimestamp(), MediaWiki\Revision\RevisionRecord\getUser(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), MediaWiki\Revision\RevisionStore\insertRevisionInternal(), MediaWiki\Revision\SlotRecord\MAIN, MediaWiki\Revision\RevisionRecord\RAW, SCHEMA_COMPAT_READ_NEW, and SCHEMA_COMPAT_WRITE_NEW.
|
private |
IDatabase | $dbw | |
RevisionRecord | $rev | |
Title | $title | |
int | $parentId |
MWException | |
MWUnknownContentModelException |
Definition at line 754 of file RevisionStore.php.
References $fname, $rev, and(), Wikimedia\Rdbms\IDatabase\delete(), MediaWiki\Revision\RevisionStore\getBaseRevisionRow(), Wikimedia\Rdbms\IDatabase\getType(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), Wikimedia\Rdbms\IDatabase\insert(), Wikimedia\Rdbms\IDatabase\insertId(), list, Wikimedia\Rdbms\IDatabase\lock(), Wikimedia\Rdbms\IDatabase\onTransactionResolution(), Wikimedia\Rdbms\IDatabase\query(), MediaWiki\Revision\RevisionRecord\RAW, SCHEMA_COMPAT_WRITE_NEW, Wikimedia\Rdbms\IDatabase\selectField(), Wikimedia\Rdbms\IDatabase\selectSQLText(), and Wikimedia\Rdbms\IDatabase\unlock().
Referenced by MediaWiki\Revision\RevisionStore\insertRevisionInternal().
|
private |
IDatabase | $dbw | |
int | $revisionId | |
SlotRecord | $protoSlot | |
Title | $title | |
array | $blobHints | See the BlobStore::XXX_HINT constants |
Definition at line 675 of file RevisionStore.php.
References and(), MediaWiki\Revision\RevisionStore\emulateContentId(), MediaWiki\Revision\SlotRecord\hasContentId(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), MediaWiki\Revision\RevisionStore\insertContentRowOn(), MediaWiki\Revision\RevisionStore\insertSlotRowOn(), MediaWiki\Revision\SlotRecord\MAIN, MediaWiki\Revision\SlotRecord\newSaved(), SCHEMA_COMPAT_WRITE_NEW, SCHEMA_COMPAT_WRITE_OLD, MediaWiki\Revision\RevisionStore\storeContentBlob(), and MediaWiki\Revision\RevisionStore\updateRevisionTextId().
Referenced by MediaWiki\Revision\RevisionStore\insertRevisionInternal().
|
private |
SlotRecord | $slot | |
IDatabase | $dbw | |
int | $revisionId | |
int | $contentId |
Definition at line 956 of file RevisionStore.php.
References and(), MediaWiki\Revision\SlotRecord\getOrigin(), MediaWiki\Revision\SlotRecord\getRole(), MediaWiki\Revision\SlotRecord\hasOrigin(), and Wikimedia\Rdbms\IDatabase\insert().
Referenced by MediaWiki\Revision\RevisionStore\insertSlotOn().
MediaWiki\Revision\RevisionStore::isReadOnly | ( | ) |
Definition at line 243 of file RevisionStore.php.
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 2528 of file RevisionStore.php.
References $res, and(), MediaWiki\Revision\RevisionStore\checkDatabaseWikiId(), and Wikimedia\Rdbms\IDatabase\select().
Referenced by MediaWiki\Revision\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 | null | $title |
Definition at line 2148 of file RevisionStore.php.
References $rev, MediaWiki\Revision\RevisionStore\fetchRevisionRowFromConds(), and MediaWiki\Revision\RevisionStore\newRevisionFromRow().
Referenced by MediaWiki\Revision\RevisionStore\getRevisionByPageId(), MediaWiki\Revision\RevisionStore\getRevisionByTitle(), MediaWiki\Revision\RevisionStore\loadRevisionFromId(), MediaWiki\Revision\RevisionStore\loadRevisionFromPageId(), MediaWiki\Revision\RevisionStore\loadRevisionFromTimestamp(), MediaWiki\Revision\RevisionStore\loadRevisionFromTitle(), MediaWiki\Revision\RevisionStore\newNullRevision(), and MediaWiki\Revision\RevisionStore\newRevisionFromConds().
MediaWiki\Revision\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 2007 of file RevisionStore.php.
References and(), and MediaWiki\Revision\RevisionStore\loadRevisionFromConds().
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 2026 of file RevisionStore.php.
References and(), and MediaWiki\Revision\RevisionStore\loadRevisionFromConds().
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 2086 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\loadRevisionFromConds(), and Wikimedia\Rdbms\IDatabase\timestamp().
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 2052 of file RevisionStore.php.
References and(), and MediaWiki\Revision\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 1433 of file RevisionStore.php.
References $content, $data, $e, $handler, and(), MediaWiki\Revision\SlotRecord\getAddress(), MediaWiki\Revision\SlotRecord\getModel(), and MediaWiki\Revision\SlotRecord\hasAddress().
Referenced by MediaWiki\Revision\RevisionStore\emulateMainSlot_1_29(), and MediaWiki\Revision\RevisionStore\loadSlotRecords().
|
private |
int | $revId | The revision to load slots for. |
int | $queryFlags |
Definition at line 1611 of file RevisionStore.php.
References $res, $revQuery, and(), MediaWiki\Revision\RevisionStore\getDBConnectionRef(), DBAccessObjectUtils\getDBOptions(), MediaWiki\Revision\RevisionStore\getSlotsQueryInfo(), list, MediaWiki\Revision\RevisionStore\loadSlotContent(), and MediaWiki\Revision\SlotRecord\MAIN.
Referenced by MediaWiki\Revision\RevisionStore\newRevisionSlots().
|
staticprivate |
Maps fields of the archive row to corresponding revision rows.
object | $archiveRow |
Definition at line 1189 of file RevisionStore.php.
References and().
Referenced by MediaWiki\Revision\RevisionStore\emulateMainSlot_1_29().
MediaWiki\Revision\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\Revision\RevisionFactory.
Definition at line 1842 of file RevisionStore.php.
References $content, and(), MediaWiki\Revision\RevisionStore\emulateMainSlot_1_29(), MediaWiki\Revision\RevisionStore\getTitle(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray(), and SCHEMA_COMPAT_READ_OLD.
MediaWiki\Revision\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 | used for obtaining the lock on the page table row |
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 1066 of file RevisionStore.php.
References and(), MediaWiki\Revision\RevisionStore\checkDatabaseWikiId(), MediaWiki\Revision\RevisionStore\loadRevisionFromConds(), MediaWiki\Revision\MutableRevisionRecord\newFromParentRevision(), Wikimedia\Rdbms\IDatabase\selectField(), and wfTimestampNow().
MediaWiki\Revision\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\Revision\RevisionFactory.
Definition at line 1704 of file RevisionStore.php.
References $value, and(), MediaWiki\Revision\RevisionStore\getDBConnectionRefForQueryFlags(), User\newFromAnyId(), MediaWiki\Revision\RevisionStore\newRevisionSlots(), 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 | null | $title |
Definition at line 2113 of file RevisionStore.php.
References $rev, DB_MASTER, MediaWiki\Revision\RevisionStore\getDBConnection(), MediaWiki\Revision\RevisionStore\getDBConnectionRefForQueryFlags(), MediaWiki\Revision\RevisionStore\getDBLoadBalancer(), MediaWiki\Revision\RevisionStore\loadRevisionFromConds(), and MediaWiki\Revision\RevisionStore\releaseDBConnection().
Referenced by MediaWiki\Revision\RevisionStore\getRevisionById(), MediaWiki\Revision\RevisionStore\getRevisionByPageId(), MediaWiki\Revision\RevisionStore\getRevisionByTimestamp(), and MediaWiki\Revision\RevisionStore\getRevisionByTitle().
MediaWiki\Revision\RevisionStore::newRevisionFromRow | ( | $row, | |
$queryFlags = 0, | |||
Title | $title = null, | ||
$fromCache = false ) |
MCR migration note: this replaces Revision::newFromRow
object | $row | |
int | $queryFlags | |
Title | null | $title | |
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 1770 of file RevisionStore.php.
References $rev, $title, $user, MediaWiki\Revision\RevisionStore\$wikiId, and(), MediaWiki\Revision\RevisionStore\fetchRevisionRowFromConds(), MediaWiki\Revision\RevisionStore\getDBConnectionRefForQueryFlags(), MediaWiki\Revision\RevisionStore\getTitle(), User\newFromAnyId(), MediaWiki\Revision\RevisionStore\newRevisionSlots(), and wfWarn().
Referenced by MediaWiki\Revision\RevisionStore\getKnownCurrentRevision(), and MediaWiki\Revision\RevisionStore\loadRevisionFromConds().
|
private |
Factory method for RevisionSlots.
int | $revId | |
object | $revisionRow | |
int | $queryFlags | |
Title | $title |
MWException |
Definition at line 1665 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\emulateMainSlot_1_29(), MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), MediaWiki\Revision\RevisionStore\loadSlotRecords(), MediaWiki\Revision\SlotRecord\MAIN, SCHEMA_COMPAT_READ_NEW, and use.
Referenced by MediaWiki\Revision\RevisionStore\newRevisionFromArchiveRow(), and MediaWiki\Revision\RevisionStore\newRevisionFromRow().
|
private |
IDatabase | $connection |
Definition at line 302 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\getDBLoadBalancer().
Referenced by MediaWiki\Revision\RevisionStore\getRecentChange(), and MediaWiki\Revision\RevisionStore\newRevisionFromConds().
MediaWiki\Revision\RevisionStore::setContentHandlerUseDB | ( | $contentHandlerUseDB | ) |
bool | $contentHandlerUseDB |
MWException |
Definition at line 259 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$contentHandlerUseDB, MediaWiki\Revision\RevisionStore\hasMcrSchemaFlags(), SCHEMA_COMPAT_READ_NEW, and SCHEMA_COMPAT_WRITE_NEW.
MediaWiki\Revision\RevisionStore::setLogger | ( | LoggerInterface | $logger | ) |
Definition at line 236 of file RevisionStore.php.
References MediaWiki\Revision\RevisionStore\$logger.
|
private |
SlotRecord | $slot | |
Title | $title | |
array | $blobHints | See the BlobStore::XXX_HINT constants |
MWException |
Definition at line 922 of file RevisionStore.php.
References $content, MediaWiki\Revision\RevisionStore\checkContent(), MediaWiki\Storage\BlobStore\DESIGNATION_HINT, MediaWiki\Storage\BlobStore\FORMAT_HINT, MediaWiki\Revision\SlotRecord\getContent(), MediaWiki\Revision\SlotRecord\getRole(), MediaWiki\Revision\SlotRecord\getSha1(), MediaWiki\Storage\BlobStore\MODEL_HINT, MediaWiki\Storage\BlobStore\ROLE_HINT, and MediaWiki\Storage\BlobStore\SHA1_HINT.
Referenced by MediaWiki\Revision\RevisionStore\insertSlotOn().
|
private |
IDatabase | $dbw | |
int | $revisionId | |
string | &$blobAddress | (may change!) |
Definition at line 645 of file RevisionStore.php.
References and(), and Wikimedia\Rdbms\IDatabase\update().
Referenced by MediaWiki\Revision\RevisionStore\insertRevisionInternal(), and MediaWiki\Revision\RevisionStore\insertSlotOn().
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 2738 of file RevisionStore.php.
References $res, $revQuery, Wikimedia\Rdbms\IDatabase\addQuotes(), MediaWiki\Revision\RevisionStore\checkDatabaseWikiId(), MediaWiki\Revision\RevisionStore\getQueryInfo(), Wikimedia\Rdbms\IDatabase\select(), and Wikimedia\Rdbms\IDatabase\timestamp().
|
private |
Definition at line 115 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 84 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 105 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 110 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 95 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\getContentHandlerUseDB(), and MediaWiki\Revision\RevisionStore\setContentHandlerUseDB().
|
private |
Definition at line 125 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 100 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct(), and MediaWiki\Revision\RevisionStore\getDBLoadBalancer().
|
private |
Definition at line 120 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\setLogger().
|
private |
An appropriate combination of SCHEMA_COMPAT_XXX flags.
Definition at line 133 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 136 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 130 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct().
|
private |
Definition at line 89 of file RevisionStore.php.
Referenced by MediaWiki\Revision\RevisionStore\__construct(), MediaWiki\Revision\RevisionStore\checkDatabaseWikiId(), and MediaWiki\Revision\RevisionStore\newRevisionFromRow().
const MediaWiki\Revision\RevisionStore::ROW_CACHE_KEY = 'revision-row-1.29' |
Definition at line 79 of file RevisionStore.php.