34 use Wikimedia\Assert\Assert;
35 use Wikimedia\AtEase\AtEase;
36 use Wikimedia\IPUtils;
101 public const SEND_NONE =
true;
106 public const SEND_FEED =
false;
174 if ( is_array(
$type ) ) {
183 if ( !array_key_exists(
$type, self::CHANGE_TYPES ) ) {
186 return self::CHANGE_TYPES[
$type];
196 return array_search( $rcType, self::CHANGE_TYPES,
true ) ?:
"$rcType";
207 return array_keys( self::CHANGE_TYPES );
236 $row = $db->selectRow(
237 $rcQuery[
'tables'], $rcQuery[
'fields'], $conds, $fname, [], $rcQuery[
'joins']
239 if ( $row !==
false ) {
265 'recentchanges_actor' =>
'actor'
266 ] + $commentQuery[
'tables'],
290 'rc_user' =>
'recentchanges_actor.actor_user',
291 'rc_user_text' =>
'recentchanges_actor.actor_name',
292 ] + $commentQuery[
'fields'],
294 'recentchanges_actor' => [
'JOIN',
'actor_id=rc_actor' ]
295 ] + $commentQuery[
'joins'],
318 $this->mAttribs = $attribs;
325 $this->mExtra = $extra;
342 if ( !$this->mPage ) {
347 if ( ( $this->mAttribs[
'rc_title'] ??
'' ) ===
'' ) {
356 (
int)$this->mAttribs[
'rc_namespace'],
357 $this->mAttribs[
'rc_title'],
373 if ( !$this->mPerformer instanceof
User ) {
377 return $this->mPerformer;
388 if ( !$this->mPerformer ) {
389 $this->mPerformer = $this->getUserIdentityFromAnyId(
390 $this->mAttribs[
'rc_user'] ??
null,
391 $this->mAttribs[
'rc_user_text'] ??
null,
392 $this->mAttribs[
'rc_actor'] ??
null
396 return $this->mPerformer;
408 public function save( $send = self::SEND_FEED ) {
409 $mainConfig = MediaWikiServices::getInstance()->getMainConfig();
410 $putIPinRC = $mainConfig->get( MainConfigNames::PutIPinRC );
411 $useEnotif = $mainConfig->get(
'UseEnotif' );
412 $showUpdatedMarker = $mainConfig->get( MainConfigNames::ShowUpdatedMarker );
414 if ( !is_array( $this->mExtra ) ) {
419 $this->mAttribs[
'rc_ip'] =
'';
422 # Strict mode fixups (not-NULL fields)
423 foreach ( [
'minor',
'bot',
'new',
'patrolled',
'deleted' ] as $field ) {
424 $this->mAttribs[
"rc_$field"] = (int)$this->mAttribs[
"rc_$field"];
426 # ...more fixups (NULL fields)
427 foreach ( [
'old_len',
'new_len' ] as $field ) {
428 $this->mAttribs[
"rc_$field"] = isset( $this->mAttribs[
"rc_$field"] )
429 ? (int)$this->mAttribs[
"rc_$field"]
433 # If our database is strict about IP addresses, use NULL instead of an empty string
434 $strictIPs = $dbw->getType() ===
'postgres';
435 if ( $strictIPs && $this->mAttribs[
'rc_ip'] ==
'' ) {
436 unset( $this->mAttribs[
'rc_ip'] );
439 $row = $this->mAttribs;
441 # Trim spaces on user supplied text
442 $row[
'rc_comment'] = trim( $row[
'rc_comment'] );
444 # Fixup database timestamps
445 $row[
'rc_timestamp'] = $dbw->timestamp( $row[
'rc_timestamp'] );
447 # # If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL
448 if ( $row[
'rc_cur_id'] == 0 ) {
449 unset( $row[
'rc_cur_id'] );
452 # Convert mAttribs['rc_comment'] for CommentStore
453 $comment = $row[
'rc_comment'];
454 unset( $row[
'rc_comment'], $row[
'rc_comment_text'], $row[
'rc_comment_data'] );
457 # Normalize UserIdentity to actor ID
458 $user = $this->getPerformerIdentity();
459 $actorStore = MediaWikiServices::getInstance()->getActorStore();
460 $row[
'rc_actor'] = $actorStore->acquireActorId( $user, $dbw );
461 unset( $row[
'rc_user'], $row[
'rc_user_text'] );
463 # Don't reuse an existing rc_id for the new row, if one happens to be
464 # set for some reason.
465 unset( $row[
'rc_id'] );
468 $dbw->insert(
'recentchanges', $row, __METHOD__ );
471 $this->mAttribs[
'rc_id'] = $dbw->insertId();
477 if ( $this->editResult !==
null && count( $this->editResult->getRevertTags() ) ) {
479 $this->editResult->getRevertTags(),
480 $this->mAttribs[
'rc_id'],
481 $this->mAttribs[
'rc_this_oldid'],
482 $this->mAttribs[
'rc_logid'],
488 if ( count( $this->tags ) ) {
493 $this->mAttribs[
'rc_id'],
494 $this->mAttribs[
'rc_this_oldid'],
495 $this->mAttribs[
'rc_logid'],
501 if ( $send === self::SEND_FEED ) {
503 $this->notifyRCFeeds();
506 # E-mail notifications
507 if ( $useEnotif || $showUpdatedMarker ) {
508 $userFactory = MediaWikiServices::getInstance()->getUserFactory();
509 $editor = $userFactory->newFromUserIdentity( $this->getPerformerIdentity() );
510 $page = $this->getPage();
521 $dbw->onTransactionCommitOrIdle(
522 function () use ( $editor,
$title ) {
524 $enotif->notifyOnPageChange(
527 $this->mAttribs[
'rc_timestamp'],
528 $this->mAttribs[
'rc_comment'],
529 $this->mAttribs[
'rc_minor'],
530 $this->mAttribs[
'rc_last_oldid'],
531 $this->mExtra[
'pageStatus']
541 if ( mt_rand( 0, 9 ) == 0 ) {
545 if ( $this->mAttribs[
'rc_user'] > 0 ) {
548 MediaWikiServices::getInstance()->getJobQueueGroup()->lazyPush( $jobs );
557 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::RCFeeds );
558 if ( $feeds ===
null ) {
562 $performer = $this->getPerformerIdentity();
564 foreach ( $feeds as $params ) {
566 'omit_bots' =>
false,
567 'omit_anon' =>
false,
568 'omit_user' =>
false,
569 'omit_minor' =>
false,
570 'omit_patrolled' =>
false,
574 ( $params[
'omit_bots'] && $this->mAttribs[
'rc_bot'] ) ||
575 ( $params[
'omit_anon'] && !$performer->isRegistered() ) ||
576 ( $params[
'omit_user'] && $performer->isRegistered() ) ||
577 ( $params[
'omit_minor'] && $this->mAttribs[
'rc_minor'] ) ||
578 ( $params[
'omit_patrolled'] && $this->mAttribs[
'rc_patrolled'] ) ||
584 $actionComment = $this->mExtra[
'actionCommentIRC'] ??
null;
587 $feed->notify( $this, $actionComment );
600 public static function getEngine( $uri, $params = [] ) {
603 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::RCEngines );
604 $scheme = parse_url( $uri, PHP_URL_SCHEME );
606 throw new MWException(
"Invalid RCFeed uri: '$uri'" );
608 if ( !isset( $rcEngines[$scheme] ) ) {
609 throw new MWException(
"Unknown RCFeed engine: '$scheme'" );
611 if ( defined(
'MW_PHPUNIT_TEST' ) && is_object( $rcEngines[$scheme] ) ) {
612 return $rcEngines[$scheme];
614 return new $rcEngines[$scheme]( $params );
629 $mainConfig = MediaWikiServices::getInstance()->getMainConfig();
630 $useRCPatrol = $mainConfig->get( MainConfigNames::UseRCPatrol );
631 $useNPPatrol = $mainConfig->get( MainConfigNames::UseNPPatrol );
632 $useFilePatrol = $mainConfig->get( MainConfigNames::UseFilePatrol );
634 if ( $tags ===
null ) {
636 } elseif ( is_string( $tags ) ) {
640 $status = PermissionStatus::newEmpty();
643 if ( !$useRCPatrol && ( !$useNPPatrol || $this->getAttribute(
'rc_type' ) !=
RC_NEW ) &&
644 ( !$useFilePatrol || !( $this->getAttribute(
'rc_type' ) ==
RC_LOG &&
645 $this->getAttribute(
'rc_log_type' ) ==
'upload' ) ) ) {
646 $status->fatal(
'rcpatroldisabled' );
650 $user = MediaWikiServices::getInstance()->getUserFactory()->newFromAuthority( $performer );
652 $this->getAttribute(
'rc_id' ), $user,
false, $auto, $tags )
654 $status->fatal(
'hookaborted' );
657 if ( $performer->
getUser()->getName() === $this->getAttribute(
'rc_user_text' ) &&
660 $status->fatal(
'markedaspatrollederror-noautopatrol' );
662 if ( !$status->isGood() ) {
663 return $status->toLegacyErrorArray();
666 if ( $this->getAttribute(
'rc_patrolled' ) ) {
670 $this->reallyMarkPatrolled();
675 $this->getAttribute(
'rc_id' ), $user,
false, $auto );
689 'rc_patrolled' => self::PRC_PATROLLED
692 'rc_id' => $this->getAttribute(
'rc_id' )
698 $this->
getTitle()->invalidateCache();
701 $revisionId = $this->getAttribute(
'rc_this_oldid' );
703 $revertedTagUpdateManager =
704 MediaWikiServices::getInstance()->getRevertedTagUpdateManager();
705 $revertedTagUpdateManager->approveRevertedTagForRevision( $revisionId );
708 return $dbw->affectedRows();
736 $timestamp, $page, $minor, $user, $comment, $oldId, $lastTimestamp,
737 $bot, $ip =
'', $oldSize = 0, $newSize = 0, $newId = 0, $patrol = 0,
740 Assert::parameter( $page->exists(),
'$page',
'must represent an existing page' );
744 $rc->mPerformer = $user;
746 'rc_timestamp' => $timestamp,
747 'rc_namespace' => $page->getNamespace(),
748 'rc_title' => $page->getDBkey(),
750 'rc_source' => self::SRC_EDIT,
751 'rc_minor' => $minor ? 1 : 0,
752 'rc_cur_id' => $page->getId(),
753 'rc_user' => $user->getId(),
754 'rc_user_text' => $user->getName(),
755 'rc_comment' => &$comment,
756 'rc_comment_text' => &$comment,
757 'rc_comment_data' =>
null,
758 'rc_this_oldid' => (int)$newId,
759 'rc_last_oldid' => $oldId,
760 'rc_bot' => $bot ? 1 : 0,
761 'rc_ip' => self::checkIPAddress( $ip ),
762 'rc_patrolled' => intval( $patrol ),
763 'rc_new' => 0, # obsolete
764 'rc_old_len' => $oldSize,
765 'rc_new_len' => $newSize,
768 'rc_log_type' =>
null,
769 'rc_log_action' =>
'',
774 $formatter = MediaWikiServices::getInstance()->getTitleFormatter();
777 'prefixedDBkey' => $formatter->getPrefixedDBkey( $page ),
778 'lastTimestamp' => $lastTimestamp,
779 'oldSize' => $oldSize,
780 'newSize' => $newSize,
781 'pageStatus' =>
'changed'
785 static function () use ( $rc, $tags, $editResult ) {
786 $rc->addTags( $tags );
787 $rc->setEditResult( $editResult );
790 DeferredUpdates::POSTSEND,
818 $page, $minor, $user, $comment, $bot,
819 $ip =
'', $size = 0, $newId = 0, $patrol = 0, $tags = []
821 Assert::parameter( $page->exists(),
'$page',
'must represent an existing page' );
825 $rc->mPerformer = $user;
827 'rc_timestamp' => $timestamp,
828 'rc_namespace' => $page->getNamespace(),
829 'rc_title' => $page->getDBkey(),
831 'rc_source' => self::SRC_NEW,
832 'rc_minor' => $minor ? 1 : 0,
833 'rc_cur_id' => $page->getId(),
834 'rc_user' => $user->getId(),
835 'rc_user_text' => $user->getName(),
836 'rc_comment' => &$comment,
837 'rc_comment_text' => &$comment,
838 'rc_comment_data' =>
null,
839 'rc_this_oldid' => (int)$newId,
840 'rc_last_oldid' => 0,
841 'rc_bot' => $bot ? 1 : 0,
842 'rc_ip' => self::checkIPAddress( $ip ),
843 'rc_patrolled' => intval( $patrol ),
844 'rc_new' => 1, # obsolete
846 'rc_new_len' => $size,
849 'rc_log_type' =>
null,
850 'rc_log_action' =>
'',
855 $formatter = MediaWikiServices::getInstance()->getTitleFormatter();
858 'prefixedDBkey' => $formatter->getPrefixedDBkey( $page ),
859 'lastTimestamp' => 0,
862 'pageStatus' =>
'created'
866 static function () use ( $rc, $tags ) {
867 $rc->addTags( $tags );
870 DeferredUpdates::POSTSEND,
894 $logPage, $user, $actionComment, $ip,
$type,
895 $action, $target, $logComment, $params, $newId = 0, $actionCommentIRC =
''
897 $logRestrictions = MediaWikiServices::getInstance()->getMainConfig()
898 ->get( MainConfigNames::LogRestrictions );
900 # Don't add private logs to RC!
901 if ( isset( $logRestrictions[
$type] ) && $logRestrictions[
$type] !=
'*' ) {
904 $rc = self::newLogEntry( $timestamp,
905 $logPage, $user, $actionComment, $ip,
$type, $action,
906 $target, $logComment, $params, $newId, $actionCommentIRC );
931 $logPage, $user, $actionComment, $ip,
932 $type, $action, $target, $logComment, $params, $newId = 0, $actionCommentIRC =
'',
933 $revId = 0, $isPatrollable =
false ) {
935 $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
937 # # Get pageStatus for email notification
938 switch (
$type .
'-' . $action ) {
939 case 'delete-delete':
940 case 'delete-delete_redir':
941 case 'delete-delete_redir2':
942 $pageStatus =
'deleted';
945 case 'move-move_redir':
946 $pageStatus =
'moved';
948 case 'delete-restore':
949 $pageStatus =
'restored';
951 case 'upload-upload':
952 $pageStatus =
'created';
954 case 'upload-overwrite':
956 $pageStatus =
'changed';
961 $canAutopatrol = $permissionManager->userHasRight( $user,
'autopatrol' );
962 $markPatrolled = $isPatrollable ? $canAutopatrol :
true;
965 $pageId = $target->getId();
971 $rc->mPage = $target;
972 $rc->mPerformer = $user;
974 'rc_timestamp' => $timestamp,
975 'rc_namespace' => $target->getNamespace(),
976 'rc_title' => $target->getDBkey(),
978 'rc_source' => self::SRC_LOG,
980 'rc_cur_id' => $pageId,
981 'rc_user' => $user->getId(),
982 'rc_user_text' => $user->getName(),
983 'rc_comment' => &$logComment,
984 'rc_comment_text' => &$logComment,
985 'rc_comment_data' =>
null,
986 'rc_this_oldid' => (int)$revId,
987 'rc_last_oldid' => 0,
988 'rc_bot' => $permissionManager->userHasRight( $user,
'bot' ) ?
990 'rc_ip' => self::checkIPAddress( $ip ),
991 'rc_patrolled' => $markPatrolled ? self::PRC_AUTOPATROLLED : self::PRC_UNPATROLLED,
992 'rc_new' => 0, # obsolete
993 'rc_old_len' =>
null,
994 'rc_new_len' =>
null,
996 'rc_logid' => $newId,
997 'rc_log_type' =>
$type,
998 'rc_log_action' => $action,
999 'rc_params' => $params
1003 $formatter = MediaWikiServices::getInstance()->getTitleFormatter();
1009 'prefixedDBkey' => $formatter->getPrefixedDBkey( $logPage ),
1010 'lastTimestamp' => 0,
1011 'actionComment' => $actionComment,
1012 'pageStatus' => $pageStatus,
1013 'actionCommentIRC' => $actionCommentIRC
1055 $categoryWikiPage = MediaWikiServices::getInstance()->getWikiPageFactory()
1056 ->newFromTitle( $categoryTitle );
1058 '@phan-var WikiCategoryPage $categoryWikiPage';
1060 'hidden-cat' => $categoryWikiPage->isHidden()
1062 if ( $added !==
null ) {
1063 $params[
'added'] = $added;
1068 $user = MediaWikiServices::getInstance()->getActorStore()->getUnknownActor();
1072 $rc->mPage = $categoryTitle;
1073 $rc->mPerformer = $user;
1075 'rc_timestamp' => MWTimestamp::convert( TS_MW, $timestamp ),
1077 'rc_title' => $categoryTitle->
getDBkey(),
1079 'rc_source' => self::SRC_CATEGORIZE,
1083 'rc_cur_id' => $pageTitle->
getId(),
1084 'rc_user' => $user->
getId(),
1085 'rc_user_text' => $user->
getName(),
1086 'rc_comment' => &$comment,
1087 'rc_comment_text' => &$comment,
1088 'rc_comment_data' =>
null,
1089 'rc_this_oldid' => (int)$newRevId,
1090 'rc_last_oldid' => $oldRevId,
1091 'rc_bot' => $bot ? 1 : 0,
1092 'rc_ip' => self::checkIPAddress( $ip ),
1093 'rc_patrolled' => self::PRC_AUTOPATROLLED,
1094 'rc_new' => 0, # obsolete
1095 'rc_old_len' =>
null,
1096 'rc_new_len' =>
null,
1097 'rc_deleted' => $deleted,
1099 'rc_log_type' =>
null,
1100 'rc_log_action' =>
'',
1105 $formatter = MediaWikiServices::getInstance()->getTitleFormatter();
1108 'prefixedDBkey' => $formatter->getPrefixedDBkey( $categoryTitle ),
1109 'lastTimestamp' => $lastTimestamp,
1112 'pageStatus' =>
'changed'
1127 $params = $this->parseParams();
1128 return $params[$name] ??
null;
1137 $this->mAttribs = get_object_vars( $row );
1138 $this->mAttribs[
'rc_timestamp'] =
wfTimestamp( TS_MW, $this->mAttribs[
'rc_timestamp'] );
1140 $this->mAttribs[
'rc_deleted'] = $row->rc_deleted;
1142 if ( isset( $this->mAttribs[
'rc_ip'] ) ) {
1144 $n = strpos( $this->mAttribs[
'rc_ip'],
'/' );
1145 if ( $n !==
false ) {
1146 $this->mAttribs[
'rc_ip'] = substr( $this->mAttribs[
'rc_ip'], 0, $n );
1154 $this->mAttribs[
'rc_comment'] = &$comment;
1155 $this->mAttribs[
'rc_comment_text'] = &$comment;
1156 $this->mAttribs[
'rc_comment_data'] =
null;
1158 $this->mPerformer = $this->getUserIdentityFromAnyId(
1159 $row->rc_user ??
null,
1160 $row->rc_user_text ??
null,
1161 $row->rc_actor ??
null
1163 $this->mAttribs[
'rc_user'] = $this->mPerformer->getId();
1164 $this->mAttribs[
'rc_user_text'] = $this->mPerformer->getName();
1167 if ( isset( $row->we_expiry ) && $row->we_expiry ) {
1168 $this->watchlistExpiry =
wfTimestamp( TS_MW, $row->we_expiry );
1179 if ( $name ===
'rc_comment' ) {
1181 ->getComment(
'rc_comment', $this->mAttribs,
true )->text;
1184 if ( $name ===
'rc_user' || $name ===
'rc_user_text' || $name ===
'rc_actor' ) {
1185 $user = $this->getPerformerIdentity();
1187 if ( $name ===
'rc_user' ) {
1188 return $user->getId();
1190 if ( $name ===
'rc_user_text' ) {
1191 return $user->getName();
1193 if ( $name ===
'rc_actor' ) {
1196 $actorStore = MediaWikiServices::getInstance()->getActorStore();
1198 return $actorStore->findActorId( $user, $db );
1202 return $this->mAttribs[$name] ??
null;
1209 return $this->mAttribs;
1219 if ( $this->mAttribs[
'rc_type'] ==
RC_EDIT ) {
1220 $trail =
"curid=" . (int)( $this->mAttribs[
'rc_cur_id'] ) .
1221 "&oldid=" . (int)( $this->mAttribs[
'rc_last_oldid'] );
1223 $trail .=
'&diff=0';
1225 $trail .=
'&diff=' . (int)( $this->mAttribs[
'rc_this_oldid'] );
1243 $old = $this->mAttribs[
'rc_old_len'];
1246 $new = $this->mAttribs[
'rc_new_len'];
1248 if ( $old ===
null || $new ===
null ) {
1258 if ( !IPUtils::isIPAddress( $ip ) ) {
1259 throw new MWException(
"Attempt to write \"" . $ip .
1260 "\" as an IP address into recent changes" );
1283 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::RCMaxAge );
1285 return (
int)
wfTimestamp( TS_UNIX, $timestamp ) > time() - $tolerance - $rcMaxAge;
1296 $rcParams = $this->getAttribute(
'rc_params' );
1298 AtEase::suppressWarnings();
1300 AtEase::restoreWarnings();
1302 return $unserializedParams;
1314 if ( is_string( $tags ) ) {
1315 $this->tags[] = $tags;
1317 $this->tags = array_merge( $tags, $this->tags );
1329 $this->editResult = $editResult;
1346 $userId = isset( $userId ) ? (int)$userId : null;
1347 $actorId = isset( $actorId ) ? (int)$actorId : 0;
1349 $actorStore = MediaWikiServices::getInstance()->getActorStore();
1350 if ( $userName && $actorId ) {
1353 return $actorStore->newActorFromRowFields( $userId, $userName, $actorId );
1355 if ( $userId !==
null ) {
1356 if ( $userName !==
null ) {
1360 $user = $actorStore->getUserIdentityByUserId( $userId );
1363 throw new RuntimeException(
"User not found by ID: $userId" );
1366 } elseif ( $actorId > 0 ) {
1368 $user = $actorStore->getActorById( $actorId, $db );
1371 throw new RuntimeException(
"User not found by actor ID: $actorId" );
1373 } elseif ( $userName !==
null ) {
1374 $user = $actorStore->getUserIdentityByName( $userName );
1377 throw new RuntimeException(
"User not found by name: $userName" );
1380 throw new RuntimeException(
'At least one of user ID, actor ID or user name must be given' );
unserialize( $serialized)
deprecatePublicPropertyFallback(string $property, string $version, $getter, $setter=null, $class=null, $component=null)
Mark a removed public property as deprecated and provide fallback getter and setter callables.
trait DeprecationHelper
Use this trait in classes which have properties for which public access is deprecated or implementati...
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfDeprecatedMsg( $msg, $version=false, $component=false, $callerOffset=2)
Log a deprecation warning with arbitrary message text.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
if(!defined('MW_SETUP_CALLBACK'))
The persistent session ID (if any) loaded at startup.
static showCharacterDifference( $old, $new, IContextSource $context=null)
Show formatted char difference.
static addCallableUpdate( $callable, $stage=self::POSTSEND, $dbw=null)
Add an update to the pending update queue that invokes the specified callback when run.
This module processes the email notifications when the current page is changed.
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.
A class containing constants representing the names of configuration variables.
static record( $rc, $auto, UserIdentity $user, $tags=null)
Record a log event for a change being patrolled.
static factory(array $params)
Utility class for creating new RC entries.
static getEngine( $uri, $params=[])
static parseToRCType( $type)
Parsing text to RC_* constants.
setEditResult(?EditResult $editResult)
Sets the EditResult associated with the edit.
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.
reallyMarkPatrolled()
Mark this RecentChange patrolled, without error checking.
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...
doMarkPatrolled(Authority $performer, $auto=false, $tags=null)
Mark this RecentChange as patrolled.
parseParams()
Parses and returns the rc_params attribute.
getPerformer()
Get the User object of the person who performed this change.
static checkIPAddress( $ip)
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 getChangeTypes()
Get an array of all change types.
static isInRCLifespan( $timestamp, $tolerance=0)
Check whether the given timestamp is new enough to have a RC row with a given tolerance as the recent...
int $counter
Line number of recent change.
UserIdentity null $mPerformer
save( $send=self::SEND_FEED)
Writes the data in this object to the database.
static getQueryInfo()
Return the tables, fields, and join conditions to be selected to create a new recentchanges object.
static newFromConds( $conds, $fname=__METHOD__, $dbType=DB_REPLICA)
Find the first recent change matching some specific conditions.
getCharacterDifference( $old=0, $new=0)
Returns the change size (HTML).
static parseFromRCType( $rcType)
Parsing RC_* constants to human-readable test.
EditResult null $editResult
EditResult associated with the edit.
notifyRCFeeds(array $feeds=null)
Notify all the feeds about the change.
PageReference null $mPage
array $tags
List of tags to apply.
getPerformerIdentity()
Get the UserIdentity of the client that performed this change.
getParam( $name)
Get a parameter value.
static newLogEntry( $timestamp, $logPage, $user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='', $revId=0, $isPatrollable=false)
addTags( $tags)
Tags to append to the recent change, and associated revision/log.
getUserIdentityFromAnyId( $userId, $userName, $actorId=null)
loadFromRow( $row)
Initialises the members of this object from a mysql row object.
static notifyLog( $timestamp, $logPage, $user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='')
getAttribute( $name)
Get an attribute value.
string null $watchlistExpiry
The expiry time, if this is a temporary watchlist item.
diffLinkTrail( $forceCur)
Gets the end part of the diff URL associated with this object Blank if no diff link should be display...
static newFromId( $rcid)
Obtain the recent change with a given rc_id value.
static newCacheUpdateJob()
This is to display changes made to all articles linked in an article.
Represents a title within MediaWiki.
static castFromPageReference(?PageReference $pageReference)
Return a Title for a given Reference.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromIdentity(UserIdentity $identity)
Returns a User object corresponding to the given UserIdentity.
Interface for objects (potentially) representing an editable wiki page.
getId( $wikiId=self::LOCAL)
Returns the page ID.
canExist()
Checks whether this PageIdentity represents a "proper" page, meaning that it could exist as an editab...