MediaWiki
1.34.0
|
Public Member Functions | |
__construct ( $row, $queryFlags=0, Title $title=null) | |
getComment ( $audience=self::FOR_PUBLIC, User $user=null) | |
getContent ( $audience=self::FOR_PUBLIC, User $user=null) | |
Fetch revision content if it's available to the specified audience. More... | |
getContentFormat () | |
Returns the content format for the main slot of this revision. More... | |
getContentHandler () | |
Returns the content handler appropriate for this revision's content model. More... | |
getContentModel () | |
Returns the content model for the main slot of this revision. More... | |
getId () | |
Get revision ID. More... | |
getNext () | |
Get next revision for this title. More... | |
getPage () | |
Get the page ID. More... | |
getParentId () | |
Get parent revision ID (the original previous page revision) More... | |
getPrevious () | |
Get previous revision for this title. More... | |
getRecentChange ( $flags=0) | |
Get the RC object belonging to the current revision, if there's one. More... | |
getRevisionRecord () | |
getSerializedData () | |
Get original serialized data (without checking view restrictions) More... | |
getSha1 () | |
Returns the base36 sha1 of the content in this revision, or null if unknown. More... | |
getSize () | |
Returns the length of the text in this revision, or null if unknown. More... | |
getTextId () | |
Get the ID of the row of the text table that contains the content of the revision's main slot, if that content is stored in the text table. More... | |
getTimestamp () | |
getTitle () | |
Returns the title of the page associated with this entry. More... | |
getUser ( $audience=self::FOR_PUBLIC, User $user=null) | |
Fetch revision's user id if it's available to the specified audience. More... | |
getUserText ( $audience=self::FOR_PUBLIC, User $user=null) | |
Fetch revision's username if it's available to the specified audience. More... | |
getVisibility () | |
Get the deletion bitfield of the revision. More... | |
insertOn ( $dbw) | |
Insert a new revision into the database, returning the new revision ID number on success and dies horribly on failure. More... | |
isCurrent () | |
isDeleted ( $field) | |
isMinor () | |
isUnpatrolled () | |
setId ( $id) | |
Set the revision ID. More... | |
setTitle ( $title) | |
Set the title of the revision. More... | |
setUserIdAndName ( $id, $name) | |
Set the user ID/name. More... | |
userCan ( $field, User $user=null) | |
Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted. More... | |
Static Public Member Functions | |
static | base36Sha1 ( $text) |
Get the base 36 SHA-1 value for a string of text. More... | |
static | compressRevisionText (&$text) |
If $wgCompressRevisions is enabled, we will compress data. More... | |
static | countByPageId ( $db, $id) |
Get count of revisions per page...not very efficient. More... | |
static | countByTitle ( $db, $title) |
Get count of revisions per page...not very efficient. More... | |
static | decompressRevisionText ( $text, $flags) |
Re-converts revision text according to it's flags. More... | |
static | getArchiveQueryInfo () |
Return the tables, fields, and join conditions to be selected to create a new archived revision object. More... | |
static | getParentLengths ( $db, array $revIds) |
Do a batched query to get the parent revision lengths. More... | |
static | getQueryInfo ( $options=[]) |
Return the tables, fields, and join conditions to be selected to create a new revision object. More... | |
static | getRevisionText ( $row, $prefix='old_', $wiki=false) |
Get revision text associated with an old or archive row. More... | |
static | getTimestampFromId ( $title, $id, $flags=0) |
Get rev_timestamp from rev_id, without loading the rest of the row. More... | |
static | loadFromId ( $db, $id) |
Load a page revision from a given revision ID number. More... | |
static | loadFromPageId ( $db, $pageid, $id=0) |
Load either the current, or a specified, revision that's attached to a given page. More... | |
static | loadFromTimestamp ( $db, $title, $timestamp) |
Load the revision for the given title with the given timestamp. More... | |
static | loadFromTitle ( $db, $title, $id=0) |
Load either the current, or a specified, revision that's attached to a given page. More... | |
static | newFromArchiveRow ( $row, $overrides=[]) |
Make a fake revision object from an archive table row. More... | |
static | newFromId ( $id, $flags=0) |
Load a page revision from a given revision ID number. More... | |
static | newFromPageId ( $pageId, $revId=0, $flags=0) |
Load either the current, or a specified, revision that's attached to a given page ID. More... | |
static | newFromRow ( $row) |
static | newFromTitle (LinkTarget $linkTarget, $id=0, $flags=0) |
Load either the current, or a specified, revision that's attached to a given link target. More... | |
static | newKnownCurrent (IDatabase $db, $pageIdOrTitle, $revId=0) |
Load a revision based on a known page ID and current revision ID from the DB. More... | |
static | newNullRevision ( $dbw, $pageId, $summary, $minor, $user=null) |
Create a new null-revision for insertion into a page's history. More... | |
static | userCanBitfield ( $bitfield, $field, User $user=null, Title $title=null) |
Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted. More... | |
static | userWasLastToEdit ( $db, $pageId, $userId, $since) |
Check if no edits were made by other users since the time a user started editing the page. More... | |
Public Attributes | |
const | DELETED_COMMENT = RevisionRecord::DELETED_COMMENT |
const | DELETED_RESTRICTED = RevisionRecord::DELETED_RESTRICTED |
const | DELETED_TEXT = RevisionRecord::DELETED_TEXT |
const | DELETED_USER = RevisionRecord::DELETED_USER |
const | FOR_PUBLIC = RevisionRecord::FOR_PUBLIC |
const | FOR_THIS_USER = RevisionRecord::FOR_THIS_USER |
const | RAW = RevisionRecord::RAW |
const | SUPPRESSED_ALL = RevisionRecord::SUPPRESSED_ALL |
const | SUPPRESSED_USER = RevisionRecord::SUPPRESSED_USER |
const | TEXT_CACHE_GROUP = SqlBlobStore::TEXT_CACHE_GROUP |
Public Attributes inherited from IDBAccessObject | |
const | READ_LOCKING = self::READ_LATEST | 2 |
Constants for object loading bitfield flags (higher => higher QoS) More... | |
const | READ_NONE = -1 |
Static Protected Member Functions | |
static | getBlobStore ( $wiki=false) |
static | getRevisionFactory () |
static | getRevisionLookup () |
static | getRevisionStore ( $wiki=false) |
Protected Attributes | |
RevisionRecord | $mRecord |
Private Member Functions | |
ensureTitle ( $row, $queryFlags, $title=null) | |
Make sure we have some Title object for use by the constructor. More... | |
getMainSlotRaw () | |
Definition at line 40 of file Revision.php.
Revision::__construct | ( | $row, | |
$queryFlags = 0 , |
|||
Title | $title = null |
||
) |
object | array | RevisionRecord | $row | Either a database row or an array |
int | $queryFlags | |
Title | null | $title |
Definition at line 353 of file Revision.php.
References $title, ensureTitle(), and getRevisionFactory().
|
static |
Get the base 36 SHA-1 value for a string of text.
string | $text |
Definition at line 981 of file Revision.php.
|
static |
If $wgCompressRevisions is enabled, we will compress data.
The input string is modified in place. Return value is the flags field: contains 'gzip' if the data is compressed, and 'utf-8' if we're saving in UTF-8 mode.
mixed | &$text | Reference to a text |
Definition at line 926 of file Revision.php.
References getBlobStore().
Referenced by MigrateArchiveText\doDBUpdates(), and CheckStorage\importRevision().
|
static |
Get count of revisions per page...not very efficient.
IDatabase | $db | |
int | $id | Page id |
Definition at line 1077 of file Revision.php.
References getRevisionStore().
|
static |
Get count of revisions per page...not very efficient.
IDatabase | $db | |
Title | $title |
Definition at line 1088 of file Revision.php.
References $title, and getRevisionStore().
|
static |
Re-converts revision text according to it's flags.
mixed | $text | Reference to a text |
array | $flags | Compression flags |
Definition at line 937 of file Revision.php.
References getBlobStore().
|
private |
Make sure we have some Title object for use by the constructor.
For B/C, the constructor shouldn't fail even for a bad page ID or bad revision ID.
array | object | $row | |
int | $queryFlags | |
Title | null | $title |
Definition at line 395 of file Revision.php.
References $title, getRevisionStore(), Title\makeTitleSafe(), NS_SPECIAL, and wfLogWarning().
Referenced by __construct().
|
static |
Return the tables, fields, and join conditions to be selected to create a new archived revision object.
$table
to IDatabase->select()
$vars
to IDatabase->select()
$join_conds
to IDatabase->select()
Definition at line 329 of file Revision.php.
References getRevisionStore().
Referenced by DifferenceEngine\deletedLink(), PopulateRevisionLength\doDBUpdates(), RevDelArchiveList\doQuery(), and RevDelRevisionList\doQuery().
|
staticprotected |
bool | string | $wiki | The ID of the target wiki database. Use false for the local wiki. |
Definition at line 91 of file Revision.php.
Referenced by compressRevisionText(), decompressRevisionText(), getRevisionText(), and getTextId().
Revision::getComment | ( | $audience = self::FOR_PUBLIC , |
|
User | $user = null |
||
) |
int | $audience | One of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to the given user Revision::RAW get the text regardless of permissions |
User | null | $user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 649 of file Revision.php.
Referenced by Linker\revComment().
Revision::getContent | ( | $audience = self::FOR_PUBLIC , |
|
User | $user = null |
||
) |
Fetch revision content if it's available to the specified audience.
If the specified audience does not have the ability to view this revision, or the content could not be loaded, null will be returned.
int | $audience | One of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to $user Revision::RAW get the text regardless of permissions |
User | null | $user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 719 of file Revision.php.
Referenced by Cleanup\cleanupArticle(), CategoryMembershipChangeJob\notifyUpdatesForRevision(), and BenchmarkParse\runParser().
Revision::getContentFormat | ( | ) |
Returns the content format for the main slot of this revision.
If no content format was stored in the database, the default format for this revision's content model is returned.
Definition at line 774 of file Revision.php.
References getContentHandler(), and getMainSlotRaw().
Revision::getContentHandler | ( | ) |
Returns the content handler appropriate for this revision's content model.
MWException |
Definition at line 791 of file Revision.php.
References getContentModel(), and ContentHandler\getForModelID().
Referenced by getContentFormat(), and WikiPage\getUndoContent().
Revision::getContentModel | ( | ) |
Returns the content model for the main slot of this revision.
If no content model was stored in the database, the default content model for the title is used to determine the content model to use. If no title is know, CONTENT_MODEL_WIKITEXT is used as a last resort.
Definition at line 759 of file Revision.php.
References getMainSlotRaw().
Referenced by getContentHandler().
Revision::getId | ( | ) |
Get revision ID.
Definition at line 442 of file Revision.php.
Referenced by CategoryMembershipChangeJob\getCategoriesAtRev(), DifferenceEngine\getParserOutput(), Linker\getRevDeleteLink(), DifferenceEngine\getRevisionHeader(), CategoryMembershipChange\notifyCategorization(), ChangesList\revDateLink(), and BenchmarkParse\runParser().
|
private |
Definition at line 492 of file Revision.php.
Referenced by getContentFormat(), getContentModel(), getSerializedData(), and getTextId().
Revision::getNext | ( | ) |
Get next revision for this title.
Definition at line 824 of file Revision.php.
References getRevisionLookup(), and getTitle().
Revision::getPage | ( | ) |
Revision::getParentId | ( | ) |
Get parent revision ID (the original previous page revision)
Definition at line 521 of file Revision.php.
Referenced by CategoryMembershipChangeJob\notifyUpdatesForRevision().
|
static |
Do a batched query to get the parent revision lengths.
IDatabase | $db | |
array | $revIds |
Definition at line 342 of file Revision.php.
References getRevisionStore().
Referenced by HistoryPager\doBatchLookups(), and ContribsPager\doBatchLookups().
Revision::getPrevious | ( | ) |
Get previous revision for this title.
Definition at line 814 of file Revision.php.
References getRevisionLookup(), and getTitle().
Referenced by Cleanup\cleanupArticle().
|
static |
Return the tables, fields, and join conditions to be selected to create a new revision object.
array | $options | Any combination of the following strings
|
$table
to IDatabase->select()
$vars
to IDatabase->select()
$join_conds
to IDatabase->select()
Definition at line 315 of file Revision.php.
References getRevisionStore().
Referenced by WikiPage\archiveRevisions(), WikiExporter\do_list_authors(), PopulateRevisionLength\doDBUpdates(), RevisionList\doQuery(), ChangeTagsRevisionList\doQuery(), RevDelRevisionList\doQuery(), HistoryAction\fetchRevisions(), Title\getAuthorsBetween(), ContentHandler\getAutoDeleteReason(), Title\getFirstRevision(), MergeHistoryPager\getQueryInfo(), HistoryPager\getQueryInfo(), ContribsPager\getQueryInfo(), Linker\getRollbackEditCount(), RebuildTextIndex\populateSearchIndex(), and CategoryMembershipChangeJob\run().
Revision::getRecentChange | ( | $flags = 0 | ) |
Get the RC object belonging to the current revision, if there's one.
int | $flags | (optional) $flags include: Revision::READ_LATEST : Select the data from the master |
Definition at line 683 of file Revision.php.
References getRevisionStore().
|
staticprotected |
Definition at line 82 of file Revision.php.
Referenced by __construct(), newFromArchiveRow(), and newFromRow().
|
staticprotected |
Definition at line 75 of file Revision.php.
Referenced by getNext(), getPrevious(), newFromId(), newFromPageId(), newFromTitle(), and newKnownCurrent().
Revision::getRevisionRecord | ( | ) |
Definition at line 433 of file Revision.php.
References $mRecord.
Referenced by WikiPage\doEditUpdates(), CategoryMembershipChangeJob\getCategoriesAtRev(), WikiPage\hasDifferencesOutsideMainSlot(), and MediaWiki\Storage\DerivedPageDataUpdater\prepareUpdate().
|
staticprotected |
Definition at line 63 of file Revision.php.
Referenced by countByPageId(), countByTitle(), ensureTitle(), getArchiveQueryInfo(), getParentLengths(), getQueryInfo(), getRecentChange(), getRevisionText(), getTimestampFromId(), insertOn(), isUnpatrolled(), loadFromId(), loadFromPageId(), loadFromTimestamp(), loadFromTitle(), newNullRevision(), and userWasLastToEdit().
|
static |
Get revision text associated with an old or archive row.
If the text field is not included, this uses RevisionStore to load the appropriate slot and return its serialized content. This is the default backwards-compatibility behavior when reading from the MCR aware database schema is enabled. For this to work, either the revision ID or the page ID must be included in the row.
When using the old text field, the flags field must also be set. Including the old_id field will activate cache usage as long as the $wiki parameter is not set.
stdClass | $row | The text data. If a falsy value is passed instead, false is returned. |
string | $prefix | Table prefix (default 'old_') |
string | bool | $wiki | The name of the wiki to load the revision text from (same as the wiki $row was loaded from) or false to indicate the local wiki (this is the default). Otherwise, it must be a symbolic wiki database identifier as understood by the LoadBalancer class. |
Definition at line 850 of file Revision.php.
References $content, $wgMultiContentRevisionSchemaMigrationStage, getBlobStore(), getRevisionStore(), SCHEMA_COMPAT_WRITE_OLD, wfDeprecated(), and wfLogWarning().
Revision::getSerializedData | ( | ) |
Get original serialized data (without checking view restrictions)
Definition at line 742 of file Revision.php.
References getMainSlotRaw().
Revision::getSha1 | ( | ) |
Returns the base36 sha1 of the content in this revision, or null if unknown.
Definition at line 543 of file Revision.php.
Revision::getSize | ( | ) |
Returns the length of the text in this revision, or null if unknown.
Definition at line 530 of file Revision.php.
Revision::getTextId | ( | ) |
Get the ID of the row of the text table that contains the content of the revision's main slot, if that content is stored in the text table.
If the content is stored elsewhere, this returns null.
Definition at line 508 of file Revision.php.
References getBlobStore(), and getMainSlotRaw().
Revision::getTimestamp | ( | ) |
Definition at line 798 of file Revision.php.
Referenced by CategoryMembershipChange\__construct(), CategoryMembershipChangeJob\getExplicitCategoriesChanges(), Linker\getRevDeleteLink(), DifferenceEngine\getRevisionHeader(), ChangesList\revDateLink(), and WikiPage\setLastEdit().
|
static |
Get rev_timestamp from rev_id, without loading the rest of the row.
Title | $title | (ignored since 1.34) |
int | $id | |
int | $flags |
Definition at line 1066 of file Revision.php.
References getRevisionStore().
Referenced by Skin\lastModified().
Revision::getTitle | ( | ) |
Returns the title of the page associated with this entry.
Since 1.31, this will never return null.
Will do a query, when title is not set and id is given.
Definition at line 559 of file Revision.php.
References Title\newFromLinkTarget().
Referenced by Cleanup\cleanupArticle(), getNext(), getPrevious(), DifferenceEngine\getRevisionHeader(), Linker\revComment(), ChangesList\revDateLink(), and BenchmarkParse\runParser().
Revision::getUser | ( | $audience = self::FOR_PUBLIC , |
|
User | $user = null |
||
) |
Fetch revision's user id if it's available to the specified audience.
If the specified audience does not have access to it, zero will be returned.
int | $audience | One of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to the given user Revision::RAW get the ID regardless of permissions |
User | null | $user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 603 of file Revision.php.
Referenced by RevDelRevisionItem\getApiData().
Revision::getUserText | ( | $audience = self::FOR_PUBLIC , |
|
User | $user = null |
||
) |
Fetch revision's username if it's available to the specified audience.
If the specified audience does not have access to the username, an empty string will be returned.
int | $audience | One of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to the given user Revision::RAW get the text regardless of permissions |
User | null | $user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 627 of file Revision.php.
Revision::getVisibility | ( | ) |
Get the deletion bitfield of the revision.
Definition at line 701 of file Revision.php.
Referenced by Linker\getRevDeleteLink(), CategoryMembershipChange\notifyCategorization(), and userCan().
Revision::insertOn | ( | $dbw | ) |
Insert a new revision into the database, returning the new revision ID number on success and dies horribly on failure.
IDatabase | $dbw | (master connection) |
MWException |
Definition at line 954 of file Revision.php.
References getRevisionStore().
Referenced by ImportableOldRevisionImporter\import(), MergeHistory\merge(), and MovePage\moveToInternal().
Revision::isCurrent | ( | ) |
Definition at line 805 of file Revision.php.
Referenced by CategoryMembershipChangeJob\getCategoriesAtRev(), and DifferenceEngine\getRevisionHeader().
Revision::isDeleted | ( | $field | ) |
int | $field | One of DELETED_* bitfield constants |
Definition at line 692 of file Revision.php.
Referenced by Linker\getRevDeleteLink(), DifferenceEngine\getRevisionHeader(), Linker\revComment(), and ChangesList\revDateLink().
Revision::isMinor | ( | ) |
Definition at line 663 of file Revision.php.
Revision::isUnpatrolled | ( | ) |
Definition at line 670 of file Revision.php.
References getRevisionStore().
|
static |
Load a page revision from a given revision ID number.
Returns null if no such revision can be found.
IDatabase | $db | |
int | $id |
Definition at line 243 of file Revision.php.
References getRevisionStore(), and wfDeprecated().
|
static |
Load either the current, or a specified, revision that's attached to a given page.
If not attached to that page, will return null.
IDatabase | $db | |
int | $pageid | |
int | $id |
Definition at line 261 of file Revision.php.
References getRevisionStore().
Referenced by Cleanup\execute(), and Maintenance\updateSearchIndexForPage().
|
static |
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.
IDatabase | $db | |
Title | $title | |
string | $timestamp |
Definition at line 296 of file Revision.php.
References $title, and getRevisionStore().
Referenced by AttachLatest\execute(), EditPage\getBaseRevision(), User\getNewMessageLinks(), and WikiPage\replaceSectionContent().
|
static |
Load either the current, or a specified, revision that's attached to a given page.
If not attached to that page, will return null.
IDatabase | $db | |
Title | $title | |
int | $id |
Definition at line 278 of file Revision.php.
References $title, and getRevisionStore().
Referenced by EditPage\mergeChangesIntoContent().
|
static |
Make a fake revision object from an archive table row.
This is queried for permissions or even inserted (as in Special:Undelete)
object | $row | |
array | $overrides |
MWException |
Definition at line 172 of file Revision.php.
References $title, getRevisionFactory(), and Title\makeTitle().
Referenced by DifferenceEngine\deletedLink(), SpecialUndelete\formatRevisionRow(), DeletedContribsPager\formatRow(), RevDelArchiveItem\initRevision(), and PopulateRevisionLength\upgradeRow().
|
static |
Load a page revision from a given revision ID number.
Returns null if no such revision can be found.
$flags include: Revision::READ_LATEST : Select the data from the master Revision::READ_LOCKING : Select & lock the data from the master
int | $id | |
int | $flags | (optional) |
Definition at line 119 of file Revision.php.
References getRevisionLookup().
Referenced by SpecialComparePages\checkExistingRevision(), Orphans\checkSeparation(), EditPage\edit(), ApiEditPage\execute(), CheckBadRedirects\execute(), ApiParse\execute(), ImportTextFiles\execute(), BenchmarkParse\execute(), SpecialNewpages\feedItemDesc(), Article\fetchRevisionRecord(), FeedUtils\formatDiffRow(), EditPage\getBaseRevision(), EditPage\getContentObject(), Article\getOldIDFromRequest(), DifferenceEngine\loadRevisionData(), CategoryMembershipChangeJob\notifyUpdatesForRevision(), MediaWiki\parseTitle(), WikiPage\replaceSectionAtRev(), Article\setOldSubtitle(), SpecialComparePages\showDiff(), RevDelRevisionList\suggestTarget(), and ChangeTags\updateTagsWithChecks().
|
static |
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.
$flags include: Revision::READ_LATEST : Select the data from the master (since 1.20) Revision::READ_LOCKING : Select & lock the data from the master
int | $pageId | |
int | $revId | (optional) |
int | $flags | Bitfield (optional) |
Definition at line 157 of file Revision.php.
References getRevisionLookup().
Referenced by NamespaceDupes\canMerge(), ApiStashEdit\execute(), and WikiPage\loadLastEdit().
|
static |
MCR migration note: replaced by RevisionStore::newRevisionFromRow(). Note that newFromRow() also accepts arrays, while newRevisionFromRow() does not. Instead, a MutableRevisionRecord should be constructed directly. RevisionStore::newMutableRevisionFromArray() can be used as a temporary replacement, but should be avoided.
object | array | $row |
Definition at line 223 of file Revision.php.
References getRevisionFactory().
Referenced by CategoryMembershipChangeJob\run().
|
static |
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.
$flags include: Revision::READ_LATEST : Select the data from the master Revision::READ_LOCKING : Select & lock the data from the master
LinkTarget | $linkTarget | |
int | $id | (optional) |
int | $flags | Bitfield (optional) |
Definition at line 138 of file Revision.php.
References getRevisionLookup().
Referenced by NamespaceDupes\canMerge(), CleanupSpam\cleanupArticle(), Title\countRevisionsBetween(), ApiEditPage\execute(), GetTextMaint\execute(), BenchmarkParse\execute(), MediaWikiGadgetsDefinitionRepo\fetchStructuredList(), Title\getAuthorsBetween(), ContentHandler\getAutoDeleteReason(), GadgetDefinitionNamespaceRepo\getGadget(), Skin\getNewtalks(), PageImages\Hooks\LinksUpdateHookHandler\getPageImageCandidates(), RawAction\getRawText(), FixDefaultJsonContentPages\handleRow(), initFromTitle(), InfoAction\invalidateCache(), MovePage\isValidMoveTarget(), Title\isValidMoveTarget(), DifferenceEngine\loadRevisionData(), SimpleCaptcha\loadText(), DoubleRedirectJob\run(), SpecialCiteThisPage\showCitations(), SpecialBookSources\showList(), and SpecialChangeContentModel\validateTitle().
|
static |
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. The title will also be loaded if $pageIdOrTitle is an integer ID.
IDatabase | $db | ignored! |
int | Title | $pageIdOrTitle | Page ID or Title object |
int | $revId | Known current revision of this page. Determined automatically if not given. |
Definition at line 1129 of file Revision.php.
References $title, getRevisionLookup(), and Title\newFromID().
Referenced by ResourceLoaderWikiModule\getContentObj(), MessageCache\loadCachedMessagePageEntry(), and WikiPage\loadLastEdit().
|
static |
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.
IDatabase | $dbw | |
int | $pageId | ID number of the page to read from |
string | $summary | Revision's summary |
bool | $minor | Whether the revision should be considered as minor |
User | null | $user | User object to use or null for $wgUser |
Definition at line 1000 of file Revision.php.
References $title, getRevisionStore(), Title\newFromID(), and CommentStoreComment\newUnsavedComment().
Referenced by WikiPage\insertProtectNullRevision(), MovePage\moveToInternal(), LocalFile\recordUpload2(), and ImportReporter\reportPage().
Revision::setId | ( | $id | ) |
Set the revision ID.
This should only be used for proposed revisions that turn out to be null edits.
int | string | $id |
MWException |
Definition at line 458 of file Revision.php.
Revision::setTitle | ( | $title | ) |
Set the title of the revision.
Title | $title |
Definition at line 571 of file Revision.php.
References $title.
Revision::setUserIdAndName | ( | $id, | |
$name | |||
) |
Set the user ID/name.
This should only be used for proposed revisions that turn out to be null edits
MWException |
Definition at line 480 of file Revision.php.
References User\newFromAnyId().
Revision::userCan | ( | $field, | |
User | $user = null |
||
) |
Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted.
int | $field | One of self::DELETED_TEXT, self::DELETED_COMMENT, self::DELETED_USER |
User | null | $user | User object to check, or null to use $wgUser |
Definition at line 1028 of file Revision.php.
References getVisibility(), and userCanBitfield().
Referenced by Linker\getRevDeleteLink(), Linker\revComment(), ChangesList\revDateLink(), and DifferenceEngine\userCanEdit().
|
static |
Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted.
This is used by various classes to avoid duplication.
int | $bitfield | Current field |
int | $field | One of self::DELETED_TEXT = File::DELETED_FILE, self::DELETED_COMMENT = File::DELETED_COMMENT, self::DELETED_USER = File::DELETED_USER |
User | null | $user | User object to check, or null to use $wgUser |
Title | null | $title | A Title object to check for per-page restrictions on, instead of just plain userrights |
Definition at line 1046 of file Revision.php.
References $title.
Referenced by ApiQueryDeletedrevs\execute(), OldLocalFile\userCan(), ArchivedFile\userCan(), and userCan().
|
static |
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.
IDatabase | int | $db | The Database to perform the check on. May be given as a Database object or a database identifier usable with wfGetDB. |
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 1108 of file Revision.php.
References getRevisionStore(), and wfGetDB().
Referenced by EditPage\internalAttemptSave().
|
protected |
Definition at line 43 of file Revision.php.
Referenced by getRevisionRecord().
const Revision::DELETED_COMMENT = RevisionRecord::DELETED_COMMENT |
Definition at line 47 of file Revision.php.
const Revision::DELETED_RESTRICTED = RevisionRecord::DELETED_RESTRICTED |
Definition at line 49 of file Revision.php.
const Revision::DELETED_TEXT = RevisionRecord::DELETED_TEXT |
Definition at line 46 of file Revision.php.
const Revision::DELETED_USER = RevisionRecord::DELETED_USER |
Definition at line 48 of file Revision.php.
const Revision::FOR_PUBLIC = RevisionRecord::FOR_PUBLIC |
Definition at line 54 of file Revision.php.
const Revision::FOR_THIS_USER = RevisionRecord::FOR_THIS_USER |
Definition at line 55 of file Revision.php.
const Revision::RAW = RevisionRecord::RAW |
Definition at line 56 of file Revision.php.
const Revision::SUPPRESSED_ALL = RevisionRecord::SUPPRESSED_ALL |
Definition at line 51 of file Revision.php.
const Revision::SUPPRESSED_USER = RevisionRecord::SUPPRESSED_USER |
Definition at line 50 of file Revision.php.
const Revision::TEXT_CACHE_GROUP = SqlBlobStore::TEXT_CACHE_GROUP |
Definition at line 58 of file Revision.php.