MediaWiki  REL1_20
Revision Class Reference
Inheritance diagram for Revision:
Collaboration diagram for Revision:

List of all members.

Public Member Functions

 __construct ($row)
 Constructor.
 getComment ($audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision comment if it's available to the specified audience.
 getId ()
 Get revision ID.
 getNext ()
 Get next revision for this title.
 getPage ()
 Get the page ID.
 getParentId ()
 Get parent revision ID (the original previous page revision)
 getPrevious ()
 Get previous revision for this title.
 getRawComment ()
 Fetch revision comment without regard for the current user's permissions.
 getRawText ()
 Fetch revision text without regard for view restrictions.
 getRawUser ()
 Fetch revision's user id without regard for the current user's permissions.
 getRawUserText ()
 Fetch revision's username without regard for view restrictions.
 getSha1 ()
 Returns the base36 sha1 of the text in this revision, or null if unknown.
 getSize ()
 Returns the length of the text in this revision, or null if unknown.
 getText ($audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision text if it's available to the specified audience.
 getTextId ()
 Get text row ID.
 getTimestamp ()
 getTitle ()
 Returns the title of the page associated with this entry or null.
 getUser ($audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision's user id if it's available to the specified audience.
 getUserText ($audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision's username if it's available to the specified audience.
 getVisibility ()
 Get the deletion bitfield of the revision.
 insertOn ($dbw)
 Insert a new revision into the database, returning the new revision ID number on success and dies horribly on failure.
 isCurrent ()
 isDeleted ($field)
 isMinor ()
 isUnpatrolled ()
 revText ()
 Alias for getText(Revision::FOR_THIS_USER)
 setId ($id)
 Set the revision ID.
 setTitle ($title)
 Set the title of the 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.

Static Public Member Functions

static base36Sha1 ($text)
 Get the base 36 SHA-1 value for a string of text.
static compressRevisionText (&$text)
 If $wgCompressRevisions is enabled, we will compress data.
static countByPageId ($db, $id)
 Get count of revisions per page...not very efficient.
static countByTitle ($db, $title)
 Get count of revisions per page...not very efficient.
static fetchRevision ($title)
 Return a wrapper for a series of database rows to fetch all of a given page's revisions in turn.
static getParentLengths ($db, array $revIds)
 Do a batched query to get the parent revision lengths.
static getRevisionText ($row, $prefix= 'old_')
 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.
static getTimestampFromId ($title, $id)
 Get rev_timestamp from rev_id, without loading the rest of the row.
static loadFromId ($db, $id)
 Load a page revision from a given revision ID number.
static loadFromPageId ($db, $pageid, $id=0)
 Load either the current, or a specified, revision that's attached to a given page.
static loadFromTimestamp ($db, $title, $timestamp)
 Load the revision for the given title with the given timestamp.
static loadFromTitle ($db, $title, $id=0)
 Load either the current, or a specified, revision that's attached to a given page.
static newFromArchiveRow ($row, $overrides=array())
 Make a fake revision object from an archive table row.
static newFromId ($id, $flags=0)
 Load a page revision from a given revision ID number.
static newFromPageId ($pageId, $revId=0, $flags=null)
 Load either the current, or a specified, revision that's attached to a given page ID.
static newFromRow ($row)
static newFromTitle ($title, $id=0, $flags=null)
 Load either the current, or a specified, revision that's attached to a given title.
static newNullRevision ($dbw, $pageId, $summary, $minor)
 Create a new null-revision for insertion into a page's history.
static pageJoinCond ()
 Return the value of a select() page conds array for the paeg table.
static selectFields ()
 Return the list of revision fields that should be selected to create a new revision.
static selectPageFields ()
 Return the list of page fields that should be selected from page table.
static selectTextFields ()
 Return the list of text fields that should be selected to read the revision text.
static selectUserFields ()
 Return the list of user fields that should be selected from user table.
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.
static userJoinCond ()
 Return the value of a select() JOIN conds array for the user table.
static userWasLastToEdit ($db, $pageId, $userId, $since)
 Check if no edits were made by other users since the time a user started editing the page.

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

Protected Member Functions

 loadText ()
 Lazy-load the revision's text.

Protected Attributes

 $mComment
 $mCurrent
 $mDeleted
 $mId
 $mMinorEdit
 $mOrigUserText
 $mPage
 $mParentId
 $mSha1
 $mSize
 $mText
 $mTextRow
 $mTimestamp
 $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.

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.
static loadFromConds ($db, $conditions, $flags=0)
 Given a set of conditions, fetch a revision from the given database connection.
static newFromConds ($conditions, $flags=0)
 Given a set of conditions, fetch a revision.

Detailed Description

Todo:
document

Definition at line 26 of file Revision.php.


Constructor & Destructor Documentation

Constructor.

Parameters:
$rowMixed: either a database row or an array
Access:
private

Definition at line 441 of file Revision.php.

References $wgUser, base36Sha1(), newFromRow(), and wfTimestampNow().


Member Function Documentation

static Revision::base36Sha1 ( text) [static]

Get the base 36 SHA-1 value for a string of text.

Parameters:
$textString
Returns:
String

Definition at line 1083 of file Revision.php.

References wfBaseConvert().

Referenced by __construct(), insertOn(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), and PopulateRevisionSha1\upgradeRow().

static Revision::compressRevisionText ( &$  text) [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.

Parameters:
$textMixed: reference to a text
Returns:
String

Definition at line 983 of file Revision.php.

References wfDebug().

Referenced by CheckStorage\importRevision(), insertOn(), RevisionTest\testCompressRevisionTextUtf8(), and RevisionTest\testCompressRevisionTextUtf8Gzip().

static Revision::countByPageId ( db,
id 
) [static]

Get count of revisions per page...not very efficient.

Parameters:
$dbDatabaseBase
$idInteger: page id
Returns:
Integer

Definition at line 1270 of file Revision.php.

Referenced by countByTitle().

static Revision::countByTitle ( db,
title 
) [static]

Get count of revisions per page...not very efficient.

Parameters:
$dbDatabaseBase
$titleTitle
Returns:
Integer

Definition at line 1286 of file Revision.php.

References $title, and countByPageId().

static Revision::fetchFromConds ( db,
conditions,
flags = 0 
) [static, private]

Given a set of conditions, return a ResultWrapper which will return matching database rows with the fields necessary to build Revision objects.

Parameters:
$dbDatabaseBase
$conditionsArray
$flagsinteger (optional)
Returns:
ResultWrapper

Definition at line 315 of file Revision.php.

References $options.

Referenced by fetchRevision(), and loadFromConds().

static Revision::fetchRevision ( title) [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.

Parameters:
$titleTitle
Returns:
ResultWrapper

Definition at line 296 of file Revision.php.

References $title, 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.

Parameters:
$audienceInteger: 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
$userUser object to check for, only if FOR_THIS_USER is passed to the $audience parameter
Returns:
String

Definition at line 716 of file Revision.php.

References $user, isDeleted(), and userCan().

Referenced by Linker\revComment().

Get revision ID.

Returns:
Integer|null

Definition at line 537 of file Revision.php.

Referenced by RevisionStorageTest\assertRevEquals(), getNext(), getPrevious(), isUnpatrolled(), and RefreshLinksJob\runForTitleInternal().

Get next revision for this title.

Returns:
Revision or null

Definition at line 862 of file Revision.php.

References getId(), getTitle(), and newFromTitle().

Get the page ID.

Returns:
Integer|null

Definition at line 627 of file Revision.php.

Referenced by RevisionStorageTest\assertRevEquals().

Get parent revision ID (the original previous page revision)

Returns:
Integer|null

Definition at line 565 of file Revision.php.

static Revision::getParentLengths ( db,
array $  revIds 
) [static]

Do a batched query to get the parent revision lengths.

Parameters:
$dbDatabaseBase
$revIdsArray
Returns:
array

Definition at line 418 of file Revision.php.

References $res, wfProfileIn(), and wfProfileOut().

Referenced by HistoryPager\doBatchLookups(), ContribsPager\doBatchLookups(), and ApiQueryContributions\execute().

Get previous revision for this title.

Returns:
Revision or null

Definition at line 847 of file Revision.php.

References getId(), getTitle(), and newFromTitle().

Revision::getPreviousRevisionId ( db) [private]

Get previous revision Id for this page_id This is used to populate rev_parent_id on save.

Parameters:
$dbDatabaseBase
Returns:
Integer

Definition at line 879 of file Revision.php.

Referenced by insertOn().

Fetch revision comment without regard for the current user's permissions.

Returns:
String

Definition at line 731 of file Revision.php.

Referenced by Linker\revComment().

Fetch revision text without regard for view restrictions.

Returns:
String

Definition at line 820 of file Revision.php.

References loadText().

Referenced by getText().

Fetch revision's user id without regard for the current user's permissions.

Returns:
String

Definition at line 659 of file Revision.php.

Fetch revision's username without regard for view restrictions.

Returns:
String

Definition at line 691 of file Revision.php.

References User\whoIs().

Referenced by getUserText(), and isUnpatrolled().

static Revision::getRevisionText ( row,
prefix = 'old_' 
) [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.

Parameters:
$rowObject: the text data
$prefixString: table prefix (default 'old_')
Returns:
String: text the text requested or false on failure

Definition at line 906 of file Revision.php.

References $url, $wgContLang, ExternalStore\fetchFromURL(), wfProfileIn(), and wfProfileOut().

Referenced by CompressOld\compressWithConcat(), FetchText\doGetText(), RecompressTracked\doOrphanList(), RecompressTracked\doPage(), ApiQueryDeletedrevs\execute(), loadText(), newFromArchiveRow(), RevisionTest\testCompressRevisionTextUtf8(), RevisionTest\testCompressRevisionTextUtf8Gzip(), RevisionTest\testGetRevisionText(), RevisionTest\testGetRevisionTextGzip(), RevisionTest\testGetRevisionTextUtf8Legacy(), RevisionTest\testGetRevisionTextUtf8LegacyGzip(), RevisionTest\testGetRevisionTextUtf8Native(), and RevisionTest\testGetRevisionTextUtf8NativeGzip().

Returns the base36 sha1 of the text in this revision, or null if unknown.

Returns:
String|null

Definition at line 583 of file Revision.php.

Referenced by RevisionStorageTest\assertRevEquals().

Returns the length of the text in this revision, or null if unknown.

Returns:
Integer|null

Definition at line 574 of file Revision.php.

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.

Parameters:
$audienceInteger: 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
$userUser object to check for, only if FOR_THIS_USER is passed to the $audience parameter
Returns:
String

Definition at line 794 of file Revision.php.

References $user, getRawText(), isDeleted(), and userCan().

Referenced by revText(), and RefreshLinksJob\runForTitleInternal().

Get text row ID.

Returns:
Integer|null

Definition at line 556 of file Revision.php.

Referenced by loadText().

Returns:
String

Definition at line 831 of file Revision.php.

References wfTimestamp().

Referenced by RevisionStorageTest\assertRevEquals().

static Revision::getTimestampFromId ( title,
id 
) [static]

Get rev_timestamp from rev_id, without loading the rest of the row.

Parameters:
$titleTitle
$idInteger
Returns:
String

Definition at line 1246 of file Revision.php.

References $dbr, $title, wfGetDB(), wfGetLB(), and wfTimestamp().

Referenced by ApiSetNotificationTimestamp\execute(), and Skin\lastModified().

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.

Returns:
Title|null

Definition at line 594 of file Revision.php.

References $dbr, newFromRow(), and wfGetDB().

Referenced by getNext(), getPrevious(), and Linker\revComment().

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.

Parameters:
$audienceInteger: 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
$userUser object to check for, only if FOR_THIS_USER is passed to the $audience parameter
Returns:
Integer

Definition at line 644 of file Revision.php.

References $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.

Parameters:
$audienceInteger: 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
$userUser object to check for, only if FOR_THIS_USER is passed to the $audience parameter
Returns:
string

Definition at line 676 of file Revision.php.

References $user, getRawUserText(), isDeleted(), and userCan().

Get the deletion bitfield of the revision.

Returns:
int

Definition at line 777 of file Revision.php.

Revision::insertOn ( dbw)

Insert a new revision into the database, returning the new revision ID number on success and dies horribly on failure.

Parameters:
$dbwDatabaseBase: (master connection)
Returns:
Integer

Definition at line 1009 of file Revision.php.

References base36Sha1(), compressRevisionText(), getPreviousRevisionId(), ExternalStore\insertToDefault(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Returns:
Boolean

Definition at line 838 of file Revision.php.

Revision::isDeleted ( field)
Parameters:
$fieldint one of DELETED_* bitfield constants
Returns:
Boolean

Definition at line 768 of file Revision.php.

Referenced by getComment(), getText(), getUser(), getUserText(), and Linker\revComment().

Returns:
Boolean

Definition at line 738 of file Revision.php.

Returns:
Integer rcid of the unpatrolled row, zero if there isn't one

Definition at line 745 of file Revision.php.

References $dbr, getId(), getRawUserText(), and wfGetDB().

static Revision::loadFromConds ( db,
conditions,
flags = 0 
) [static, private]

Given a set of conditions, fetch a revision from the given database connection.

Parameters:
$dbDatabaseBase
$conditionsArray
$flagsinteger (optional)
Returns:
Revision or null

Definition at line 275 of file Revision.php.

References $res, and fetchFromConds().

Referenced by loadFromId(), loadFromPageId(), loadFromTimestamp(), loadFromTitle(), and newFromConds().

static Revision::loadFromId ( db,
id 
) [static]

Load a page revision from a given revision ID number.

Returns null if no such revision can be found.

Parameters:
$dbDatabaseBase
$idInteger
Returns:
Revision or null

Definition at line 182 of file Revision.php.

References loadFromConds().

static Revision::loadFromPageId ( db,
pageid,
id = 0 
) [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.

Parameters:
$dbDatabaseBase
$pageidInteger
$idInteger
Returns:
Revision or null

Definition at line 196 of file Revision.php.

References loadFromConds().

static Revision::loadFromTimestamp ( db,
title,
timestamp 
) [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.

Parameters:
$dbDatabaseBase
$titleTitle
$timestampString
Returns:
Revision or null

Definition at line 239 of file Revision.php.

References $title, and loadFromConds().

Referenced by AttachLatest\execute(), EditPage\getBaseRevision(), and User\getNewMessageLinks().

static Revision::loadFromTitle ( db,
title,
id = 0 
) [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.

Parameters:
$dbDatabaseBase
$titleTitle
$idInteger
Returns:
Revision or null

Definition at line 216 of file Revision.php.

References $title, and loadFromConds().

Revision::loadText ( ) [protected]

Lazy-load the revision's text.

Currently hardcoded to the 'text' table storage engine.

Returns:
String

Definition at line 1093 of file Revision.php.

References $dbr, $wgMemc, getRevisionText(), getTextId(), wfDebug(), wfGetDB(), wfGetLB(), wfMemcKey(), wfProfileIn(), and wfProfileOut().

Referenced by getRawText().

static Revision::newFromArchiveRow ( row,
overrides = array() 
) [static]

Make a fake revision object from an archive table row.

This is queried for permissions or even inserted (as in Special:Undelete)

Todo:
FIXME: Should be a subclass for RevisionDelete. [TS]
Parameters:
$row
$overridesarray
Returns:
Revision

Definition at line 140 of file Revision.php.

References getRevisionText().

Referenced by RevDel_ArchiveItem\__construct(), RevDel_ArchivedRevisionItem\__construct(), RevisionStorageTest\testNewFromArchiveRow(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), and PopulateRevisionSha1\upgradeRow().

static Revision::newFromConds ( conditions,
flags = 0 
) [static, private]

Given a set of conditions, fetch a revision.

Parameters:
$conditionsArray
$flagsinteger (optional)
Returns:
Revision or null

Definition at line 254 of file Revision.php.

References loadFromConds(), wfGetDB(), and wfGetLB().

Referenced by newFromId(), newFromPageId(), and newFromTitle().

static Revision::newFromId ( id,
flags = 0 
) [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

Parameters:
$idInteger
$flagsInteger (optional)
Returns:
Revision or null

Definition at line 68 of file Revision.php.

References newFromConds().

Referenced by SpecialComparePages\checkExistingRevision(), Orphans\checkSeparation(), CheckBadRedirects\execute(), SpecialRevisionDelete\execute(), SpecialNewpages\feedItemDesc(), FeedUtils\formatDiffRow(), RevisionStorageTest\testGetPage(), RevisionStorageTest\testGetRawText(), RevisionStorageTest\testGetText(), RevisionStorageTest\testIsCurrent(), RevisionStorageTest\testNewFromId(), and RevisionStorageTest\testRevText().

static Revision::newFromPageId ( pageId,
revId = 0,
flags = null 
) [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 Revision::READ_LOCKING : Select & lock the data from the master

Parameters:
$revIdInteger
$pageIdInteger (optional)
$flagsInteger Bitfield (optional)
Returns:
Revision or null

Definition at line 117 of file Revision.php.

References newFromConds(), and IDBAccessObject\READ_LATEST.

static Revision::newFromRow ( row) [static]
Since:
1.19
Parameters:
$row
Returns:
Revision

Definition at line 170 of file Revision.php.

Referenced by __construct(), ApiFeedContributions\feedItem(), getTitle(), and RevisionStorageTest\testNewFromRow().

static Revision::newFromTitle ( title,
id = 0,
flags = null 
) [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

Parameters:
$titleTitle
$idInteger (optional)
$flagsInteger Bitfield (optional)
Returns:
Revision or null

Definition at line 86 of file Revision.php.

References $title, newFromConds(), and IDBAccessObject\READ_LATEST.

Referenced by CleanupSpam\cleanupArticle(), Title\countAuthorsBetween(), Title\countRevisionsBetween(), ApiEditPage\execute(), GetTextMaint\execute(), ResourceLoaderWikiModule\getContent(), Skin\getNewtalks(), getNext(), getPrevious(), RawAction\getRawText(), Title\isValidMoveTarget(), CoreParserFunctions\pagesize(), RefreshLinksJob\run(), DoubleRedirectJob\run(), RefreshLinksJob2\run(), SpecialBookSources\showList(), and UploadFromUrlTest\testLeaveMessage().

static Revision::newNullRevision ( dbw,
pageId,
summary,
minor 
) [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.

Parameters:
$dbwDatabaseBase
$pageIdInteger: ID number of the page to read from
$summaryString: revision's summary
$minorBoolean: whether the revision should be considered as minor
Returns:
Revision|null on error

Definition at line 1161 of file Revision.php.

References Title\makeTitle(), wfProfileIn(), and wfProfileOut().

Referenced by Title\moveToInternal(), ImportReporter\reportPage(), and RevisionStorageTest\testNewNullRevision().

static Revision::pageJoinCond ( ) [static]

Return the value of a select() page conds array for the paeg table.

This will assure that the revision(s) are not orphaned from live pages.

Since:
1.19
Returns:
Array

Definition at line 351 of file Revision.php.

Referenced by RevDel_RevisionList\doQuery(), MergeHistoryPager\getQueryInfo(), ContribsPager\getQueryInfo(), and RevisionList\getType().

Alias for getText(Revision::FOR_THIS_USER)

Deprecated:
since 1.17
Returns:
String

Definition at line 810 of file Revision.php.

References getText(), and wfDeprecated().

static Revision::selectPageFields ( ) [static]

Return the list of page fields that should be selected from page table.

Returns:
array

Definition at line 393 of file Revision.php.

Referenced by ApiQueryRevisions\execute().

static Revision::selectTextFields ( ) [static]

Return the list of text fields that should be selected to read the revision text.

Returns:
array

Definition at line 382 of file Revision.php.

Referenced by ApiQueryRevisions\execute().

static Revision::selectUserFields ( ) [static]

Return the list of user fields that should be selected from user table.

Returns:
array

Definition at line 408 of file Revision.php.

Referenced by RevDel_RevisionList\doQuery(), ApiQueryRevisions\execute(), HistoryPager\getQueryInfo(), MergeHistoryPager\getQueryInfo(), ContribsPager\getQueryInfo(), and RevisionList\getType().

Revision::setId ( id)

Set the revision ID.

Since:
1.19
Parameters:
$idInteger

Definition at line 547 of file Revision.php.

Revision::setTitle ( title)

Set the title of the revision.

Parameters:
$titleTitle

Definition at line 618 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.

Parameters:
$fieldInteger:one of self::DELETED_TEXT, self::DELETED_COMMENT, self::DELETED_USER
$userUser object to check, or null to use $wgUser
Returns:
Boolean

Definition at line 1203 of file Revision.php.

References $user, and userCanBitfield().

Referenced by getComment(), getText(), getUser(), getUserText(), and Linker\revComment().

static Revision::userCanBitfield ( bitfield,
field,
User user = null 
) [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.

Parameters:
$bitfieldInteger: current field
$fieldInteger: one of self::DELETED_TEXT = File::DELETED_FILE, self::DELETED_COMMENT = File::DELETED_COMMENT, self::DELETED_USER = File::DELETED_USER
$userUser object to check, or null to use $wgUser
Returns:
Boolean

Definition at line 1219 of file Revision.php.

References $user, $wgUser, and wfDebug().

Referenced by OldLocalFile\userCan(), and userCan().

static Revision::userJoinCond ( ) [static]

Return the value of a select() JOIN conds array for the user table.

This will get user table rows for logged-in users.

Since:
1.19
Returns:
Array

Definition at line 341 of file Revision.php.

Referenced by RevDel_RevisionList\doQuery(), ApiQueryRevisions\execute(), HistoryPager\getQueryInfo(), MergeHistoryPager\getQueryInfo(), ContribsPager\getQueryInfo(), and RevisionList\getType().

static Revision::userWasLastToEdit ( db,
pageId,
userId,
since 
) [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.

Since:
1.20
Parameters:
DatabaseBase | int$dbthe Database to perform the check on. May be given as a Database object or a database identifier usable with wfGetDB.
int$pageIdthe ID of the page in question
int$userIdthe ID of the user in question
string$sincelook at edits since this time
Returns:
bool True if the given user was the only one to edit since the given timestamp

Definition at line 1309 of file Revision.php.

References $res, and wfGetDB().

Referenced by RevisionStorageTest\testUserWasLastToEdit().


Member Data Documentation

Revision::$mComment [protected]

Definition at line 38 of file Revision.php.

Revision::$mCurrent [protected]

Definition at line 42 of file Revision.php.

Revision::$mDeleted [protected]

Definition at line 34 of file Revision.php.

Revision::$mId [protected]

Definition at line 27 of file Revision.php.

Revision::$mMinorEdit [protected]

Definition at line 32 of file Revision.php.

Revision::$mOrigUserText [protected]

Definition at line 30 of file Revision.php.

Revision::$mPage [protected]

Definition at line 28 of file Revision.php.

Revision::$mParentId [protected]

Definition at line 37 of file Revision.php.

Revision::$mSha1 [protected]

Definition at line 36 of file Revision.php.

Revision::$mSize [protected]

Definition at line 35 of file Revision.php.

Revision::$mText [protected]

Definition at line 39 of file Revision.php.

Revision::$mTextRow [protected]

Definition at line 40 of file Revision.php.

Revision::$mTimestamp [protected]

Definition at line 33 of file Revision.php.

Revision::$mTitle [protected]

Definition at line 41 of file Revision.php.

Revision::$mUser [protected]

Definition at line 31 of file Revision.php.

Revision::$mUserText [protected]

Definition at line 29 of file Revision.php.

Definition at line 52 of file Revision.php.

Referenced by GetTextMaint\execute().

const Revision::RAW = 3

Definition at line 54 of file Revision.php.

Referenced by GetTextMaint\execute().


The documentation for this class was generated from the following file: