RecentChange Class Reference

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_cur_time timestamp on the cur row rc_namespace namespace # rc_title non-prefixed db key rc_type is new entry, used to determine whether updating is necessary 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. More...

Inherited by RCCacheEntry.

List of all members.

Public Member Functions

 setAttribs ($attribs)
 setExtra ($extra)
getTitle ()
 getMovedToTitle ()
 save ()
 notifyRC2UDP ()
 doMarkPatrolled ($auto=false)
 Mark this RecentChange as patrolled.
 reallyMarkPatrolled ()
 Mark this RecentChange patrolled, without error checking.
 loadFromRow ($row)
 loadFromCurRow ($row)
 getAttribute ($name)
 Get an attribute value.
 diffLinkTrail ($forceCur)
 Gets the end part of the diff URL associated with this object Blank if no diff link should be displayed.
 getIRCLine ()
 getCharacterDifference ($old=0, $new=0)
 Returns the change size (HTML).

Static Public Member Functions

static newFromRow ($row)
static newFromCurRow ($row)
static newFromId ($rcid)
 Obtain the recent change with a given rc_id value.
static newFromConds ($conds, $fname=false)
 Find the first recent change matching some specific conditions.
static sendToUDP ($line, $address= '', $prefix= '')
 Send some text to UDP.
static cleanupForIRC ($text)
 Remove newlines, carriage returns and decode html entites.
static markPatrolled ($change, $auto=false)
 Mark a given change as patrolled.
static notifyEdit ($timestamp, &$title, $minor, &$user, $comment, $oldId, $lastTimestamp, $bot, $ip='', $oldSize=0, $newSize=0, $newId=0, $patrol=0)
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 notifyMove ($timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir=false)
static notifyMoveToNew ($timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='')
static notifyMoveOverRedirect ($timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='')
static notifyLog ($timestamp, &$title, &$user, $actionComment, $ip='', $type, $action, $target, $logComment, $params, $newId=0)
static newLogEntry ($timestamp, &$title, &$user, $actionComment, $ip='', $type, $action, $target, $logComment, $params, $newId=0)

Public Attributes

 $mAttribs = array()
 $mExtra = array()
 $mTitle = false
 $mMovedToTitle = false
 $numberofWatchingusers = 0


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_cur_time timestamp on the cur row rc_namespace namespace # rc_title non-prefixed db key rc_type is new entry, used to determine whether updating is necessary 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 lang the interwiki prefix, automatically set in save() oldSize text size before the change newSize text size after the change

temporary: not stored in the database notificationtimestamp numberofWatchingusers

Todo:
document functions and variables

Definition at line 44 of file RecentChange.php.


Member Function Documentation

static RecentChange::cleanupForIRC ( text  )  [static]

Remove newlines, carriage returns and decode html entites.

Parameters:
string $line
Returns:
string

Definition at line 242 of file RecentChange.php.

References $text, and Sanitizer::decodeCharReferences().

Referenced by getIRCLine().

RecentChange::diffLinkTrail ( forceCur  ) 

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

Definition at line 589 of file RecentChange.php.

RecentChange::doMarkPatrolled ( auto = false  ) 

Mark this RecentChange as patrolled.

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

Parameters:
bool $auto for automatic patrol
Returns:
array of permissions errors, see Title::getUserPermissionsErrors()

Definition at line 270 of file RecentChange.php.

References $wgUseNPPatrol, $wgUser, $wgUseRCPatrol, getAttribute(), getTitle(), reallyMarkPatrolled(), PatrolLog::record(), and wfRunHooks().

RecentChange::getAttribute ( name  ) 

Get an attribute value.

Parameters:
$name Attribute name
Returns:
mixed

Definition at line 581 of file RecentChange.php.

References $name.

Referenced by doMarkPatrolled(), and reallyMarkPatrolled().

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

Returns the change size (HTML).

The lengths can be given optionally.

Definition at line 690 of file RecentChange.php.

References ChangesList::showCharacterDifference().

RecentChange::getIRCLine (  ) 

RecentChange::getMovedToTitle (  ) 

Definition at line 126 of file RecentChange.php.

References Title::makeTitle().

& RecentChange::getTitle (  ) 

Definition at line 119 of file RecentChange.php.

References Title::makeTitle().

Referenced by doMarkPatrolled(), and getIRCLine().

RecentChange::loadFromCurRow ( row  ) 

Definition at line 544 of file RecentChange.php.

References $row, obsolete, and wfTimestamp().

RecentChange::loadFromRow ( row  ) 

Definition at line 537 of file RecentChange.php.

References $row, and wfTimestamp().

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

Mark a given change as patrolled.

Parameters:
mixed $change RecentChange or corresponding rc_id
bool $auto for automatic patrol
Returns:
See doMarkPatrolled(), or null if $change is not an existing rc_id

Definition at line 253 of file RecentChange.php.

References newFromId().

Referenced by ApiPatrol::execute().

static RecentChange::newFromConds ( conds,
fname = false 
) [static]

Find the first recent change matching some specific conditions.

Parameters:
array $conds Array of conditions
mixed $fname Override the method name in profiling/logs
Returns:
RecentChange

Definition at line 91 of file RecentChange.php.

References $conds, $dbr, $fname, $res, $row, newFromRow(), and wfGetDB().

Referenced by DifferenceEngine::showDiffPage().

static RecentChange::newFromCurRow ( row  )  [static]

Definition at line 58 of file RecentChange.php.

References $row.

static RecentChange::newFromId ( rcid  )  [static]

Obtain the recent change with a given rc_id value.

Parameters:
$rcid rc_id value to retrieve
Returns:
RecentChange

Definition at line 72 of file RecentChange.php.

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

Referenced by markPatrolled(), Article::markpatrolled(), PatrolLog::record(), and DifferenceEngine::showDiffPage().

static RecentChange::newFromRow ( row  )  [static]

static RecentChange::newLogEntry ( timestamp,
&$  title,
&$  user,
actionComment,
ip = '',
type,
action,
target,
logComment,
params,
newId = 0 
) [static]

Definition at line 491 of file RecentChange.php.

References $action, $title, $type, $user, $wgRequest, obsolete, and wfGetIP().

Referenced by notifyLog(), and LogPage::saveContent().

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

Definition at line 324 of file RecentChange.php.

References $bot, $minor, $title, $user, obsolete, and wfGetIP().

Referenced by Article::doEdit().

static RecentChange::notifyLog ( timestamp,
&$  title,
&$  user,
actionComment,
ip = '',
type,
action,
target,
logComment,
params,
newId = 0 
) [static]

Definition at line 477 of file RecentChange.php.

References $action, $title, $type, $user, $wgLogRestrictions, and newLogEntry().

Referenced by LogPage::saveContent().

static RecentChange::notifyMove ( timestamp,
&$  oldTitle,
&$  newTitle,
&$  user,
comment,
ip = '',
overRedir = false 
) [static]

Definition at line 424 of file RecentChange.php.

References $user, $wgRequest, obsolete, and wfGetIP().

Referenced by notifyMoveOverRedirect(), and notifyMoveToNew().

static RecentChange::notifyMoveOverRedirect ( timestamp,
&$  oldTitle,
&$  newTitle,
&$  user,
comment,
ip = '' 
) [static]

Definition at line 473 of file RecentChange.php.

References $user, and notifyMove().

static RecentChange::notifyMoveToNew ( timestamp,
&$  oldTitle,
&$  newTitle,
&$  user,
comment,
ip = '' 
) [static]

Definition at line 469 of file RecentChange.php.

References $user, and notifyMove().

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().

Todo:
Document parameters and return

Definition at line 376 of file RecentChange.php.

References $bot, $minor, $size, $title, $user, obsolete, and wfGetIP().

Referenced by Article::doEdit().

RecentChange::notifyRC2UDP (  ) 

Definition at line 201 of file RecentChange.php.

References $wgRC2UDPAddress, $wgRC2UDPOmitBots, getIRCLine(), and sendToUDP().

RecentChange::reallyMarkPatrolled (  ) 

Mark this RecentChange patrolled, without error checking.

Returns:
int Number of affected rows

Definition at line 308 of file RecentChange.php.

References $dbw, getAttribute(), and wfGetDB().

Referenced by doMarkPatrolled().

RecentChange::save (  ) 

static RecentChange::sendToUDP ( line,
address = '',
prefix = '' 
) [static]

Send some text to UDP.

Parameters:
string $line
string $prefix
string $address
Returns:
bool success

Definition at line 216 of file RecentChange.php.

References $prefix, $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix, and wfDebug().

Referenced by notifyRC2UDP(), and save().

RecentChange::setAttribs ( attribs  ) 

Definition at line 111 of file RecentChange.php.

RecentChange::setExtra ( extra  ) 

Definition at line 115 of file RecentChange.php.


Member Data Documentation

RecentChange::$mAttribs = array()

Definition at line 46 of file RecentChange.php.

RecentChange::$mExtra = array()

Definition at line 46 of file RecentChange.php.

RecentChange::$mMovedToTitle = false

Definition at line 47 of file RecentChange.php.

RecentChange::$mTitle = false

Definition at line 47 of file RecentChange.php.

RecentChange::$numberofWatchingusers = 0

Definition at line 48 of file RecentChange.php.


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

Generated on Sat Sep 5 02:08:45 2009 for MediaWiki by  doxygen 1.5.9