BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
RecentChange Class Reference
Inheritance diagram for RecentChange:

Public Member Functions

 setAttribs ($attribs)
 
 setExtra ($extra)
 
getTitle ()
 
 getPerformer ()
 
 save ($noudp=false)
 
 doMarkPatrolled (User $user, $auto=false, $tags=null)
 
 reallyMarkPatrolled ()
 
 getParam ($name)
 
 loadFromRow ($row)
 
 getAttribute ($name)
 
 getAttributes ()
 
 diffLinkTrail ($forceCur)
 
 getCharacterDifference ($old=0, $new=0)
 
 parseParams ()
 

Static Public Member Functions

static static newFromRow ($row)
 
static parseToRCType ($type)
 
static parseFromRCType ($rcType)
 
static getChangeTypes ()
 
static newFromId ($rcid)
 
static newFromConds ($conds, $fname=__METHOD__, $dbType=DB_SLAVE)
 
static selectFields ()
 
static getEngine ($uri)
 
static markPatrolled ($change, $auto=false, $tags=null)
 
static notifyEdit ($timestamp, &$title, $minor, &$user, $comment, $oldId, $lastTimestamp, $bot, $ip= '', $oldSize=0, $newSize=0, $newId=0, $patrol=0, $tags=[])
 
static notifyNew ($timestamp, &$title, $minor, &$user, $comment, $bot, $ip= '', $size=0, $newId=0, $patrol=0, $tags=[])
 
static notifyLog ($timestamp, &$title, &$user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC= '')
 
static newLogEntry ($timestamp, &$title, &$user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC= '', $revId=0, $isPatrollable=false)
 
static newForCategorization ($timestamp, Title $categoryTitle, User $user=null, $comment, Title $pageTitle, $oldRevId, $newRevId, $lastTimestamp, $bot, $ip= '', $deleted=0)
 
static isInRCLifespan ($timestamp, $tolerance=0)
 

Public Attributes

const SRC_EDIT = 'mw.edit'
 
const SRC_NEW = 'mw.new'
 
const SRC_LOG = 'mw.log'
 
const SRC_EXTERNAL = 'mw.external'
 
const SRC_CATEGORIZE = 'mw.categorize'
 
 $mAttribs = []
 
 $mExtra = []
 
 $mTitle = false
 
 $numberofWatchingusers = 0
 
 $notificationtimestamp
 
 $counter = -1
 

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

Member Function Documentation

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
RecentChange::doMarkPatrolled ( User  $user,
  $auto = false,
  $tags = null 
)

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
string|string[]$tags Change tags to add to the patrol log entry ($user should be able to add the specified tags before this is called)
Returns
array Array of permissions errors, see Title::getUserPermissionsErrors()
RecentChange::getAttribute (   $name)

Get an attribute value

Parameters
string$nameAttribute name
Returns
mixed
RecentChange::getAttributes ( )
Returns
array
static RecentChange::getChangeTypes ( )
static

Get an array of all change types

Since
1.26
Returns
array
RecentChange::getCharacterDifference (   $old = 0,
  $new = 0 
)

Returns the change size (HTML). The lengths can be given optionally.

Parameters
int$old
int$new
Returns
string
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
RecentChange::getParam (   $name)

Get a parameter value

Since
1.27
Parameters
string$nameparameter name
Returns
mixed
RecentChange::getPerformer ( )

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

Returns
User
& RecentChange::getTitle ( )
Returns
Title
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
RecentChange::loadFromRow (   $row)

Initialises the members of this object from a mysql row object

Parameters
mixed$row
static RecentChange::markPatrolled (   $change,
  $auto = false,
  $tags = null 
)
static

Mark a given change as patrolled

Parameters
RecentChange | int$changeRecentChange or corresponding rc_id
bool$autoFor automatic patrol
string|string[]$tags Change tags to add to the patrol log entry ($user should be able to add the specified tags before this is called)
Returns
array See doMarkPatrolled(), or null if $change is not an existing rc_id
static RecentChange::newForCategorization (   $timestamp,
Title  $categoryTitle,
User  $user = null,
  $comment,
Title  $pageTitle,
  $oldRevId,
  $newRevId,
  $lastTimestamp,
  $bot,
  $ip = '',
  $deleted = 0 
)
static

Constructs a RecentChange object for the given categorization This does not call save() on the object and thus does not write to the db

Since
1.27
Parameters
string$timestampTimestamp of the recent change to occur
Title$categoryTitleTitle of the category a page is being added to or removed from
User$userUser object of the user that made the change
string$commentChange summary
Title$pageTitleTitle of the page that is being added or removed
int$oldRevIdParent revision ID of this change
int$newRevIdRevision ID of this change
string$lastTimestampParent revision timestamp of this change
bool$bottrue, if the change was made by a bot
string$ipIP address of the user, if the change was made anonymously
int$deletedIndicates whether the change has been deleted
Returns
RecentChange
static RecentChange::newFromConds (   $conds,
  $fname = __METHOD__,
  $dbType = DB_SLAVE 
)
static

Find the first recent change matching some specific conditions

Parameters
array$condsArray of conditions
mixed$fnameOverride the method name in profiling/logs
int$dbTypeDB_* constant
Returns
RecentChange|null
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|null
static static RecentChange::newFromRow (   $row)
static
Parameters
mixed$row
Returns
RecentChange
static RecentChange::newLogEntry (   $timestamp,
$title,
$user,
  $actionComment,
  $ip,
  $type,
  $action,
  $target,
  $logComment,
  $params,
  $newId = 0,
  $actionCommentIRC = '',
  $revId = 0,
  $isPatrollable = false 
)
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
int$revIdId of associated revision, if any
bool$isPatrollableWhether this log entry is patrollable
Returns
RecentChange
static RecentChange::notifyEdit (   $timestamp,
$title,
  $minor,
$user,
  $comment,
  $oldId,
  $lastTimestamp,
  $bot,
  $ip = '',
  $oldSize = 0,
  $newSize = 0,
  $newId = 0,
  $patrol = 0,
  $tags = [] 
)
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
array$tags
Returns
RecentChange
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
static RecentChange::notifyNew (   $timestamp,
$title,
  $minor,
$user,
  $comment,
  $bot,
  $ip = '',
  $size = 0,
  $newId = 0,
  $patrol = 0,
  $tags = [] 
)
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
array$tags
Returns
RecentChange
static RecentChange::parseFromRCType (   $rcType)
static

Parsing RC_* constants to human-readable test

Since
1.24
Parameters
int$rcType
Returns
string $type
RecentChange::parseParams ( )

Parses and returns the rc_params attribute

Since
1.26
Returns
mixed|bool false on failed unserialization
static RecentChange::parseToRCType (   $type)
static

Parsing text to RC_* constants

Since
1.24
Parameters
string | array$type
Exceptions
MWException
Returns
int|array RC_TYPE
RecentChange::reallyMarkPatrolled ( )

Mark this RecentChange patrolled, without error checking

Returns
int Number of affected rows
RecentChange::save (   $noudp = false)

Writes the data in this object to the database

Parameters
bool$noudp
static RecentChange::selectFields ( )
static

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

Returns
array
RecentChange::setAttribs (   $attribs)
Parameters
array$attribs
RecentChange::setExtra (   $extra)
Parameters
array$extra

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