MediaWiki  REL1_19
RecentChange Class Reference

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

Inheritance 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).
 getIRCLine ()
 getMovedToTitle ()
getTitle ()
 loadFromCurRow ($row)
 Makes a pseudo-RC entry from a cur row.
 loadFromRow ($row)
 Initialises the members of this object from a mysql row object.
 notifyRC2UDP ()
 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 cleanupForIRC ($text)
 Remove newlines, carriage returns and decode html entites.
static markPatrolled ($change, $auto=false)
 Mark a given change as patrolled.
static newFromConds ($conds, $fname=__METHOD__)
 Find the first recent change matching some specific conditions.
static newFromCurRow ($row)
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)
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)
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 sendToUDP ($line, $address= '', $prefix= '', $port= '')
 Send some text to UDP.

Public Attributes

 $mAttribs = array()
 $mExtra = array()
 $mMovedToTitle = false
 $mTitle = false
 $notificationtimestamp
 $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 45 of file RecentChange.php.


Member Function Documentation

static RecentChange::cleanupForIRC ( text) [static]

Remove newlines, carriage returns and decode html entites.

Parameters:
$textString
Returns:
String

Definition at line 281 of file RecentChange.php.

References Sanitizer\decodeCharReferences().

Referenced by getIRCLine().

Here is the call graph for this function:

Here is the caller graph for this function:

RecentChange::diffLinkTrail ( forceCur)

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

Parameters:
$forceCur
Returns:
string

Definition at line 655 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:
$userUser object doing the action
$autoBoolean: for automatic patrol
Returns:
array of permissions errors, see Title::getUserPermissionsErrors()

Definition at line 313 of file RecentChange.php.

References $wgUseNPPatrol, $wgUseRCPatrol, getAttribute(), User\getName(), getTitle(), User\isAllowed(), reallyMarkPatrolled(), PatrolLog\record(), and wfRunHooks().

Here is the call graph for this function:

Get an attribute value.

Parameters:
$nameString Attribute name
Returns:
mixed

Definition at line 638 of file RecentChange.php.

Referenced by doMarkPatrolled(), and reallyMarkPatrolled().

Here is the caller graph for this function:

Returns:
array

Definition at line 645 of file RecentChange.php.

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

Returns the change size (HTML).

The lengths can be given optionally.

Parameters:
$oldint
$newint
Returns:
string

Definition at line 757 of file RecentChange.php.

References ChangesList\showCharacterDifference().

Here is the call graph for this function:

Returns:
string

Definition at line 673 of file RecentChange.php.

References $comment, $title, $url, $user, $wgCanonicalServer, $wgLocalInterwiki, $wgRC2UDPInterwikiPrefix, $wgScript, $wgUseNPPatrol, $wgUseRCPatrol, cleanupForIRC(), getTitle(), Title\newFromText(), and wfRunHooks().

Referenced by notifyRC2UDP().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
bool|

Definition at line 156 of file RecentChange.php.

References Title\makeTitle().

Here is the call graph for this function:

Returns:
Title

Definition at line 144 of file RecentChange.php.

References Title\makeTitle().

Referenced by doMarkPatrolled(), and getIRCLine().

Here is the call graph for this function:

Here is the caller graph for this function:

Makes a pseudo-RC entry from a cur row.

Parameters:
$row

Definition at line 601 of file RecentChange.php.

References wfTimestamp().

Referenced by newFromCurRow().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
$row

Definition at line 590 of file RecentChange.php.

References wfTimestamp().

Referenced by newFromRow().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Mark a given change as patrolled.

Parameters:
$changeMixed: RecentChange or corresponding rc_id
$autoBoolean: for automatic patrol
Returns:
Array See doMarkPatrolled(), or null if $change is not an existing rc_id

Definition at line 292 of file RecentChange.php.

References $wgUser, and newFromId().

Here is the call graph for this function:

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

Find the first recent change matching some specific conditions.

Parameters:
$condsArray of conditions
$fnameMixed: override the method name in profiling/logs
Returns:
RecentChange

Definition at line 108 of file RecentChange.php.

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

Referenced by DifferenceEngine\markPatrolledLink().

Here is the call graph for this function:

Here is the caller graph for this function:

static RecentChange::newFromCurRow ( row) [static]
Parameters:
$row
Returns:
RecentChange

Definition at line 76 of file RecentChange.php.

References loadFromCurRow().

Here is the call graph for this function:

static RecentChange::newFromId ( rcid) [static]

Obtain the recent change with a given rc_id value.

Parameters:
$rcidInt rc_id value to retrieve
Returns:
RecentChange

Definition at line 90 of file RecentChange.php.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

static RecentChange::newFromRow ( row) [static]
Parameters:
$row
Returns:
RecentChange

Definition at line 66 of file RecentChange.php.

References loadFromRow().

Referenced by SpecialWatchlist\execute(), ApiQueryRecentChanges\extractRowInfo(), newFromConds(), newFromId(), and SpecialRecentChanges\webOutput().

Here is the call graph for this function:

Here is the caller graph for this function:

static RecentChange::newLogEntry ( timestamp,
&$  title,
&$  user,
actionComment,
ip = '',
type,
action,
target,
logComment,
params,
newId = 0 
) [static]
Parameters:
$timestamp
$titleTitle
$userUser
$actionComment
$ipstring
$type
$action
$targetTitle
$logComment
$params
$newIdint
Returns:
RecentChange

Definition at line 539 of file RecentChange.php.

References $title, and $user.

Referenced by notifyLog(), ManualLogEntry\publish(), and LogPage\saveContent().

Here is the caller graph for this function:

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:
$timestamp
$titleTitle
$minor
$userUser
$comment
$oldId
$lastTimestamp
$bot
$ipstring
$oldSizeint
$newSizeint
$newIdint
$patrolint
Returns:
RecentChange

Definition at line 384 of file RecentChange.php.

References $comment, $title, $user, and save().

Referenced by WikiPage\doEdit().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 511 of file RecentChange.php.

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

Referenced by LogPage\saveContent().

Here is the call graph for this function:

Here is the caller graph for this function:

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
Parameters:
$timestamp
$titleTitle
$minor
$userUser
$comment
$bot
$ipstring
$sizeint
$newIdint
$patrolint
Returns:
RecentChange

Definition at line 448 of file RecentChange.php.

References $comment, $size, $title, $user, and save().

Referenced by WikiPage\doEdit().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 237 of file RecentChange.php.

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

Referenced by save().

Here is the call graph for this function:

Here is the caller graph for this function:

Mark this RecentChange patrolled, without error checking.

Returns:
Integer: number of affected rows

Definition at line 351 of file RecentChange.php.

References getAttribute(), and wfGetDB().

Referenced by doMarkPatrolled().

Here is the call graph for this function:

Here is the caller graph for this function:

RecentChange::save ( noudp = false)

Writes the data in this object to the database.

Parameters:
$noudpbool

Definition at line 168 of file RecentChange.php.

References $title, $wgContLang, $wgLocalInterwiki, $wgPutIPinRC, $wgShowUpdatedMarker, $wgUseEnotif, $wgUser, Title\makeTitle(), User\newFromName(), notifyRC2UDP(), wfGetDB(), and wfRunHooks().

Referenced by notifyEdit(), and notifyNew().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Send some text to UDP.

See also:
RecentChange::cleanupForIRC
Parameters:
$lineString: text to send
$addressString: defaults to $wgRC2UDPAddress.
$prefixString: defaults to $wgRC2UDPPrefix.
$portInt: defaults to $wgRC2UDPPort. (Since 1.17)
Returns:
Boolean: success

Definition at line 254 of file RecentChange.php.

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

Referenced by notifyRC2UDP().

Here is the call graph for this function:

Here is the caller graph for this function:

RecentChange::setAttribs ( attribs)
Parameters:
$attribsarray

Definition at line 129 of file RecentChange.php.

RecentChange::setExtra ( extra)
Parameters:
$extraarray

Definition at line 136 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 56 of file RecentChange.php.

RecentChange::$mTitle = false

Definition at line 51 of file RecentChange.php.

RecentChange::$notificationtimestamp

Definition at line 58 of file RecentChange.php.

RecentChange::$numberofWatchingusers = 0

Definition at line 57 of file RecentChange.php.


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