MediaWiki
1.34.0
|
Utility class for creating new RC entries. More...
Public Member Functions | |
addTags ( $tags) | |
Tags to append to the recent change, and associated revision/log. More... | |
diffLinkTrail ( $forceCur) | |
Gets the end part of the diff URL associated with this object Blank if no diff link should be displayed. More... | |
doMarkPatrolled (User $user, $auto=false, $tags=null) | |
Mark this RecentChange as patrolled. More... | |
getAttribute ( $name) | |
Get an attribute value. More... | |
getAttributes () | |
getCharacterDifference ( $old=0, $new=0) | |
Returns the change size (HTML). More... | |
getParam ( $name) | |
Get a parameter value. More... | |
getPerformer () | |
Get the User object of the person who performed this change. More... | |
& | getTitle () |
loadFromRow ( $row) | |
Initialises the members of this object from a mysql row object. More... | |
notifyRCFeeds (array $feeds=null) | |
Notify all the feeds about the change. More... | |
parseParams () | |
Parses and returns the rc_params attribute. More... | |
reallyMarkPatrolled () | |
Mark this RecentChange patrolled, without error checking. More... | |
save ( $send=self::SEND_FEED) | |
Writes the data in this object to the database. More... | |
setAttribs ( $attribs) | |
setExtra ( $extra) | |
Static Public Member Functions | |
static | getChangeTypes () |
Get an array of all change types. More... | |
static | getEngine ( $uri, $params=[]) |
static | getQueryInfo () |
Return the tables, fields, and join conditions to be selected to create a new recentchanges object. More... | |
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. More... | |
static | markPatrolled ( $change, $auto=false, $tags=null) |
Mark a given change as patrolled. More... | |
static | newForCategorization ( $timestamp, Title $categoryTitle, User $user=null, $comment, Title $pageTitle, $oldRevId, $newRevId, $lastTimestamp, $bot, $ip='', $deleted=0, $added=null) |
Constructs a RecentChange object for the given categorization This does not call save() on the object and thus does not write to the db. More... | |
static | newFromConds ( $conds, $fname=__METHOD__, $dbType=DB_REPLICA) |
Find the first recent change matching some specific conditions. More... | |
static | newFromId ( $rcid) |
Obtain the recent change with a given rc_id value. More... | |
static | newFromRow ( $row) |
static | newLogEntry ( $timestamp, $title, $user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='', $revId=0, $isPatrollable=false) |
static | notifyEdit ( $timestamp, $title, $minor, $user, $comment, $oldId, $lastTimestamp, $bot, $ip='', $oldSize=0, $newSize=0, $newId=0, $patrol=0, $tags=[]) |
Makes an entry in the database corresponding to an edit. More... | |
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, $tags=[]) |
Makes an entry in the database corresponding to page creation Note: the title object must be loaded with the new id using resetArticleID() More... | |
static | parseFromRCType ( $rcType) |
Parsing RC_* constants to human-readable test. More... | |
static | parseToRCType ( $type) |
Parsing text to RC_* constants. More... | |
Public Attributes | |
int | $counter = -1 |
Line number of recent change. More... | |
array | $mAttribs = [] |
$mExtra = [] | |
Title false | $mTitle = false |
$notificationtimestamp | |
$numberofWatchingusers = 0 | |
const | PRC_AUTOPATROLLED = 2 |
const | PRC_PATROLLED = 1 |
const | PRC_UNPATROLLED = 0 |
const | SRC_CATEGORIZE = 'mw.categorize' |
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 false | $mPerformer = false |
array | $tags = [] |
List of tags to apply. More... | |
Static Private Attributes | |
static array | $changeTypes |
Array of change types. More... | |
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_actor actor id 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 70 of file RecentChange.php.
RecentChange::addTags | ( | $tags | ) |
Tags to append to the recent change, and associated revision/log.
string | string[] | $tags |
Implements MediaWiki\ChangeTags\Taggable.
Definition at line 1161 of file RecentChange.php.
References $tags.
|
staticprivate |
Definition at line 1104 of file RecentChange.php.
References $wgRequest, and IP\isIPAddress().
Referenced by newForCategorization(), newLogEntry(), notifyEdit(), and notifyNew().
RecentChange::diffLinkTrail | ( | $forceCur | ) |
Gets the end part of the diff URL associated with this object Blank if no diff link should be displayed.
bool | $forceCur |
Definition at line 1067 of file RecentChange.php.
References RC_EDIT.
RecentChange::doMarkPatrolled | ( | User | $user, |
$auto = false , |
|||
$tags = null |
|||
) |
Mark this RecentChange as patrolled.
NOTE: Can also return 'rcpatroldisabled', 'hookaborted' and 'markedaspatrollederror-noautopatrol' as errors
User | $user | User object doing the action |
bool | $auto | For automatic patrol |
string | string[] | null | $tags | Change tags to add to the patrol log entry ($user should be able to add the specified tags before this is called) |
Definition at line 536 of file RecentChange.php.
References $tags, $wgUseFilePatrol, $wgUseNPPatrol, $wgUseRCPatrol, getAttribute(), User\getName(), getTitle(), RC_LOG, RC_NEW, reallyMarkPatrolled(), PatrolLog\record(), and Hooks\run().
RecentChange::getAttribute | ( | $name | ) |
Get an attribute value.
string | $name | Attribute name |
Definition at line 1028 of file RecentChange.php.
References CommentStore\getStore(), and User\newFromAnyId().
Referenced by RCCacheEntryFactory\buildDiffLink(), doMarkPatrolled(), ChangesList\getDataAttributes(), EnhancedChangesList\getDiffHistLinks(), SpecialWatchlist\getLatestNotificationTimestamp(), MachineReadableRCFeedFormatter\getLine(), SpecialWatchlist\isChangeEffectivelySeen(), parseParams(), and reallyMarkPatrolled().
RecentChange::getAttributes | ( | ) |
Definition at line 1057 of file RecentChange.php.
References $mAttribs.
Referenced by IRCColourfulRCFeedFormatter\getLine().
|
static |
Get an array of all change types.
Definition at line 184 of file RecentChange.php.
Referenced by ApiQueryWatchlist\getAllowedParams(), and ApiQueryRecentChanges\getAllowedParams().
RecentChange::getCharacterDifference | ( | $old = 0 , |
|
$new = 0 |
|||
) |
Returns the change size (HTML).
The lengths can be given optionally.
int | $old | |
int | $new |
Definition at line 1090 of file RecentChange.php.
References ChangesList\showCharacterDifference().
|
static |
string | $uri | URI to get the engine object for |
array | $params |
MWException |
Definition at line 486 of file RecentChange.php.
References $wgRCEngines.
Referenced by RCFeed\factory().
RecentChange::getParam | ( | $name | ) |
Get a parameter value.
string | $name | parameter name |
Definition at line 980 of file RecentChange.php.
References parseParams().
RecentChange::getPerformer | ( | ) |
Get the User object of the person who performed this change.
Definition at line 297 of file RecentChange.php.
References $mPerformer, User\newFromActorId(), User\newFromId(), and User\newFromName().
Referenced by notifyRCFeeds(), and save().
|
static |
Return the tables, fields, and join conditions to be selected to create a new recentchanges object.
$table
to IDatabase->select()
$vars
to IDatabase->select()
$join_conds
to IDatabase->select()
Definition at line 233 of file RecentChange.php.
References CommentStore\getStore(), and ActorMigration\newMigration().
Referenced by SiteStatsUpdate\cacheUpdate(), SpecialRecentChangesLinked\doMainQuery(), SpecialRecentChanges\doMainQuery(), SpecialWatchlist\doMainQuery(), ChangesListSpecialPage\doMainQuery(), NewPagesPager\getQueryInfo(), newFromConds(), and RecentChangesUpdateJob\purgeExpiredRows().
& RecentChange::getTitle | ( | ) |
Definition at line 284 of file RecentChange.php.
References $mTitle, and Title\makeTitle().
Referenced by RCCacheEntryFactory\buildCLink(), RCCacheEntryFactory\buildCurLink(), RCCacheEntryFactory\buildDiffLink(), RCCacheEntryFactory\buildLastLink(), doMarkPatrolled(), OldChangesList\formatChangeLine(), EnhancedChangesList\getDiffHistLinks(), SpecialWatchlist\getLatestNotificationTimestamp(), IRCColourfulRCFeedFormatter\getLine(), MachineReadableRCFeedFormatter\getLine(), EnhancedChangesList\getLineData(), EnhancedChangesList\makeCacheGroupingKey(), reallyMarkPatrolled(), and save().
|
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.
mixed | $timestamp | MWTimestamp compatible timestamp |
int | $tolerance | Tolerance in seconds |
Definition at line 1130 of file RecentChange.php.
References $wgRCMaxAge, and wfTimestamp().
Referenced by DifferenceEngine\getMarkPatrolledLinkInfo(), and Article\showPatrolFooter().
RecentChange::loadFromRow | ( | $row | ) |
Initialises the members of this object from a mysql row object.
mixed | $row |
Definition at line 990 of file RecentChange.php.
References DB_REPLICA, CommentStore\getStore(), User\newFromAnyId(), wfGetDB(), and wfTimestamp().
Referenced by newFromRow().
|
static |
Mark a given change as patrolled.
RecentChange | int | $change | RecentChange or corresponding rc_id |
bool | $auto | For automatic patrol |
string | string[] | null | $tags | Change tags to add to the patrol log entry ($user should be able to add the specified tags before this is called) |
Definition at line 511 of file RecentChange.php.
References $tags, and newFromId().
|
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.
string | $timestamp | Timestamp of the recent change to occur |
Title | $categoryTitle | Title of the category a page is being added to or removed from |
User | null | $user | User object of the user that made the change |
string | $comment | Change summary |
Title | $pageTitle | Title of the page that is being added or removed |
int | $oldRevId | Parent revision ID of this change |
int | $newRevId | Revision ID of this change |
string | $lastTimestamp | Parent revision timestamp of this change |
bool | $bot | true, if the change was made by a bot |
string | $ip | IP address of the user, if the change was made anonymously |
int | $deleted | Indicates whether the change has been deleted |
bool | null | $added | true, if the category was added, false for removed |
Definition at line 907 of file RecentChange.php.
References checkIPAddress(), WikiPage\factory(), Title\getArticleID(), Title\getDBkey(), Title\getNamespace(), Title\getPrefixedDBkey(), PRC_AUTOPATROLLED, RC_CATEGORIZE, serialize(), and SRC_CATEGORIZE.
|
static |
Find the first recent change matching some specific conditions.
array | $conds | Array of conditions |
mixed | $fname | Override the method name in profiling/logs |
int | $dbType | DB_* constant |
Definition at line 207 of file RecentChange.php.
References getQueryInfo(), newFromRow(), and wfGetDB().
Referenced by DifferenceEngine\getMarkPatrolledLinkInfo(), Revision\RevisionStore\getRecentChange(), newFromId(), and Article\showPatrolFooter().
|
static |
Obtain the recent change with a given rc_id value.
int | $rcid | The rc_id value to retrieve |
Definition at line 194 of file RecentChange.php.
References newFromConds().
Referenced by ApiPatrol\execute(), MarkpatrolledAction\getRecentChange(), markPatrolled(), ApiTag\processIndividual(), and PatrolLog\record().
|
static |
mixed | $row |
Definition at line 137 of file RecentChange.php.
References loadFromRow().
Referenced by ApiQueryRecentChanges\extractRowInfo(), newFromConds(), SpecialRecentChanges\outputChangesList(), and SpecialWatchlist\outputChangesList().
|
static |
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 | $revId | Id of associated revision, if any |
bool | $isPatrollable | Whether this log entry is patrollable |
Definition at line 810 of file RecentChange.php.
References $title, $type, $wgRequest, checkIPAddress(), PRC_AUTOPATROLLED, PRC_UNPATROLLED, RC_LOG, and SRC_LOG.
Referenced by ManualLogEntry\getRecentChange(), notifyLog(), and LogPage\saveContent().
|
static |
Makes an entry in the database corresponding to an edit.
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 |
Definition at line 632 of file RecentChange.php.
References $tags, $title, DeferredUpdates\addCallableUpdate(), checkIPAddress(), DB_MASTER, DeferredUpdates\POSTSEND, RC_EDIT, SRC_EDIT, and wfGetDB().
Referenced by MediaWiki\Storage\PageUpdater\doModify(), and ImportTextFiles\execute().
|
static |
string | $timestamp | |
Title | $title | |
User | $user | |
string | $actionComment | |
string | $ip | |
string | $type | |
string | $action | |
Title | $target | |
string | $logComment | |
string | $params | |
int | $newId | |
string | $actionCommentIRC |
Definition at line 777 of file RecentChange.php.
References $title, $type, $wgLogRestrictions, and newLogEntry().
Referenced by LogPage\saveContent().
|
static |
Makes an entry in the database corresponding to page creation Note: the title object must be loaded with the new id using resetArticleID()
string | $timestamp | |
Title | $title | |
bool | $minor | |
User | $user | |
string | $comment | |
bool | $bot | |
string | $ip | |
int | $size | |
int | $newId | |
int | $patrol | |
array | $tags |
Definition at line 706 of file RecentChange.php.
References $tags, $title, DeferredUpdates\addCallableUpdate(), checkIPAddress(), DB_MASTER, DeferredUpdates\POSTSEND, RC_NEW, SRC_NEW, and wfGetDB().
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), and ImportTextFiles\execute().
RecentChange::notifyRCFeeds | ( | array | $feeds = null | ) |
Notify all the feeds about the change.
array | null | $feeds | Optional feeds to send to, defaults to $wgRCFeeds |
Definition at line 443 of file RecentChange.php.
References $wgRCFeeds, RCFeed\factory(), getPerformer(), and RC_EXTERNAL.
Referenced by save().
|
static |
Parsing RC_* constants to human-readable test.
int | $rcType |
Definition at line 173 of file RecentChange.php.
Referenced by ApiQueryWatchlist\extractOutputData(), ApiQueryRecentChanges\extractRowInfo(), and MachineReadableRCFeedFormatter\getLine().
RecentChange::parseParams | ( | ) |
Parses and returns the rc_params attribute.
Definition at line 1143 of file RecentChange.php.
References getAttribute(), and unserialize().
Referenced by MachineReadableRCFeedFormatter\getLine(), and getParam().
|
static |
Parsing text to RC_* constants.
string | array | $type |
MWException |
Definition at line 151 of file RecentChange.php.
Referenced by ApiQueryWatchlist\run(), and ApiQueryRecentChanges\run().
RecentChange::reallyMarkPatrolled | ( | ) |
Mark this RecentChange patrolled, without error checking.
Definition at line 594 of file RecentChange.php.
References DB_MASTER, getAttribute(), getTitle(), and wfGetDB().
Referenced by doMarkPatrolled().
RecentChange::save | ( | $send = self::SEND_FEED | ) |
Writes the data in this object to the database.
For compatibility reasons, the SEND_ constants internally reference a value that may seem negated from their purpose (none=true, feed=false). This is because the parameter used to be called "$noudp", defaulting to false.
bool | $send | self::SEND_FEED or self::SEND_NONE |
Definition at line 322 of file RecentChange.php.
References $mAttribs, $title, $wgPutIPinRC, $wgShowUpdatedMarker, $wgUseEnotif, ChangeTags\addTags(), DB_MASTER, getPerformer(), CommentStore\getStore(), getTitle(), RecentChangesUpdateJob\newCacheUpdateJob(), User\newFromAnyId(), ActorMigration\newMigration(), notifyRCFeeds(), RC_CATEGORIZE, Hooks\run(), JobQueueGroup\singleton(), and wfGetDB().
RecentChange::setAttribs | ( | $attribs | ) |
array | $attribs |
Definition at line 270 of file RecentChange.php.
RecentChange::setExtra | ( | $extra | ) |
array | $extra |
Definition at line 277 of file RecentChange.php.
|
staticprivate |
Array of change types.
Definition at line 123 of file RecentChange.php.
int RecentChange::$counter = -1 |
array RecentChange::$mAttribs = [] |
Definition at line 94 of file RecentChange.php.
Referenced by getAttributes(), and save().
RecentChange::$mExtra = [] |
Definition at line 95 of file RecentChange.php.
|
private |
Definition at line 105 of file RecentChange.php.
Referenced by getPerformer().
Title false RecentChange::$mTitle = false |
Definition at line 100 of file RecentChange.php.
Referenced by getTitle().
RecentChange::$notificationtimestamp |
Definition at line 108 of file RecentChange.php.
RecentChange::$numberofWatchingusers = 0 |
Definition at line 107 of file RecentChange.php.
|
private |
List of tags to apply.
Definition at line 118 of file RecentChange.php.
Referenced by addTags(), doMarkPatrolled(), markPatrolled(), notifyEdit(), and notifyNew().
const RecentChange::PRC_AUTOPATROLLED = 2 |
Definition at line 81 of file RecentChange.php.
Referenced by ChangesListSpecialPage\__construct(), WikiPage\commitRollback(), WikiPage\doEditContent(), ApiQueryWatchlist\extractOutputData(), ApiQueryUserContribs\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), WatchedItemQueryService\getWatchedItemsWithRCInfoQueryFilterConds(), newForCategorization(), newLogEntry(), McrUndoAction\onSubmit(), ApiQueryUserContribs\prepareQuery(), ApiQueryRecentChanges\run(), RevDelLogItem\setBits(), and RevDelRevisionItem\setBits().
const RecentChange::PRC_PATROLLED = 1 |
Definition at line 80 of file RecentChange.php.
Referenced by ChangesListSpecialPage\__construct().
const RecentChange::PRC_UNPATROLLED = 0 |
Definition at line 79 of file RecentChange.php.
Referenced by ChangesListSpecialPage\__construct(), ApiQueryWatchlist\extractOutputData(), ApiQueryUserContribs\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), DifferenceEngine\getMarkPatrolledLinkInfo(), NewPagesPager\getQueryInfo(), NewFilesPager\getQueryInfo(), Revision\RevisionStore\getRcIdIfUnpatrolled(), WatchedItemQueryService\getWatchedItemsWithRCInfoQueryFilterConds(), newLogEntry(), ApiQueryUserContribs\prepareQuery(), and ApiQueryRecentChanges\run().
const RecentChange::SRC_CATEGORIZE = 'mw.categorize' |
Definition at line 77 of file RecentChange.php.
Referenced by ChangesListSpecialPage\__construct(), newForCategorization(), and CategoryMembershipChangeJob\run().
const RecentChange::SRC_EDIT = 'mw.edit' |
Definition at line 73 of file RecentChange.php.
Referenced by ChangesListSpecialPage\__construct(), PopulateRecentChangesSource\buildUpdateCondition(), ChangesList\getDataAttributes(), notifyEdit(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), and RebuildRecentchanges\rebuildRecentChangesTablePass2().
const RecentChange::SRC_EXTERNAL = 'mw.external' |
Definition at line 76 of file RecentChange.php.
Referenced by PopulateRecentChangesSource\buildUpdateCondition().
const RecentChange::SRC_LOG = 'mw.log' |
Definition at line 75 of file RecentChange.php.
Referenced by ChangesListSpecialPage\__construct(), PopulateRecentChangesSource\buildUpdateCondition(), ChangesListSpecialPage\execute(), ChangesList\getDataAttributes(), newLogEntry(), and RebuildRecentchanges\rebuildRecentChangesTablePass3().
const RecentChange::SRC_NEW = 'mw.new' |
Definition at line 74 of file RecentChange.php.
Referenced by ChangesListSpecialPage\__construct(), PopulateRecentChangesSource\buildUpdateCondition(), ChangesList\getDataAttributes(), notifyNew(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), and RebuildRecentchanges\rebuildRecentChangesTablePass2().