MediaWiki REL1_40
|
Utility class for creating new RC entries. More...
Inherits MediaWiki\ChangeTags\Taggable.
Inherited by RCCacheEntry.
Public Member Functions | |
__construct () | |
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. | |
doMarkPatrolled (Authority $performer, $auto=null, $tags=null) | |
Mark this RecentChange as patrolled. | |
getAttribute ( $name) | |
Get an attribute value. | |
getAttributes () | |
getCharacterDifference ( $old=0, $new=0) | |
Returns the change size (HTML). | |
getPage () | |
getParam ( $name) | |
Get a parameter value. | |
getPerformer () | |
Get the User object of the person who performed this change. | |
getPerformerIdentity () | |
Get the UserIdentity of the client that performed this change. | |
getTitle () | |
loadFromRow ( $row) | |
Initialises the members of this object from a mysql row object. | |
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) | |
setEditResult (?EditResult $editResult) | |
Sets the EditResult associated with the edit. | |
setExtra ( $extra) | |
Static Public Member Functions | |
static | getChangeTypes () |
Get an array of all change types. | |
static | getEngine ( $uri, $params=[]) |
static | getQueryInfo () |
Return the tables, fields, and join conditions to be selected to create a new recentchanges object. | |
static | isEnotifEnabled (Config $conf) |
Whether e-mail notifications are generally enabled on this wiki. | |
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 | newForCategorization ( $timestamp, PageIdentity $categoryTitle, ?UserIdentity $user, $comment, PageIdentity $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. | |
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 | notifyLog ( $timestamp, $logPage, $user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='') |
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 = [] |
$mExtra = [] | |
$notificationtimestamp | |
$numberofWatchingusers = 0 | |
string null | $watchlistExpiry |
The expiry time, if this is a temporary watchlist item. | |
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' |
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 watchlistExpiry for temporary watchlist items
Definition at line 84 of file RecentChange.php.
RecentChange::__construct | ( | ) |
Definition at line 303 of file RecentChange.php.
References $title, and deprecatePublicPropertyFallback().
RecentChange::addTags | ( | $tags | ) |
Tags to append to the recent change, and associated revision/log.
string | string[] | $tags |
Implements MediaWiki\ChangeTags\Taggable.
Definition at line 1341 of file RecentChange.php.
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 1215 of file RecentChange.php.
References RC_EDIT.
RecentChange::doMarkPatrolled | ( | Authority | $performer, |
$auto = null, | |||
$tags = null ) |
Mark this RecentChange as patrolled.
NOTE: Can also return 'rcpatroldisabled', 'hookaborted' and 'markedaspatrollederror-noautopatrol' as errors
Authority | $performer | User performing the action |
bool | null | $auto | Unused. Passing true logs a warning. |
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 621 of file RecentChange.php.
References MediaWiki\Permissions\Authority\authorizeWrite(), getTitle(), MediaWiki\Permissions\Authority\getUser(), MediaWiki\Permissions\Authority\isAllowed(), RC_LOG, RC_NEW, PatrolLog\record(), and wfWarn().
RecentChange::getAttribute | ( | $name | ) |
Get an attribute value.
string | $name | Attribute name |
Definition at line 1175 of file RecentChange.php.
References DB_REPLICA, wfDeprecatedMsg(), and wfGetDB().
Referenced by ChangesList\getDataAttributes(), EnhancedChangesList\getDiffHistLinks(), MachineReadableRCFeedFormatter\getLine(), and SpecialWatchlist\isChangeEffectivelySeen().
RecentChange::getAttributes | ( | ) |
Definition at line 1205 of file RecentChange.php.
Referenced by IRCColourfulRCFeedFormatter\getLine().
|
static |
Get an array of all change types.
Definition at line 207 of file RecentChange.php.
RecentChange::getCharacterDifference | ( | $old = 0, | |
$new = 0 ) |
Returns the change size (HTML).
The lengths can be given optionally.
int | $old | |
int | $new |
Definition at line 1238 of file RecentChange.php.
|
static |
string | $uri | URI to get the engine object for |
array | $params |
MWException |
Definition at line 593 of file RecentChange.php.
References wfDeprecated().
RecentChange::getPage | ( | ) |
Definition at line 345 of file RecentChange.php.
Referenced by getTitle().
RecentChange::getParam | ( | $name | ) |
Get a parameter value.
string | $name | parameter name |
Definition at line 1131 of file RecentChange.php.
RecentChange::getPerformer | ( | ) |
Get the User object of the person who performed this change.
Definition at line 375 of file RecentChange.php.
References User\newFromIdentity().
RecentChange::getPerformerIdentity | ( | ) |
Get the UserIdentity of the client that performed this change.
Definition at line 391 of file RecentChange.php.
|
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.
$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 262 of file RecentChange.php.
RecentChange::getTitle | ( | ) |
Definition at line 336 of file RecentChange.php.
References getPage(), and NS_SPECIAL.
Referenced by EnhancedChangesList\getDiffHistLinks(), IRCColourfulRCFeedFormatter\getLine(), MachineReadableRCFeedFormatter\getLine(), EnhancedChangesList\getLineData(), EnhancedChangesList\makeCacheGroupingKey(), WatchedItem\newFromRecentChange(), and SpecialWatchlist\outputChangesList().
|
static |
Whether e-mail notifications are generally enabled on this wiki.
This is used for:
TODO: Determine whether these optimizations still make sense.
FIXME: The $wgShowUpdatedMarker variable was added to this condtion in 2008 (2cf12c973d, SVN r35001) because at the time the per-user "last seen" marker for watchlist and page history, was managed by the EmailNotification/UserMailed classes. As of August 2022, this appears to no longer be the case.
Config | $conf |
Definition at line 1311 of file RecentChange.php.
|
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 1278 of file RecentChange.php.
References wfTimestamp().
RecentChange::loadFromRow | ( | $row | ) |
Initialises the members of this object from a mysql row object.
mixed | $row |
Definition at line 1141 of file RecentChange.php.
References DB_REPLICA, wfGetDB(), and wfTimestamp().
Referenced by newFromRow().
|
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 |
PageIdentity | $categoryTitle | the category a page is being added to or removed from |
UserIdentity | null | $user | User object of the user that made the change |
string | $comment | Change summary |
PageIdentity | $pageTitle | 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 1044 of file RecentChange.php.
References MediaWiki\Page\PageReference\getDBkey(), MediaWiki\Page\PageIdentity\getId(), MediaWiki\User\UserIdentity\getId(), MediaWiki\User\UserIdentity\getName(), MediaWiki\Page\PageReference\getNamespace(), and RC_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 230 of file RecentChange.php.
References wfGetDB().
|
static |
Obtain the recent change with a given rc_id value.
int | $rcid | The rc_id value to retrieve |
Definition at line 217 of file RecentChange.php.
|
static |
mixed | $row |
Definition at line 160 of file RecentChange.php.
References loadFromRow().
|
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 928 of file RecentChange.php.
References $type, $wgRequest, MediaWiki\Page\PageIdentity\canExist(), and RC_LOG.
|
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 731 of file RecentChange.php.
References DB_PRIMARY, RC_EDIT, and wfGetDB().
|
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 |
Definition at line 889 of file RecentChange.php.
References $type.
|
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 812 of file RecentChange.php.
References DB_PRIMARY, RC_NEW, and wfGetDB().
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 551 of file RecentChange.php.
References RCFeed\factory(), and RC_EXTERNAL.
|
static |
Parsing RC_* constants to human-readable test.
int | $rcType |
Definition at line 196 of file RecentChange.php.
RecentChange::parseParams | ( | ) |
Parses and returns the rc_params attribute.
Definition at line 1323 of file RecentChange.php.
Referenced by MachineReadableRCFeedFormatter\getLine().
|
static |
Parsing text to RC_* constants.
string | array | $type |
MWException |
Definition at line 174 of file RecentChange.php.
RecentChange::reallyMarkPatrolled | ( | ) |
Mark this RecentChange patrolled, without error checking.
Definition at line 680 of file RecentChange.php.
References DB_PRIMARY, getTitle(), and wfGetDB().
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 412 of file RecentChange.php.
References $title, ChangeTags\addTags(), DB_PRIMARY, RC_CATEGORIZE, and wfGetDB().
RecentChange::setAttribs | ( | $attribs | ) |
array | $attribs |
Definition at line 321 of file RecentChange.php.
RecentChange::setEditResult | ( | ?EditResult | $editResult | ) |
Sets the EditResult associated with the edit.
EditResult | null | $editResult |
Definition at line 1356 of file RecentChange.php.
RecentChange::setExtra | ( | $extra | ) |
array | $extra |
Definition at line 328 of file RecentChange.php.
int RecentChange::$counter = -1 |
array RecentChange::$mAttribs = [] |
Definition at line 110 of file RecentChange.php.
RecentChange::$mExtra = [] |
Definition at line 111 of file RecentChange.php.
RecentChange::$notificationtimestamp |
Definition at line 124 of file RecentChange.php.
RecentChange::$numberofWatchingusers = 0 |
Definition at line 123 of file RecentChange.php.
string null RecentChange::$watchlistExpiry |
The expiry time, if this is a temporary watchlist item.
Definition at line 129 of file RecentChange.php.
const RecentChange::PRC_AUTOPATROLLED = 2 |
Definition at line 97 of file RecentChange.php.
const RecentChange::PRC_PATROLLED = 1 |
Definition at line 96 of file RecentChange.php.
const RecentChange::PRC_UNPATROLLED = 0 |
Definition at line 95 of file RecentChange.php.
const RecentChange::SRC_CATEGORIZE = 'mw.categorize' |
Definition at line 93 of file RecentChange.php.
const RecentChange::SRC_EDIT = 'mw.edit' |
Definition at line 89 of file RecentChange.php.
const RecentChange::SRC_EXTERNAL = 'mw.external' |
Definition at line 92 of file RecentChange.php.
const RecentChange::SRC_LOG = 'mw.log' |
Definition at line 91 of file RecentChange.php.
const RecentChange::SRC_NEW = 'mw.new' |
Definition at line 90 of file RecentChange.php.