|
MediaWiki master
|
Utility class for creating and reading rows in the recentchanges table. More...
Inherits MediaWiki\ChangeTags\Taggable.
Inherited by MediaWiki\RecentChanges\RCCacheEntry.

Public Member Functions | |
| __construct (?PageReference $page=null, ?UserIdentity $performer=null) | |
| addTags ( $tags) | |
| Tags to append to the recent change, and associated revision/log. | |
| diffLinkTrail ( $forceCur) | |
| Gets the end part of the diff URL associated with this object Blank if no diff link should be displayed. | |
| getAttribute ( $name) | |
| Get an attribute value. | |
| getAttributes () | |
| getCharacterDifference ( $old=0, $new=0) | |
| Returns the change size (HTML). | |
| getEditResult () | |
| getExtra ( $name) | |
| getExtras () | |
| getHighlights () | |
| getPage () | |
| getParam ( $name) | |
| Get a parameter value. | |
| getPerformerIdentity () | |
| Get the UserIdentity of the client that performed this change. | |
| getTags () | |
| getTitle () | |
| isHighlighted (string $key) | |
| isInternal () | |
| Check if the change is internal (edit, new, log, categorize). | |
| loadFromRow ( $row) | |
| Initialises the members of this object from a mysql row object. | |
| markPatrolled (Authority $performer, $tags=null) | |
| Mark this RecentChange as patrolled. | |
| notifyRCFeeds (?array $feeds=null) | |
| Notify all the feeds about the change. | |
| parseParams () | |
| Parses and returns the rc_params attribute. | |
| reallyMarkPatrolled () | |
| Mark this RecentChange patrolled, without error checking. | |
| save ( $send=self::SEND_FEED) | |
| Writes the data in this object to the database. | |
| setAttribs ( $attribs) | |
| setAttribute ( $name, $value) | |
| setEditResult (?EditResult $editResult) | |
| Sets the EditResult associated with the edit. | |
| setExtra ( $extra) | |
| setHighlights (array $highlights) | |
Static Public Member Functions | |
| static | getChangeTypes () |
| Get an array of all change types. | |
| static | getQueryInfo (int $joinFlags=0) |
| Return the tables, fields, and join conditions to be selected to create a new recentchanges object. | |
| 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 | newFromConds ( $conds, $fname=__METHOD__, $dbType=DB_REPLICA) |
| 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, $logPage, $user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='', $revId=0, $isPatrollable=false, $forceBotFlag=null) |
| static | notifyEdit ( $timestamp, $page, $minor, $user, $comment, $oldId, $lastTimestamp, $bot, $ip='', $oldSize=0, $newSize=0, $newId=0, $patrol=0, $tags=[], ?EditResult $editResult=null) |
| Makes an entry in the database corresponding to an edit. | |
| static | notifyNew ( $timestamp, $page, $minor, $user, $comment, $bot, $ip='', $size=0, $newId=0, $patrol=0, $tags=[]) |
| Makes an entry in the database corresponding to page creation. | |
| static | parseFromRCType ( $rcType) |
| Parsing RC_* constants to human-readable test. | |
| static | parseToRCType ( $type) |
| Parsing text to RC_* constants. | |
Public Attributes | |
| int | $counter = -1 |
| Line number of recent change. | |
| array | $mAttribs = [] |
| array | $mExtra = [] |
| bool | $notificationtimestamp |
| int | $numberofWatchingusers = 0 |
| string null | $watchlistExpiry |
| The expiry time, if this is a temporary watchlist item. | |
| const | PRC_AUTOPATROLLED = PatrolManager::PRC_AUTOPATROLLED |
| const | PRC_PATROLLED = PatrolManager::PRC_PATROLLED |
| const | PRC_UNPATROLLED = PatrolManager::PRC_UNPATROLLED |
| const | SEND_FEED = RecentChangeStore::SEND_FEED |
| const | SEND_NONE = RecentChangeStore::SEND_NONE |
| const | SRC_CATEGORIZE = 'mw.categorize' |
| const | SRC_EDIT = 'mw.edit' |
| const | SRC_LOG = 'mw.log' |
| const | SRC_NEW = 'mw.new' |
| const | STRAIGHT_JOIN_ACTOR = 1 |
| Flag for RecentChange::getQueryInfo() | |
Utility class for creating and reading rows in the recentchanges table.
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_source 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_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 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 watchlistExpiry for temporary watchlist items
Definition at line 90 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::__construct | ( | ?PageReference | $page = null, |
| ?UserIdentity | $performer = null ) |
Definition at line 179 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::addTags | ( | $tags | ) |
Tags to append to the recent change, and associated revision/log.
| string | string[] | $tags |
Implements MediaWiki\ChangeTags\Taggable.
Definition at line 823 of file RecentChange.php.
| MediaWiki\RecentChanges\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 737 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::getAttribute | ( | $name | ) |
Get an attribute value.
| string | $name | Attribute name |
Definition at line 678 of file RecentChange.php.
References wfDeprecatedMsg().
Referenced by MediaWiki\RecentChanges\RecentChangeMailComposer\__construct(), MediaWiki\RecentChanges\RecentChangeNotifier\actuallyNotifyOnPageChange(), MediaWiki\RecentChanges\ChangesList\getDataAttributes(), MediaWiki\RecentChanges\EnhancedChangesList\getDiffHistLinks(), MediaWiki\RCFeed\MachineReadableRCFeedFormatter\getLine(), MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange(), MediaWiki\Specials\SpecialWatchlist\isChangeEffectivelySeen(), MediaWiki\RecentChanges\RecentChangeRCFeedNotifier\notifyRCFeeds(), and MediaWiki\Specials\SpecialWatchlist\outputChangesList().
| MediaWiki\RecentChanges\RecentChange::getAttributes | ( | ) |
Definition at line 708 of file RecentChange.php.
Referenced by MediaWiki\RCFeed\IRCColourfulRCFeedFormatter\getLine(), and MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange().
|
static |
Get an array of all change types.
Definition at line 260 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::getCharacterDifference | ( | $old = 0, | |
| $new = 0 ) |
Returns the change size (HTML).
The lengths can be given optionally.
| int | $old | |
| int | $new |
Definition at line 760 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::getEditResult | ( | ) |
Definition at line 836 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange().
| MediaWiki\RecentChanges\RecentChange::getExtra | ( | $name | ) |
| string | $name |
Definition at line 718 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange(), and MediaWiki\RecentChanges\RecentChangeRCFeedNotifier\notifyRCFeeds().
| MediaWiki\RecentChanges\RecentChange::getExtras | ( | ) |
Definition at line 727 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange().
| MediaWiki\RecentChanges\RecentChange::getHighlights | ( | ) |
Definition at line 915 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::getPage | ( | ) |
Definition at line 406 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RecentChange\getTitle(), and MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange().
| MediaWiki\RecentChanges\RecentChange::getParam | ( | $name | ) |
Get a parameter value.
| string | $name | parameter name |
Definition at line 622 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::getPerformerIdentity | ( | ) |
Get the UserIdentity of the client that performed this change.
Definition at line 436 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange(), and MediaWiki\RecentChanges\RecentChangeRCFeedNotifier\notifyRCFeeds().
|
static |
Return the tables, fields, and join conditions to be selected to create a new recentchanges object.
Since 1.34, rc_user and rc_user_text have not been present in the database, but they continue to be available in query results as aliases.
| int | $joinFlags | May be STRAIGHT_JOIN_ACTOR to use a straight join on the actor table, preventing the database from placing the actor table first in the join. This is appropriate when there are no restrictive conditions on the actor table, and the conditions are potentially complex and unindexed, and the query is limited and ordered by timestamp. Since 1.45. |
$table to IDatabase->select() or SelectQueryBuilder::tables$vars to IDatabase->select() or SelectQueryBuilder::fields$join_conds to IDatabase->select() or SelectQueryBuilder::joinConds Definition at line 323 of file RecentChange.php.
References MediaWiki\RecentChanges\RecentChange\STRAIGHT_JOIN_ACTOR.
Referenced by MediaWiki\RecentChanges\RecentChangesUpdateJob\purgeExpiredRows().
| MediaWiki\RecentChanges\RecentChange::getTags | ( | ) |
Definition at line 811 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange().
| MediaWiki\RecentChanges\RecentChange::getTitle | ( | ) |
Definition at line 397 of file RecentChange.php.
References MediaWiki\RecentChanges\RecentChange\getPage(), MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\makeTitle(), and NS_SPECIAL.
Referenced by MediaWiki\RecentChanges\EnhancedChangesList\getDiffHistLinks(), MediaWiki\RCFeed\IRCColourfulRCFeedFormatter\getLine(), MediaWiki\RCFeed\MachineReadableRCFeedFormatter\getLine(), MediaWiki\RecentChanges\EnhancedChangesList\getLineData(), MediaWiki\RecentChanges\EnhancedChangesList\makeCacheGroupingKey(), MediaWiki\Watchlist\WatchedItem\newFromRecentChange(), and MediaWiki\Specials\SpecialWatchlist\outputChangesList().
| MediaWiki\RecentChanges\RecentChange::isHighlighted | ( | string | $key | ) |
Definition at line 919 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilterGroupContainer\applyCssClassIfNeeded().
|
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 783 of file RecentChange.php.
References wfTimestamp().
| MediaWiki\RecentChanges\RecentChange::isInternal | ( | ) |
Check if the change is internal (edit, new, log, categorize).
External changes are those that are defined by external sources, such as extensions.
Definition at line 668 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::loadFromRow | ( | $row | ) |
Initialises the members of this object from a mysql row object.
| mixed | $row |
Definition at line 632 of file RecentChange.php.
References wfTimestamp().
| MediaWiki\RecentChanges\RecentChange::markPatrolled | ( | Authority | $performer, |
| $tags = null ) |
Mark this RecentChange as patrolled.
NOTE: Can also return 'rcpatroldisabled', 'hookaborted' and 'markedaspatrollederror-noautopatrol' as errors
| Authority | $performer | User performing the action |
| 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 483 of file RecentChange.php.
|
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 291 of file RecentChange.php.
References DB_PRIMARY, and MediaWiki\MediaWikiServices\getInstance().
|
static |
Obtain the recent change with a given rc_id value.
| int | $rcid | The rc_id value to retrieve |
Definition at line 273 of file RecentChange.php.
References MediaWiki\MediaWikiServices\getInstance().
|
static |
| mixed | $row |
Definition at line 207 of file RecentChange.php.
References MediaWiki\MediaWikiServices\getInstance().
|
static |
| string | $timestamp | |
| PageReference | $logPage | |
| UserIdentity | $user | |
| string | $actionComment | |
| string | $ip | |
| string | $type | |
| string | $action | |
| PageReference | $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 |
| bool | null | $forceBotFlag | Override the default behavior and set bot flag to the value of the argument. When omitted or null, it falls back to the global state. |
Definition at line 601 of file RecentChange.php.
|
static |
Makes an entry in the database corresponding to an edit.
| string | $timestamp | |
| PageIdentity | $page | |
| bool | $minor | |
| UserIdentity | $user | |
| string | $comment | |
| int | $oldId | |
| string | $lastTimestamp | |
| bool | $bot | |
| string | $ip | |
| int | $oldSize | |
| int | $newSize | |
| int | $newId | |
| int | $patrol | |
| string[] | $tags | |
| EditResult | null | $editResult | EditResult associated with this edit. Can be safely skipped if the edit is not a revert. Used only for marking revert tags. |
Definition at line 529 of file RecentChange.php.
|
static |
Makes an entry in the database corresponding to page creation.
| string | $timestamp | |
| PageIdentity | $page | |
| bool | $minor | |
| UserIdentity | $user | |
| string | $comment | |
| bool | $bot | |
| string | $ip | |
| int | $size | |
| int | $newId | |
| int | $patrol | |
| string[] | $tags |
Definition at line 565 of file RecentChange.php.
| MediaWiki\RecentChanges\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 466 of file RecentChange.php.
|
static |
Parsing RC_* constants to human-readable test.
| int | $rcType |
Definition at line 247 of file RecentChange.php.
References wfDeprecated().
| MediaWiki\RecentChanges\RecentChange::parseParams | ( | ) |
Parses and returns the rc_params attribute.
Definition at line 796 of file RecentChange.php.
Referenced by MediaWiki\RCFeed\MachineReadableRCFeedFormatter\getLine().
|
static |
Parsing text to RC_* constants.
| string | array | $type | Callers must make sure that the given types are valid RC types. |
Definition at line 221 of file RecentChange.php.
References MediaWiki\RecentChanges\RecentChange\parseToRCType(), and wfDeprecated().
Referenced by MediaWiki\RecentChanges\RecentChange\parseToRCType().
| MediaWiki\RecentChanges\RecentChange::reallyMarkPatrolled | ( | ) |
Mark this RecentChange patrolled, without error checking.
Definition at line 497 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::save | ( | $send = self::SEND_FEED | ) |
Writes the data in this object to the database.
| bool | $send | self::SEND_FEED or self::SEND_NONE |
Definition at line 455 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::setAttribs | ( | $attribs | ) |
| array | $attribs |
Definition at line 373 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::setAttribute | ( | $name, | |
| $value ) |
| string | $name | |
| mixed | $value |
Definition at line 382 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange().
| MediaWiki\RecentChanges\RecentChange::setEditResult | ( | ?EditResult | $editResult | ) |
Sets the EditResult associated with the edit.
| EditResult | null | $editResult |
Definition at line 847 of file RecentChange.php.
| MediaWiki\RecentChanges\RecentChange::setExtra | ( | $extra | ) |
| array | $extra |
Definition at line 389 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RecentChangeStore\insertRecentChange().
| MediaWiki\RecentChanges\RecentChange::setHighlights | ( | array | $highlights | ) |
| array<string,bool> | $highlights |
Definition at line 908 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RCCacheEntry\newFromParent().
| int MediaWiki\RecentChanges\RecentChange::$counter = -1 |
| array MediaWiki\RecentChanges\RecentChange::$mAttribs = [] |
Definition at line 134 of file RecentChange.php.
| array MediaWiki\RecentChanges\RecentChange::$mExtra = [] |
Definition at line 136 of file RecentChange.php.
| bool MediaWiki\RecentChanges\RecentChange::$notificationtimestamp |
Definition at line 151 of file RecentChange.php.
| int MediaWiki\RecentChanges\RecentChange::$numberofWatchingusers = 0 |
Definition at line 149 of file RecentChange.php.
| string null MediaWiki\RecentChanges\RecentChange::$watchlistExpiry |
The expiry time, if this is a temporary watchlist item.
Definition at line 156 of file RecentChange.php.
| const MediaWiki\RecentChanges\RecentChange::PRC_AUTOPATROLLED = PatrolManager::PRC_AUTOPATROLLED |
Definition at line 125 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery\__construct().
| const MediaWiki\RecentChanges\RecentChange::PRC_PATROLLED = PatrolManager::PRC_PATROLLED |
Definition at line 124 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery\__construct().
| const MediaWiki\RecentChanges\RecentChange::PRC_UNPATROLLED = PatrolManager::PRC_UNPATROLLED |
Definition at line 123 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery\__construct().
| const MediaWiki\RecentChanges\RecentChange::SEND_FEED = RecentChangeStore::SEND_FEED |
Definition at line 128 of file RecentChange.php.
| const MediaWiki\RecentChanges\RecentChange::SEND_NONE = RecentChangeStore::SEND_NONE |
Definition at line 127 of file RecentChange.php.
| const MediaWiki\RecentChanges\RecentChange::SRC_CATEGORIZE = 'mw.categorize' |
Definition at line 106 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\ChangesList\getDataAttributes(), MediaWiki\RecentChanges\EnhancedChangesList\getDiffHistLinks(), MediaWiki\RecentChanges\EnhancedChangesList\getLineData(), MediaWiki\RecentChanges\EnhancedChangesList\getLogText(), MediaWiki\RecentChanges\ChangesList\isCategorizationWithoutRevision(), and MediaWiki\RecentChanges\EnhancedChangesList\recentChangesBlockLine().
| const MediaWiki\RecentChanges\RecentChange::SRC_EDIT = 'mw.edit' |
Definition at line 103 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\ChangesFeed\buildItems(), MediaWiki\RecentChanges\ChangesList\getDataAttributes(), and MediaWiki\RecentChanges\EnhancedChangesList\getLineData().
| const MediaWiki\RecentChanges\RecentChange::SRC_LOG = 'mw.log' |
Definition at line 105 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\ChangesList\getDataAttributes(), MediaWiki\RecentChanges\EnhancedChangesList\getLineData(), MediaWiki\RecentChanges\ChangesList\insertDiffHist(), MediaWiki\RecentChanges\EnhancedChangesList\makeCacheGroupingKey(), MediaWiki\RecentChanges\RCCacheEntryFactory\newFromRecentChange(), MediaWiki\RecentChanges\EnhancedChangesList\recentChangesBlockGroup(), MediaWiki\RecentChanges\EnhancedChangesList\recentChangesBlockLine(), and MediaWiki\RecentChanges\ChangesList\userCan().
| const MediaWiki\RecentChanges\RecentChange::SRC_NEW = 'mw.new' |
Definition at line 104 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\ChangesList\getDataAttributes(), MediaWiki\RecentChanges\EnhancedChangesList\getLineData(), MediaWiki\RecentChanges\ChangesList\insertDiffHist(), MediaWiki\RecentChanges\ChangesList\isUnpatrolled(), and MediaWiki\RecentChanges\EnhancedChangesList\recentChangesBlockLine().
| const MediaWiki\RecentChanges\RecentChange::STRAIGHT_JOIN_ACTOR = 1 |
Flag for RecentChange::getQueryInfo()
Definition at line 131 of file RecentChange.php.
Referenced by MediaWiki\RecentChanges\RecentChange\getQueryInfo(), and MediaWiki\RecentChanges\RecentChangesUpdateJob\purgeExpiredRows().