MediaWiki
1.23.2
|
Public Member Functions | |
__construct ( $row) | |
Constructor. More... | |
getComment ( $audience=self::FOR_PUBLIC, User $user=null) | |
Fetch revision comment if it's available to the specified audience. More... | |
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 this revision. More... | |
getContentHandler () | |
Returns the content handler appropriate for this revision's content model. More... | |
getContentModel () | |
Returns the content model for 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... | |
getRawComment () | |
Fetch revision comment without regard for the current user's permissions. More... | |
getRawText () | |
Fetch revision text without regard for view restrictions. More... | |
getRawUser () | |
Fetch revision's user id without regard for the current user's permissions. More... | |
getRawUserText () | |
Fetch revision's username without regard for view restrictions. More... | |
getRecentChange () | |
Get the RC object belonging to the current revision, if there's one. More... | |
getSerializedData () | |
Fetch original serialized data without regard for view restrictions. More... | |
getSha1 () | |
Returns the base36 sha1 of the text in this revision, or null if unknown. More... | |
getSize () | |
Returns the length of the text in this revision, or null if unknown. More... | |
getText ( $audience=self::FOR_PUBLIC, User $user=null) | |
Fetch revision text if it's available to the specified audience. More... | |
getTextId () | |
Get text row ID. More... | |
getTimestamp () | |
getTitle () | |
Returns the title of the page associated with this entry or null. 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... | |
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 | fetchRevision ( $title) |
Return a wrapper for a series of database rows to fetch all of a given page's revisions in turn. More... | |
static | getParentLengths ( $db, array $revIds) |
Do a batched query to get the parent revision lengths. More... | |
static | getRevisionText ( $row, $prefix='old_', $wiki=false) |
Get revision text associated with an old or archive row $row is usually an object from wfFetchRow(), both the flags and the text field must be included. More... | |
static | getTimestampFromId ( $title, $id) |
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=array()) |
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 ( $title, $id=0, $flags=0) |
Load either the current, or a specified, revision that's attached to a given title. More... | |
static | newNullRevision ( $dbw, $pageId, $summary, $minor) |
Create a new null-revision for insertion into a page's history. More... | |
static | pageJoinCond () |
Return the value of a select() page conds array for the page table. More... | |
static | selectArchiveFields () |
Return the list of revision fields that should be selected to create a new revision from an archive row. More... | |
static | selectFields () |
Return the list of revision fields that should be selected to create a new revision. More... | |
static | selectPageFields () |
Return the list of page fields that should be selected from page table. More... | |
static | selectTextFields () |
Return the list of text fields that should be selected to read the revision text. More... | |
static | selectUserFields () |
Return the list of user fields that should be selected from user table. More... | |
static | userCanBitfield ( $bitfield, $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 | userJoinCond () |
Return the value of a select() JOIN conds array for the user table. 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 = 2 |
const | DELETED_RESTRICTED = 8 |
const | DELETED_TEXT = 1 |
const | DELETED_USER = 4 |
const | FOR_PUBLIC = 1 |
const | FOR_THIS_USER = 2 |
const | RAW = 3 |
const | SUPPRESSED_USER = 12 |
Public Attributes inherited from IDBAccessObject | |
const | READ_LATEST = 1 |
const | READ_LOCKING = 3 |
const | READ_NONE = -1 |
const | READ_NORMAL = 0 |
Protected Member Functions | |
checkContentModel () | |
getContentInternal () | |
Gets the content object for the revision (or null on failure). More... | |
loadText () | |
Lazy-load the revision's text. More... | |
Protected Attributes | |
$mComment | |
Content null bool | $mContent |
$mContentFormat | |
null ContentHandler | $mContentHandler |
$mContentModel | |
$mCurrent | |
$mDeleted | |
$mId | |
$mMinorEdit | |
$mOrigUserText | |
int null | $mPage |
$mParentId | |
int | $mQueryFlags = 0 |
$mSha1 | |
$mSize | |
$mText | |
$mTextRow | |
$mTimestamp | |
null Title | $mTitle |
$mUser | |
$mUserText | |
Private Member Functions | |
getPreviousRevisionId ( $db) | |
Get previous revision Id for this page_id This is used to populate rev_parent_id on save. More... | |
Static Private Member Functions | |
static | fetchFromConds ( $db, $conditions, $flags=0) |
Given a set of conditions, return a ResultWrapper which will return matching database rows with the fields necessary to build Revision objects. More... | |
static | loadFromConds ( $db, $conditions, $flags=0) |
Given a set of conditions, fetch a revision from the given database connection. More... | |
static | newFromConds ( $conditions, $flags=0) |
Given a set of conditions, fetch a revision. More... | |
Definition at line 26 of file Revision.php.
Revision::__construct | ( | $row | ) |
Constructor.
$row | Mixed: either a database row or an array |
MWException |
Definition at line 527 of file Revision.php.
References $mPage, $wgUser, base36Sha1(), getContentFormat(), getContentHandler(), getContentModel(), global, needed(), Title\newFromRow(), on, wfDebug(), and wfTimestampNow().
|
static |
Get the base 36 SHA-1 value for a string of text.
$text | String |
Definition at line 1479 of file Revision.php.
References wfBaseConvert().
Referenced by __construct(), RevisionTest\dataGetSha1(), insertOn(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), and PopulateRevisionSha1\upgradeRow().
|
protected |
Definition at line 1425 of file Revision.php.
References $t, $title, getContent(), getContentFormat(), getContentHandler(), getContentModel(), ContentHandler\getDefaultModelFor(), ContentHandler\getForModelID(), getTitle(), global, and RAW.
Referenced by insertOn().
|
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.
$text | Mixed: reference to a text |
Definition at line 1261 of file Revision.php.
References $flags, array(), global, and wfDebug().
Referenced by CheckStorage\importRevision(), insertOn(), RevisionTest\testCompressRevisionTextUtf8(), and RevisionTest\testCompressRevisionTextUtf8Gzip().
|
static |
Get count of revisions per page...not very efficient.
$db | DatabaseBase |
$id | Integer: page id |
Definition at line 1692 of file Revision.php.
References array().
Referenced by countByTitle().
|
static |
Get count of revisions per page...not very efficient.
$db | DatabaseBase |
$title | Title |
Definition at line 1708 of file Revision.php.
References $title, and countByPageId().
|
static |
Re-converts revision text according to it's flags.
$text | Mixed: reference to a text |
$flags | array: compression flags |
Definition at line 1287 of file Revision.php.
References $flags, $wgContLang, and global.
Referenced by getRevisionText().
|
staticprivate |
Given a set of conditions, return a ResultWrapper which will return matching database rows with the fields necessary to build Revision objects.
$db | DatabaseBase |
$conditions | Array |
$flags | integer (optional) |
Definition at line 360 of file Revision.php.
References $flags, $options, and array().
Referenced by fetchRevision(), and loadFromConds().
|
static |
Return a wrapper for a series of database rows to fetch all of a given page's revisions in turn.
Each row can be fed to the constructor to get objects.
$title | Title |
Definition at line 339 of file Revision.php.
References $title, array(), DB_SLAVE, fetchFromConds(), and wfGetDB().
Referenced by RevisionStorageTest\testFetchRevision().
Revision::getComment | ( | $audience = self::FOR_PUBLIC , |
|
User | $user = null |
||
) |
Fetch revision comment if it's available to the specified audience.
If the specified audience does not have access to the comment, an empty string will be returned.
$audience | Integer: 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 | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 884 of file Revision.php.
References $mComment, $user, isDeleted(), and userCan().
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, null will be returned.
$audience | Integer: one of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to $wgUser Revision::RAW get the text regardless of permissions |
$user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 999 of file Revision.php.
References $user, getContentInternal(), isDeleted(), and userCan().
Referenced by checkContentModel(), WikiPage\doEditUpdates(), getText(), ContentHandler\getUndoContent(), and BenchmarkParse\runParser().
Revision::getContentFormat | ( | ) |
Returns the content format for 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 1097 of file Revision.php.
References $mContentFormat, and getContentHandler().
Referenced by __construct(), RevisionStorageTest\assertRevEquals(), checkContentModel(), getContentHandler(), getContentInternal(), and insertOn().
Revision::getContentHandler | ( | ) |
Returns the content handler appropriate for this revision's content model.
MWException |
Definition at line 1114 of file Revision.php.
References $mContentHandler, getContentFormat(), getContentModel(), and ContentHandler\getForModelID().
Referenced by __construct(), checkContentModel(), getContentFormat(), getContentInternal(), and WikiPage\getUndoContent().
|
protected |
Gets the content object for the revision (or null on failure).
Note that for mutable Content objects, each call to this method will return a fresh clone.
Definition at line 1045 of file Revision.php.
References getContentFormat(), getContentHandler(), and loadText().
Referenced by getContent().
Revision::getContentModel | ( | ) |
Returns the content model for this revision.
If no content model was stored in the database, $this->getTitle()->getContentModel() 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 1077 of file Revision.php.
References $mContentModel, $title, CONTENT_MODEL_WIKITEXT, and getTitle().
Referenced by __construct(), RevisionStorageTest\assertRevEquals(), checkContentModel(), getContentHandler(), and insertOn().
Revision::getId | ( | ) |
Get revision ID.
Definition at line 699 of file Revision.php.
References $mId.
Referenced by RevisionStorageTest\assertRevEquals(), WikiPage\doEditUpdates(), getNext(), getPrevious(), getRecentChange(), and BenchmarkParse\runParser().
Revision::getNext | ( | ) |
Get next revision for this title.
Definition at line 1164 of file Revision.php.
References getId(), getTitle(), and newFromTitle().
Revision::getPage | ( | ) |
Get the page ID.
Definition at line 795 of file Revision.php.
References $mPage.
Referenced by RevisionStorageTest\assertRevEquals().
Revision::getParentId | ( | ) |
Get parent revision ID (the original previous page revision)
Definition at line 727 of file Revision.php.
References $mParentId.
|
static |
Do a batched query to get the parent revision lengths.
$db | DatabaseBase |
$revIds | Array |
Definition at line 503 of file Revision.php.
References $res, array(), as, wfProfileIn(), and wfProfileOut().
Referenced by HistoryPager\doBatchLookups(), ContribsPager\doBatchLookups(), and ApiQueryContributions\execute().
Revision::getPrevious | ( | ) |
Get previous revision for this title.
Definition at line 1149 of file Revision.php.
References getId(), getTitle(), and newFromTitle().
Referenced by WikiPage\getUndoText().
|
private |
Get previous revision Id for this page_id This is used to populate rev_parent_id on save.
$db | DatabaseBase |
Definition at line 1181 of file Revision.php.
References array().
Referenced by insertOn().
Revision::getRawComment | ( | ) |
Fetch revision comment without regard for the current user's permissions.
Definition at line 899 of file Revision.php.
References $mComment.
Revision::getRawText | ( | ) |
Fetch revision text without regard for view restrictions.
Definition at line 1017 of file Revision.php.
References ContentHandler\deprecated(), and getText().
Revision::getRawUser | ( | ) |
Fetch revision's user id without regard for the current user's permissions.
Definition at line 827 of file Revision.php.
References $mUser.
Revision::getRawUserText | ( | ) |
Fetch revision's username without regard for view restrictions.
Definition at line 859 of file Revision.php.
References $mOrigUserText, $mUserText, and User\whoIs().
Referenced by getRecentChange(), and getUserText().
Revision::getRecentChange | ( | ) |
Get the RC object belonging to the current revision, if there's one.
Definition at line 932 of file Revision.php.
References $dbr, array(), DB_SLAVE, getId(), getRawUserText(), RecentChange\newFromConds(), and wfGetDB().
Referenced by isUnpatrolled().
|
static |
Get revision text associated with an old or archive row $row is usually an object from wfFetchRow(), both the flags and the text field must be included.
stdClass | $row | The text data |
string | $prefix | Table prefix (default 'old_') |
string | bool | $wiki | The name of the wiki to load the revision text from (same as the 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 1212 of file Revision.php.
References $flags, array(), decompressRevisionText(), ExternalStore\fetchFromURL(), wfProfileIn(), and wfProfileOut().
Referenced by CompressOld\compressWithConcat(), FetchText\doGetText(), RecompressTracked\doOrphanList(), RecompressTracked\doPage(), ApiQueryDeletedrevs\execute(), TextPassDumper\getTextDb(), PageArchive\getTextFromRow(), MessageCache\loadFromDB(), loadText(), newFromArchiveRow(), RevisionTest\testCompressRevisionTextUtf8(), RevisionTest\testCompressRevisionTextUtf8Gzip(), RevisionTest\testGetRevisionText(), RevisionTest\testGetRevisionTextGzip(), RevisionTest\testGetRevisionTextUtf8Legacy(), RevisionTest\testGetRevisionTextUtf8LegacyGzip(), RevisionTest\testGetRevisionTextUtf8Native(), RevisionTest\testGetRevisionTextUtf8NativeGzip(), and XmlDumpWriter\writeRevision().
Revision::getSerializedData | ( | ) |
Fetch original serialized data without regard for view restrictions.
Definition at line 1028 of file Revision.php.
References $mText, and loadText().
Revision::getSha1 | ( | ) |
Returns the base36 sha1 of the text in this revision, or null if unknown.
Definition at line 745 of file Revision.php.
References $mSha1.
Referenced by RevisionStorageTest\assertRevEquals().
Revision::getSize | ( | ) |
Returns the length of the text in this revision, or null if unknown.
Definition at line 736 of file Revision.php.
References $mSize.
Revision::getText | ( | $audience = self::FOR_PUBLIC , |
|
User | $user = null |
||
) |
Fetch revision text if it's available to the specified audience.
If the specified audience does not have the ability to view this revision, an empty string will be returned.
$audience | Integer: 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 | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 978 of file Revision.php.
References $user, content, ContentHandler\deprecated(), getContent(), ContentHandler\getContentText(), and text.
Referenced by getRawText().
Revision::getTextId | ( | ) |
Get text row ID.
Definition at line 718 of file Revision.php.
Referenced by loadText().
Revision::getTimestamp | ( | ) |
Definition at line 1133 of file Revision.php.
References TS_MW, and wfTimestamp().
Referenced by RevisionStorageTest\assertRevEquals(), and WikiPage\setLastEdit().
|
static |
Get rev_timestamp from rev_id, without loading the rest of the row.
$title | Title |
$id | Integer |
Definition at line 1668 of file Revision.php.
References $dbr, $timestamp, $title, array(), DB_MASTER, DB_SLAVE, TS_MW, wfGetDB(), wfGetLB(), and wfTimestamp().
Referenced by ApiSetNotificationTimestamp\execute(), and Skin\lastModified().
Revision::getTitle | ( | ) |
Returns the title of the page associated with this entry or null.
Will do a query, when title is not set and id is given.
Definition at line 756 of file Revision.php.
References $dbr, $mTitle, array(), DB_SLAVE, Title\newFromID(), Title\newFromRow(), and wfGetDB().
Referenced by checkContentModel(), getContentModel(), getNext(), getPrevious(), insertOn(), 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.
$audience | Integer: 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 | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 812 of file Revision.php.
References $mUser, $user, isDeleted(), and userCan().
Referenced by RevisionStorageTest\assertRevEquals().
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.
$audience | Integer: 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 | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 844 of file Revision.php.
References $user, getRawUserText(), isDeleted(), and userCan().
Revision::getVisibility | ( | ) |
Get the deletion bitfield of the revision.
Definition at line 958 of file Revision.php.
References $mDeleted.
Revision::insertOn | ( | $dbw | ) |
Insert a new revision into the database, returning the new revision ID number on success and dies horribly on failure.
$dbw | DatabaseBase: (master connection) |
MWException |
Definition at line 1328 of file Revision.php.
References $flags, $mDeleted, $mId, $mParentId, $mSha1, $mSize, $mText, $title, array(), base36Sha1(), checkContentModel(), compressRevisionText(), getContentFormat(), getContentModel(), ContentHandler\getDefaultModelFor(), ContentHandler\getForModelID(), getPreviousRevisionId(), getTitle(), global, ExternalStore\insertToDefault(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by WikiPage\doQuickEditContent().
Revision::isCurrent | ( | ) |
Definition at line 1140 of file Revision.php.
References $mCurrent.
Referenced by DifferenceEngine\getParserOutput(), and DifferenceEngine\getRevisionHeader().
Revision::isDeleted | ( | $field | ) |
int | $field | one of DELETED_* bitfield constants |
Definition at line 949 of file Revision.php.
Referenced by getComment(), getContent(), getUser(), and getUserText().
Revision::isMinor | ( | ) |
Definition at line 906 of file Revision.php.
References $mMinorEdit.
Referenced by WikiPage\doEditUpdates().
Revision::isUnpatrolled | ( | ) |
Definition at line 913 of file Revision.php.
References getRecentChange().
|
staticprivate |
Given a set of conditions, fetch a revision from the given database connection.
$db | DatabaseBase |
$conditions | Array |
$flags | integer (optional) |
Definition at line 318 of file Revision.php.
References $flags, $res, $ret, and fetchFromConds().
Referenced by loadFromId(), loadFromPageId(), loadFromTimestamp(), loadFromTitle(), newFromConds(), and newFromTitle().
|
static |
Load a page revision from a given revision ID number.
Returns null if no such revision can be found.
$db | DatabaseBase |
$id | Integer |
Definition at line 218 of file Revision.php.
References array(), and loadFromConds().
|
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.
$db | DatabaseBase |
$pageid | Integer |
$id | Integer |
Definition at line 232 of file Revision.php.
References array(), and loadFromConds().
Referenced by 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.
$db | DatabaseBase |
$title | Title |
$timestamp | String |
Definition at line 277 of file Revision.php.
References $timestamp, $title, array(), and loadFromConds().
Referenced by AttachLatest\execute(), 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.
$db | DatabaseBase |
$title | Title |
$id | Integer |
Definition at line 252 of file Revision.php.
References $title, array(), and loadFromConds().
|
protected |
Lazy-load the revision's text.
Currently hardcoded to the 'text' table storage engine.
Definition at line 1489 of file Revision.php.
References $dbr, $mTextRow, $wgMemc, array(), DB_MASTER, DB_SLAVE, getRevisionText(), getTextId(), global, IDBAccessObject\READ_LOCKING, wfDebug(), wfDebugLog(), wfGetDB(), wfGetLB(), wfMemcKey(), wfProfileIn(), and wfProfileOut().
Referenced by getContentInternal(), and getSerializedData().
|
static |
Make a fake revision object from an archive table row.
This is queried for permissions or even inserted (as in Special:Undelete)
$row | |
$overrides | array |
MWException |
Definition at line 159 of file Revision.php.
References $attribs, array(), getRevisionText(), global, and Title\makeTitle().
Referenced by RevDel_ArchiveItem\__construct(), RevDel_ArchivedRevisionItem\__construct(), DifferenceEngine\deletedLink(), SpecialUndelete\formatRevisionRow(), PageArchive\getRevision(), RevisionStorageTest\testNewFromArchiveRow(), PageArchive\undeleteRevisions(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), PopulateRevisionLength\upgradeRow(), and PopulateRevisionSha1\upgradeRow().
|
staticprivate |
Given a set of conditions, fetch a revision.
$conditions | Array |
$flags | integer (optional) |
Definition at line 294 of file Revision.php.
References $flags, $rev, DB_MASTER, DB_SLAVE, loadFromConds(), wfGetDB(), and wfGetLB().
Referenced by newFromId(), newFromPageId(), and newFromTitle().
|
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
$id | Integer |
$flags | Integer (optional) |
Definition at line 88 of file Revision.php.
References $flags, array(), and newFromConds().
Referenced by SpecialComparePages\checkExistingRevision(), Orphans\checkSeparation(), User\clearNotification(), WikiPage\commitRollback(), ApiComparePages\execute(), ApiPatrol\execute(), CheckBadRedirects\execute(), BenchmarkParse\execute(), SpecialNewpages\feedItemDesc(), Article\fetchContentObject(), FeedUtils\formatDiffRow(), Article\getOldIDFromRequest(), PageArchive\getPreviousRevision(), DifferenceEngine\loadRevisionData(), MediaWiki\parseTitle(), Article\setOldSubtitle(), SpecialComparePages\showDiff(), RevDel_RevisionList\suggestTarget(), RevisionStorageTest\testGetContent(), RevisionStorageTest\testGetContentFormat(), RevisionStorageTest\testGetContentModel(), RevisionStorageTest\testGetPage(), RevisionStorageTest\testGetRawText(), RevisionStorageTest\testGetText(), RevisionStorageTest\testIsCurrent(), and RevisionStorageTest\testNewFromId().
|
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
$revId | Integer |
$pageId | Integer (optional) |
$flags | Integer Bitfield (optional) |
Definition at line 137 of file Revision.php.
References $flags, array(), and newFromConds().
Referenced by WikiPage\loadLastEdit().
|
static |
$row |
Definition at line 206 of file Revision.php.
Referenced by ApiFeedContributions\feedItem(), WikiPage\getOldestRevision(), and RevisionStorageTest\testNewFromRow().
|
static |
Load either the current, or a specified, revision that's attached to a given title.
If not attached to that title, will return null.
$flags include: Revision::READ_LATEST : Select the data from the master Revision::READ_LOCKING : Select & lock the data from the master
$title | Title |
$id | Integer (optional) |
$flags | Integer Bitfield (optional) |
Definition at line 106 of file Revision.php.
References $flags, $title, array(), DB_MASTER, DB_SLAVE, loadFromConds(), newFromConds(), and wfGetDB().
Referenced by CleanupSpam\cleanupArticle(), Title\countRevisionsBetween(), PoolWorkArticleView\doWork(), ApiEditPage\execute(), GetTextMaint\execute(), BenchmarkParse\execute(), Title\getAuthorsBetween(), ContentHandler\getAutoDeleteReason(), CoreParserFunctions\getCachedRevisionObject(), ResourceLoaderWikiModule\getContent(), LocalFile\getDescriptionText(), MessageCache\getMsgFromNamespace(), Skin\getNewtalks(), getNext(), getPrevious(), RawAction\getRawText(), SearchResult\initFromTitle(), Title\isValidMoveTarget(), DifferenceEngine\loadRevisionData(), DoubleRedirectJob\run(), RefreshLinksJob\runForTitle(), and SpecialBookSources\showList().
|
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.
$dbw | DatabaseBase | |
$pageId | Integer: ID number of the page to read from | |
string | $summary | revision's summary |
$minor | Boolean: whether the revision should be considered as minor |
Definition at line 1567 of file Revision.php.
References $summary, array(), global, Title\makeTitle(), wfProfileIn(), and wfProfileOut().
Referenced by WikiPage\insertProtectNullRevision(), Title\moveToInternal(), LocalFile\recordUpload2(), ImportReporter\reportPage(), and RevisionStorageTest\testNewNullRevision().
|
static |
Return the value of a select() page conds array for the page table.
This will assure that the revision(s) are not orphaned from live pages.
Definition at line 396 of file Revision.php.
References array().
Referenced by RevDel_RevisionList\doQuery(), RevisionList\doQuery(), and MergeHistoryPager\getQueryInfo().
|
static |
Return the list of revision fields that should be selected to create a new revision from an archive row.
Definition at line 436 of file Revision.php.
References array(), and global.
Referenced by PopulateRevisionLength\doDBUpdates().
|
static |
Return the list of revision fields that should be selected to create a new revision.
Definition at line 405 of file Revision.php.
References array(), and global.
Referenced by PopulateRevisionLength\doDBUpdates(), RevDel_RevisionList\doQuery(), RevisionList\doQuery(), ApiQueryRevisions\execute(), HistoryAction\fetchRevisions(), Title\getFirstRevision(), WikiPage\getOldestRevision(), HistoryPager\getQueryInfo(), MergeHistoryPager\getQueryInfo(), RebuildTextIndex\populateSearchIndex(), RevisionTest_ContentHandlerUseDB\testSelectFields(), and RevisionStorageTest\testSelectFields().
|
static |
Return the list of page fields that should be selected from page table.
Definition at line 478 of file Revision.php.
References array().
Referenced by ApiQueryRevisions\execute(), and RebuildTextIndex\populateSearchIndex().
|
static |
Return the list of text fields that should be selected to read the revision text.
Definition at line 467 of file Revision.php.
References array().
Referenced by ApiQueryRevisions\execute(), and RebuildTextIndex\populateSearchIndex().
|
static |
Return the list of user fields that should be selected from user table.
Definition at line 493 of file Revision.php.
References array().
Referenced by RevDel_RevisionList\doQuery(), RevisionList\doQuery(), ApiQueryRevisions\execute(), HistoryPager\getQueryInfo(), and MergeHistoryPager\getQueryInfo().
Revision::setId | ( | $id | ) |
Revision::setTitle | ( | $title | ) |
Set the title of the revision.
$title | Title |
Definition at line 786 of file Revision.php.
References $title.
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.
$field | Integer:one of self::DELETED_TEXT, self::DELETED_COMMENT, self::DELETED_USER |
$user | User object to check, or null to use $wgUser |
Definition at line 1625 of file Revision.php.
References $user, and userCanBitfield().
Referenced by getComment(), getContent(), getUser(), and getUserText().
|
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.
$bitfield | Integer: current field |
$field | Integer: one of self::DELETED_TEXT = File::DELETED_FILE, self::DELETED_COMMENT = File::DELETED_COMMENT, self::DELETED_USER = File::DELETED_USER |
$user | User object to check, or null to use $wgUser |
Definition at line 1641 of file Revision.php.
References $user, $wgUser, global, and wfDebug().
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryWatchlist\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), OldLocalFile\userCan(), ChangesList\userCan(), ArchivedFile\userCan(), and userCan().
|
static |
Return the value of a select() JOIN conds array for the user table.
This will get user table rows for logged-in users.
Definition at line 386 of file Revision.php.
References array().
Referenced by RevDel_RevisionList\doQuery(), RevisionList\doQuery(), ApiQueryRevisions\execute(), HistoryPager\getQueryInfo(), and MergeHistoryPager\getQueryInfo().
|
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.
DatabaseBase | 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 1731 of file Revision.php.
References $res, array(), as, and wfGetDB().
Referenced by RevisionStorageTest\testUserWasLastToEdit().
|
protected |
Definition at line 41 of file Revision.php.
Referenced by getComment(), and getRawComment().
|
protected |
Definition at line 54 of file Revision.php.
|
protected |
Definition at line 50 of file Revision.php.
Referenced by getContentFormat().
|
protected |
Definition at line 58 of file Revision.php.
Referenced by getContentHandler().
|
protected |
Definition at line 49 of file Revision.php.
Referenced by getContentModel().
|
protected |
Definition at line 48 of file Revision.php.
Referenced by isCurrent().
|
protected |
Definition at line 37 of file Revision.php.
Referenced by getVisibility(), and insertOn().
|
protected |
Definition at line 27 of file Revision.php.
Referenced by getId(), and insertOn().
|
protected |
Definition at line 35 of file Revision.php.
Referenced by isMinor().
|
protected |
Definition at line 33 of file Revision.php.
Referenced by getRawUserText().
|
protected |
Definition at line 31 of file Revision.php.
Referenced by __construct(), and getPage().
|
protected |
Definition at line 40 of file Revision.php.
Referenced by getParentId(), and insertOn().
|
protected |
Definition at line 62 of file Revision.php.
|
protected |
Definition at line 39 of file Revision.php.
Referenced by getSha1(), and insertOn().
|
protected |
Definition at line 38 of file Revision.php.
Referenced by getSize(), and insertOn().
|
protected |
Definition at line 42 of file Revision.php.
Referenced by getSerializedData(), and insertOn().
|
protected |
Definition at line 43 of file Revision.php.
Referenced by loadText().
|
protected |
Definition at line 36 of file Revision.php.
|
protected |
Definition at line 47 of file Revision.php.
Referenced by getTitle().
|
protected |
Definition at line 34 of file Revision.php.
Referenced by getRawUser(), and getUser().
|
protected |
Definition at line 32 of file Revision.php.
Referenced by getRawUserText().
const Revision::DELETED_COMMENT = 2 |
Definition at line 66 of file Revision.php.
Referenced by LocalFileDeleteBatch\doDBInserts(), WikiPage\doDeleteArticleReal(), ApiRevisionDelete\execute(), ApiQueryDeletedrevs\execute(), SpecialRevisionDelete\execute(), ApiQueryWatchlist\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiQueryRevisions\extractRowInfo(), FeedUtils\formatDiff(), RevDel_RevisionItem\getApiData(), RevDel_FileItem\getApiData(), RevisionDeleter\getChanges(), ChangesList\insertComment(), Linker\revComment(), and XmlDumpWriter\writeRevision().
const Revision::DELETED_RESTRICTED = 8 |
Definition at line 68 of file Revision.php.
Referenced by SpecialRevisionDelete\buildCheckBoxes(), RevDel_RevisionItem\canView(), RevisionItem\canView(), RevDel_LogItem\canView(), LocalFileDeleteBatch\doDBInserts(), WikiPage\doDeleteArticleReal(), ApiRevisionDelete\execute(), ApiQueryDeletedrevs\execute(), ApiQueryRevisions\execute(), SpecialRevisionDelete\execute(), SpecialRevisionDelete\extractBitParams(), ApiQueryWatchlist\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiQueryRevisions\extractRowInfo(), RevisionDeleter\getChanges(), RevDel_RevisionList\getSuppressBit(), RevDel_LogList\getSuppressBit(), HistoryPager\historyLine(), ApiQueryContributions\prepareQuery(), ApiQueryWatchlist\run(), ApiQueryRecentChanges\run(), RevisionDeleteUser\setUsernameBitfields(), RevDel_List\setVisibility(), Article\showDeletedRevisionHeader(), DifferenceEngine\showDiffPage(), and SpecialRevisionDelete\submit().
const Revision::DELETED_TEXT = 1 |
Definition at line 65 of file Revision.php.
Referenced by RevDel_RevisionItem\canViewContent(), RevisionItem\canViewContent(), CleanupSpam\cleanupArticle(), WikiPage\commitRollback(), HistoryPager\curLink(), HistoryPager\diffButtons(), LocalFileDeleteBatch\doDBInserts(), WikiPage\doDeleteArticleReal(), ApiEditPage\execute(), ApiParse\execute(), ApiQueryDeletedrevs\execute(), ApiQueryRevisions\execute(), ApiQueryContributions\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiQueryRevisions\extractRowInfo(), SpecialMergeHistory\formatRevisionRow(), SpecialUndelete\formatRevisionRow(), DeletedContribsPager\formatRow(), ContribsPager\formatRow(), RevDel_RevisionItem\getApiData(), RevisionDeleter\getChanges(), DifferenceEngine\getDiffBody(), SpecialUndelete\getPageLink(), RevDel_RevisionList\getRevdelConstant(), DifferenceEngine\getRevisionHeader(), Linker\getRollbackEditCount(), HistoryPager\historyLine(), ChangesList\insertArticleLink(), ChangesList\insertDiffHist(), RevDel_RevisionItem\isDeleted(), RevisionItem\isDeleted(), RevDel_RevisionItem\isHideCurrentOp(), HistoryPager\lastLink(), EnhancedChangesList\recentChangesBlockGroup(), HistoryPager\revLink(), Article\showDeletedRevisionHeader(), RCCacheEntryFactory\showDiffLinks(), DifferenceEngine\showDiffPage(), SpecialUndelete\showRevision(), PageArchive\undeleteRevisions(), and XmlDumpWriter\writeRevision().
const Revision::DELETED_USER = 4 |
Definition at line 67 of file Revision.php.
Referenced by ChangesFeed\buildItems(), WikiPage\commitRollback(), WikiExporter\do_list_authors(), LocalFileDeleteBatch\doDBInserts(), WikiPage\doDeleteArticleReal(), ApiRevisionDelete\execute(), ApiQueryDeletedrevs\execute(), ApiQueryContributors\execute(), ApiQueryRevisions\execute(), SpecialRevisionDelete\execute(), ApiQueryWatchlist\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiQueryRevisions\extractRowInfo(), DeletedContribsPager\formatRow(), ContribsPager\formatRow(), RevDel_RevisionItem\getApiData(), RevDel_FileItem\getApiData(), ContentHandler\getAutoDeleteReason(), RevisionDeleter\getChanges(), DeletedContribsPager\getQueryInfo(), Linker\getRollbackEditCount(), RCCacheEntryFactory\getUserLink(), RevDel_FileItem\getUserTools(), ChangesList\insertUserRelatedLinks(), RCCacheEntryFactory\newFromRecentChange(), ApiQueryContributions\prepareQuery(), Linker\revUserLink(), Linker\revUserTools(), ApiQueryWatchlist\run(), ApiQueryRecentChanges\run(), RevisionDeleteUser\setUsernameBitfields(), and XmlDumpWriter\writeRevision().
const Revision::FOR_PUBLIC = 1 |
Definition at line 72 of file Revision.php.
Referenced by RevisionTest\dataGetContent(), RevisionTest\dataGetText(), and GetTextMaint\execute().
const Revision::FOR_THIS_USER = 2 |
Definition at line 73 of file Revision.php.
Referenced by ApiEditPage\execute(), ApiParse\execute(), ApiQueryRevisions\extractRowInfo(), Article\fetchContentObject(), RevDel_RevisionItem\getApiData(), DifferenceEngine\loadNewText(), DifferenceEngine\loadText(), InfoAction\pageInfo(), Linker\revComment(), Linker\revUserLink(), Linker\revUserTools(), SpecialUndelete\showDiff(), and SpecialUndelete\showRevision().
const Revision::RAW = 3 |
Definition at line 74 of file Revision.php.
Referenced by checkContentModel(), CleanupSpam\cleanupArticle(), WikiPage\doDeleteArticleReal(), WikiPage\doEditContent(), PoolWorkArticleView\doWork(), ApiPurge\execute(), GetTextMaint\execute(), RefreshLinks\fixLinksFromArticle(), RefreshLinks\fixRedirect(), ResourceLoaderWikiModule\getContent(), WikiPage\getDeletionUpdates(), ApiParse\getParsedContent(), WikiPage\getRawText(), CheckStorage\importRevision(), WikiPage\prepareContentForEdit(), PreprocessDump\processRevision(), RefreshLinksJob\runForTitle(), ApiEditPageTest\testEditNewSection(), ApiEditPageTest\testEditSection(), RevisionTest\testGetContentClone(), RevisionTest\testGetContentUncloned(), and PageArchive\undeleteRevisions().
const Revision::SUPPRESSED_USER = 12 |
Definition at line 69 of file Revision.php.
Referenced by DeletedContribsPager\getQueryInfo().