MediaWiki  REL1_24
RecentChange Class Reference

Utility class for creating new RC entries. More...

Inheritance diagram for RecentChange:
Collaboration diagram for RecentChange:

List of all members.

Public Member Functions

 diffLinkTrail ($forceCur)
 Gets the end part of the diff URL associated with this object Blank if no diff link should be displayed.
 doMarkPatrolled (User $user, $auto=false)
 Mark this RecentChange as patrolled.
 getAttribute ($name)
 Get an attribute value.
 getAttributes ()
 getCharacterDifference ($old=0, $new=0)
 Returns the change size (HTML).
 getPerformer ()
 Get the User object of the person who performed this change.
getTitle ()
 loadFromRow ($row)
 Initialises the members of this object from a mysql row object.
 notifyRCFeeds (array $feeds=null)
 Notify all the feeds about the change.
 reallyMarkPatrolled ()
 Mark this RecentChange patrolled, without error checking.
 save ($noudp=false)
 Writes the data in this object to the database.
 setAttribs ($attribs)
 setExtra ($extra)

Static Public Member Functions

static getEngine ($uri)
 Gets the stream engine object for a given URI from $wgRCEngines.
static isInRCLifespan ($timestamp, $tolerance=0)
 Check whether the given timestamp is new enough to have a RC row with a given tolerance as the recentchanges table might not be cleared out regularly (so older entries might exist) or rows which will be deleted soon shouldn't be included.
static markPatrolled ($change, $auto=false)
 Mark a given change as patrolled.
static newFromConds ($conds, $fname=__METHOD__, $options=array())
 Find the first recent change matching some specific conditions.
static newFromId ($rcid)
 Obtain the recent change with a given rc_id value.
static newFromRow ($row)
static newLogEntry ($timestamp, &$title, &$user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC= '')
static notifyEdit ($timestamp, &$title, $minor, &$user, $comment, $oldId, $lastTimestamp, $bot, $ip= '', $oldSize=0, $newSize=0, $newId=0, $patrol=0)
 Makes an entry in the database corresponding to an edit.
static notifyLog ($timestamp, &$title, &$user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC= '')
static notifyNew ($timestamp, &$title, $minor, &$user, $comment, $bot, $ip= '', $size=0, $newId=0, $patrol=0)
 Makes an entry in the database corresponding to page creation Note: the title object must be loaded with the new id using resetArticleID()
static parseFromRCType ($rcType)
 Parsing RC_* constants to human-readable test.
static parseToRCType ($type)
 Parsing text to RC_* constants.
static purgeExpiredChanges ()
 Purge expired changes from the recentchanges table.
static selectFields ()
 Return the list of recentchanges fields that should be selected to create a new recentchanges object.

Public Attributes

int $counter = -1
 Line number of recent change.
 $mAttribs = array()
 $mExtra = array()
Title $mTitle = false
 $notificationtimestamp
 $numberofWatchingusers = 0
const SRC_EDIT = 'mw.edit'
const SRC_EXTERNAL = 'mw.external'
const SRC_LOG = 'mw.log'
const SRC_NEW = 'mw.new'

Static Private Member Functions

static checkIPAddress ($ip)

Private Attributes

User $mPerformer = false

Detailed Description

Utility class for creating new RC entries.

mAttribs: rc_id id of the row in the recentchanges table rc_timestamp time the entry was made rc_namespace namespace # rc_title non-prefixed db key rc_type is new entry, used to determine whether updating is necessary rc_source string representation of change source rc_minor is minor rc_cur_id page_id of associated page entry rc_user user id who made the entry rc_user_text user name who made the entry rc_comment edit summary rc_this_oldid rev_id associated with this entry (or zero) rc_last_oldid rev_id associated with the entry before this one (or zero) rc_bot is bot, hidden rc_ip IP address of the user in dotted quad notation rc_new obsolete, use rc_type==RC_NEW rc_patrolled boolean whether or not someone has marked this edit as patrolled rc_old_len integer byte length of the text before the edit rc_new_len the same after the edit rc_deleted partial deletion rc_logid the log_id value for this log entry (or zero) rc_log_type the log type (or null) rc_log_action the log action (or null) rc_params log params

mExtra: prefixedDBkey prefixed db key, used by external app via msg queue lastTimestamp timestamp of previous entry, used in WHERE clause during update oldSize text size before the change newSize text size after the change pageStatus status of the page: created, deleted, moved, restored, changed

temporary: not stored in the database notificationtimestamp numberofWatchingusers

Definition at line 63 of file RecentChange.php.


Member Function Documentation

static RecentChange::checkIPAddress ( ip) [static, private]

Definition at line 819 of file RecentChange.php.

RecentChange::diffLinkTrail ( forceCur)

Gets the end part of the diff URL associated with this object Blank if no diff link should be displayed.

Parameters:
bool$forceCur
Returns:
string

Definition at line 759 of file RecentChange.php.

RecentChange::doMarkPatrolled ( User user,
auto = false 
)

Mark this RecentChange as patrolled.

NOTE: Can also return 'rcpatroldisabled', 'hookaborted' and 'markedaspatrollederror-noautopatrol' as errors

Parameters:
User$userUser object doing the action
bool$autoFor automatic patrol
Returns:
array Array of permissions errors, see Title::getUserPermissionsErrors()

Definition at line 434 of file RecentChange.php.

Get an attribute value.

Parameters:
string$nameAttribute name
Returns:
mixed

Definition at line 742 of file RecentChange.php.

Referenced by MachineReadableRCFeedFormatter\getLine().

Returns:
array

Definition at line 749 of file RecentChange.php.

Referenced by IRCColourfulRCFeedFormatter\getLine().

RecentChange::getCharacterDifference ( old = 0,
new = 0 
)

Returns the change size (HTML).

The lengths can be given optionally.

Parameters:
int$old
int$new
Returns:
string

Definition at line 782 of file RecentChange.php.

static RecentChange::getEngine ( uri) [static]

Gets the stream engine object for a given URI from $wgRCEngines.

Parameters:
string$uriURI to get the engine object for
Exceptions:
MWException
Returns:
RCFeedEngine The engine object

Definition at line 389 of file RecentChange.php.

Get the User object of the person who performed this change.

Returns:
User

Definition at line 254 of file RecentChange.php.

static RecentChange::isInRCLifespan ( timestamp,
tolerance = 0 
) [static]

Check whether the given timestamp is new enough to have a RC row with a given tolerance as the recentchanges table might not be cleared out regularly (so older entries might exist) or rows which will be deleted soon shouldn't be included.

Parameters:
mixed$timestampMWTimestamp compatible timestamp
int$toleranceTolerance in seconds
Returns:
bool

Definition at line 845 of file RecentChange.php.

Initialises the members of this object from a mysql row object.

Parameters:
mixed$row

Definition at line 730 of file RecentChange.php.

static RecentChange::markPatrolled ( change,
auto = false 
) [static]

Mark a given change as patrolled.

Parameters:
RecentChange | int$changeRecentChange or corresponding rc_id
bool$autoFor automatic patrol
Returns:
array See doMarkPatrolled(), or null if $change is not an existing rc_id

Definition at line 411 of file RecentChange.php.

static RecentChange::newFromConds ( conds,
fname = __METHOD__,
options = array() 
) [static]

Find the first recent change matching some specific conditions.

Parameters:
array$condsArray of conditions
mixed$fnameOverride the method name in profiling/logs
array$optionsQuery options
Returns:
RecentChange

Definition at line 178 of file RecentChange.php.

static RecentChange::newFromId ( rcid) [static]

Obtain the recent change with a given rc_id value.

Parameters:
int$rcidThe rc_id value to retrieve
Returns:
RecentChange

Definition at line 166 of file RecentChange.php.

Referenced by MarkpatrolledAction\onView(), and PatrolLog\record().

static RecentChange::newFromRow ( row) [static]
static RecentChange::newLogEntry ( timestamp,
&$  title,
&$  user,
actionComment,
ip,
type,
action,
target,
logComment,
params,
newId = 0,
actionCommentIRC = '' 
) [static]
Parameters:
string$timestamp
Title$title
User$user
string$actionComment
string$ip
string$type
string$action
Title$target
string$logComment
string$params
int$newId
string$actionCommentIRC
Returns:
RecentChange

Definition at line 660 of file RecentChange.php.

static RecentChange::notifyEdit ( timestamp,
&$  title,
minor,
&$  user,
comment,
oldId,
lastTimestamp,
bot,
ip = '',
oldSize = 0,
newSize = 0,
newId = 0,
patrol = 0 
) [static]

Makes an entry in the database corresponding to an edit.

Parameters:
string$timestamp
Title$title
bool$minor
User$user
string$comment
int$oldId
string$lastTimestamp
bool$bot
string$ip
int$oldSize
int$newSize
int$newId
int$patrol
Returns:
RecentChange

Definition at line 512 of file RecentChange.php.

static RecentChange::notifyLog ( timestamp,
&$  title,
&$  user,
actionComment,
ip,
type,
action,
target,
logComment,
params,
newId = 0,
actionCommentIRC = '' 
) [static]
Parameters:
string$timestamp
Title$title
User$user
string$actionComment
string$ip
string$type
string$action
Title$target
string$logComment
string$params
int$newId
string$actionCommentIRC
Returns:
bool

Definition at line 629 of file RecentChange.php.

static RecentChange::notifyNew ( timestamp,
&$  title,
minor,
&$  user,
comment,
bot,
ip = '',
size = 0,
newId = 0,
patrol = 0 
) [static]

Makes an entry in the database corresponding to page creation Note: the title object must be loaded with the new id using resetArticleID()

Parameters:
string$timestamp
Title$title
bool$minor
User$user
string$comment
bool$bot
string$ip
int$size
int$newId
int$patrol
Returns:
RecentChange

Definition at line 571 of file RecentChange.php.

RecentChange::notifyRCFeeds ( array feeds = null)

Notify all the feeds about the change.

Parameters:
array$feedsOptional feeds to send to, defaults to $wgRCFeeds

Definition at line 338 of file RecentChange.php.

static RecentChange::parseFromRCType ( rcType) [static]

Parsing RC_* constants to human-readable test.

Since:
1.24
Parameters:
int$rcType
Returns:
string $type

Definition at line 139 of file RecentChange.php.

Referenced by ApiQueryWatchlist\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), and MachineReadableRCFeedFormatter\getLine().

static RecentChange::parseToRCType ( type) [static]

Parsing text to RC_* constants.

Since:
1.24
Parameters:
string | array$type
Exceptions:
MWException
Returns:
int|array RC_TYPE

Definition at line 109 of file RecentChange.php.

Referenced by ApiQueryWatchlist\run(), and ApiQueryRecentChanges\run().

static RecentChange::purgeExpiredChanges ( ) [static]

Purge expired changes from the recentchanges table.

Since:
1.22

Definition at line 800 of file RecentChange.php.

Mark this RecentChange patrolled, without error checking.

Returns:
int Number of affected rows

Definition at line 475 of file RecentChange.php.

RecentChange::save ( noudp = false)

Writes the data in this object to the database.

Parameters:
bool$noudp

Definition at line 270 of file RecentChange.php.

static RecentChange::selectFields ( ) [static]

Return the list of recentchanges fields that should be selected to create a new recentchanges object.

Returns:
array

Definition at line 193 of file RecentChange.php.

Referenced by SpecialRecentChangesLinked\doMainQuery(), SpecialRecentChanges\doMainQuery(), and SpecialWatchlist\doMainQuery().

RecentChange::setAttribs ( attribs)
Parameters:
array$attribs

Definition at line 227 of file RecentChange.php.

RecentChange::setExtra ( extra)
Parameters:
array$extra

Definition at line 234 of file RecentChange.php.


Member Data Documentation

int RecentChange::$counter = -1

Line number of recent change.

Default -1.

Definition at line 87 of file RecentChange.php.

RecentChange::$mAttribs = array()

Definition at line 71 of file RecentChange.php.

RecentChange::$mExtra = array()

Definition at line 72 of file RecentChange.php.

User RecentChange::$mPerformer = false [private]

Definition at line 80 of file RecentChange.php.

Title RecentChange::$mTitle = false

Definition at line 76 of file RecentChange.php.

RecentChange::$notificationtimestamp

Definition at line 83 of file RecentChange.php.

RecentChange::$numberofWatchingusers = 0

Definition at line 82 of file RecentChange.php.

const RecentChange::SRC_EXTERNAL = 'mw.external'

Definition at line 69 of file RecentChange.php.

Referenced by PopulateRecentChangesSource\buildUpdateCondition().


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