MediaWiki  master
ApiQueryWatchlist.php
Go to the documentation of this file.
1 <?php
27 
35 
37  private $commentStore;
38 
44  public function __construct(
45  ApiQuery $query,
46  $moduleName,
48  ) {
49  parent::__construct( $query, $moduleName, 'wl' );
50  $this->commentStore = $commentStore;
51  }
52 
53  public function execute() {
54  $this->run();
55  }
56 
57  public function executeGenerator( $resultPageSet ) {
58  $this->run( $resultPageSet );
59  }
60 
61  private $fld_ids = false, $fld_title = false, $fld_patrol = false,
62  $fld_flags = false, $fld_timestamp = false, $fld_user = false,
63  $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
66 
68  private $fld_expiry = false;
69 
74  private function run( $resultPageSet = null ) {
75  $this->selectNamedDB( 'watchlist', DB_REPLICA, 'watchlist' );
76 
77  $params = $this->extractRequestParams();
78 
79  $user = $this->getUser();
80  $wlowner = $this->getWatchlistUser( $params );
81 
82  if ( $params['prop'] !== null && $resultPageSet === null ) {
83  $prop = array_fill_keys( $params['prop'], true );
84 
85  $this->fld_ids = isset( $prop['ids'] );
86  $this->fld_title = isset( $prop['title'] );
87  $this->fld_flags = isset( $prop['flags'] );
88  $this->fld_user = isset( $prop['user'] );
89  $this->fld_userid = isset( $prop['userid'] );
90  $this->fld_comment = isset( $prop['comment'] );
91  $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
92  $this->fld_timestamp = isset( $prop['timestamp'] );
93  $this->fld_sizes = isset( $prop['sizes'] );
94  $this->fld_patrol = isset( $prop['patrol'] );
95  $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
96  $this->fld_loginfo = isset( $prop['loginfo'] );
97  $this->fld_tags = isset( $prop['tags'] );
98  $this->fld_expiry = isset( $prop['expiry'] );
99 
100  if ( $this->fld_patrol && !$user->useRCPatrol() && !$user->useNPPatrol() ) {
101  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'patrol' );
102  }
103  }
104 
105  $options = [
106  'dir' => $params['dir'] === 'older'
109  ];
110 
111  if ( $resultPageSet === null ) {
112  $options['includeFields'] = $this->getFieldsToInclude();
113  } else {
114  $options['usedInGenerator'] = true;
115  }
116 
117  if ( $params['start'] ) {
118  $options['start'] = $params['start'];
119  }
120  if ( $params['end'] ) {
121  $options['end'] = $params['end'];
122  }
123 
124  $startFrom = null;
125  if ( $params['continue'] !== null ) {
126  $cont = explode( '|', $params['continue'] );
127  $this->dieContinueUsageIf( count( $cont ) != 2 );
128  $continueTimestamp = $cont[0];
129  $continueId = (int)$cont[1];
130  $this->dieContinueUsageIf( $continueId != $cont[1] );
131  $startFrom = [ $continueTimestamp, $continueId ];
132  }
133 
134  if ( $wlowner !== $user ) {
135  $options['watchlistOwner'] = $wlowner;
136  $options['watchlistOwnerToken'] = $params['token'];
137  }
138 
139  if ( $params['namespace'] !== null ) {
140  $options['namespaceIds'] = $params['namespace'];
141  }
142 
143  if ( $params['allrev'] ) {
144  $options['allRevisions'] = true;
145  }
146 
147  if ( $params['show'] !== null ) {
148  $show = array_fill_keys( $params['show'], true );
149 
150  /* Check for conflicting parameters. */
151  if ( $this->showParamsConflicting( $show ) ) {
152  $this->dieWithError( 'apierror-show' );
153  }
154 
155  // Check permissions.
156  if ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
158  ) {
159  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
160  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
161  }
162  }
163 
164  $options['filters'] = array_keys( $show );
165  }
166 
167  if ( $params['type'] !== null ) {
168  try {
169  $rcTypes = RecentChange::parseToRCType( $params['type'] );
170  if ( $rcTypes ) {
171  $options['rcTypes'] = $rcTypes;
172  }
173  } catch ( Exception $e ) {
174  ApiBase::dieDebug( __METHOD__, $e->getMessage() );
175  }
176  }
177 
178  $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
179  if ( $params['user'] !== null ) {
180  $options['onlyByUser'] = $params['user'];
181  }
182  if ( $params['excludeuser'] !== null ) {
183  $options['notByUser'] = $params['excludeuser'];
184  }
185 
186  $options['limit'] = $params['limit'];
187 
188  $this->getHookRunner()->onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions(
189  $this, $params, $options );
190 
191  $ids = [];
192  $services = MediaWikiServices::getInstance();
193  $watchedItemQuery = $services->getWatchedItemQueryService();
194  $items = $watchedItemQuery->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
195 
196  // Get gender information
197  if ( $items !== [] && $resultPageSet === null && $this->fld_title &&
198  $services->getContentLanguage()->needsGenderDistinction()
199  ) {
200  $nsInfo = $services->getNamespaceInfo();
201  $usernames = [];
202  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
204  $linkTarget = $watchedItem->getTarget();
205  if ( $nsInfo->hasGenderDistinction( $linkTarget->getNamespace() ) ) {
206  $usernames[] = $linkTarget->getText();
207  }
208  }
209  if ( $usernames !== [] ) {
210  $services->getGenderCache()->doQuery( $usernames, __METHOD__ );
211  }
212  }
213 
214  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
216  if ( $resultPageSet === null ) {
217  $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
218  $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
219  if ( !$fit ) {
220  $startFrom = [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ];
221  break;
222  }
223  } elseif ( $params['allrev'] ) {
224  $ids[] = (int)$recentChangeInfo['rc_this_oldid'];
225  } else {
226  $ids[] = (int)$recentChangeInfo['rc_cur_id'];
227  }
228  }
229 
230  if ( $startFrom !== null ) {
231  $this->setContinueEnumParameter( 'continue', implode( '|', $startFrom ) );
232  }
233 
234  if ( $resultPageSet === null ) {
235  $this->getResult()->addIndexedTagName(
236  [ 'query', $this->getModuleName() ],
237  'item'
238  );
239  } elseif ( $params['allrev'] ) {
240  $resultPageSet->populateFromRevisionIDs( $ids );
241  } else {
242  $resultPageSet->populateFromPageIDs( $ids );
243  }
244  }
245 
246  private function getFieldsToInclude() {
247  $includeFields = [];
248  if ( $this->fld_flags ) {
249  $includeFields[] = WatchedItemQueryService::INCLUDE_FLAGS;
250  }
251  if ( $this->fld_user || $this->fld_userid || $this->fld_loginfo ) {
252  $includeFields[] = WatchedItemQueryService::INCLUDE_USER_ID;
253  }
254  if ( $this->fld_user || $this->fld_loginfo ) {
255  $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
256  }
257  if ( $this->fld_comment || $this->fld_parsedcomment ) {
258  $includeFields[] = WatchedItemQueryService::INCLUDE_COMMENT;
259  }
260  if ( $this->fld_patrol ) {
263  }
264  if ( $this->fld_sizes ) {
265  $includeFields[] = WatchedItemQueryService::INCLUDE_SIZES;
266  }
267  if ( $this->fld_loginfo ) {
269  }
270  if ( $this->fld_tags ) {
271  $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
272  }
273  return $includeFields;
274  }
275 
276  private function showParamsConflicting( array $show ) {
277  return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
278  && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
279  || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
280  && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
281  || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
282  && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
283  || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
289  || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
290  && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
291  }
292 
293  private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
294  /* Determine the title of the page that has been changed. */
295  $target = $watchedItem->getTarget();
296  if ( $target instanceof LinkTarget ) {
297  $title = Title::newFromLinkTarget( $target );
298  } else {
299  $title = Title::castFromPageIdentity( $target );
300  }
301  $user = $this->getUser();
302 
303  /* Our output data. */
304  $vals = [];
305  $type = (int)$recentChangeInfo['rc_type'];
306  $vals['type'] = RecentChange::parseFromRCType( $type );
307  $anyHidden = false;
308 
309  /* Create a new entry in the result for the title. */
310  if ( $this->fld_title || $this->fld_ids ) {
311  // These should already have been filtered out of the query, but just in case.
312  if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
313  $vals['actionhidden'] = true;
314  $anyHidden = true;
315  }
316  if ( $type !== RC_LOG ||
318  $recentChangeInfo['rc_deleted'],
320  $user
321  )
322  ) {
323  if ( $this->fld_title ) {
325  }
326  if ( $this->fld_ids ) {
327  $vals['pageid'] = (int)$recentChangeInfo['rc_cur_id'];
328  $vals['revid'] = (int)$recentChangeInfo['rc_this_oldid'];
329  $vals['old_revid'] = (int)$recentChangeInfo['rc_last_oldid'];
330  }
331  }
332  }
333 
334  /* Add user data and 'anon' flag, if user is anonymous. */
335  if ( $this->fld_user || $this->fld_userid ) {
336  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_USER ) {
337  $vals['userhidden'] = true;
338  $anyHidden = true;
339  }
340  if ( RevisionRecord::userCanBitfield(
341  $recentChangeInfo['rc_deleted'],
342  RevisionRecord::DELETED_USER,
343  $user
344  ) ) {
345  if ( $this->fld_userid ) {
346  $vals['userid'] = (int)$recentChangeInfo['rc_user'];
347  // for backwards compatibility
348  $vals['user'] = (int)$recentChangeInfo['rc_user'];
349  }
350 
351  if ( $this->fld_user ) {
352  $vals['user'] = $recentChangeInfo['rc_user_text'];
353  }
354 
355  $vals['anon'] = !$recentChangeInfo['rc_user'];
356  }
357  }
358 
359  /* Add flags, such as new, minor, bot. */
360  if ( $this->fld_flags ) {
361  $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
362  $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
363  $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
364  }
365 
366  /* Add sizes of each revision. (Only available on 1.10+) */
367  if ( $this->fld_sizes ) {
368  $vals['oldlen'] = (int)$recentChangeInfo['rc_old_len'];
369  $vals['newlen'] = (int)$recentChangeInfo['rc_new_len'];
370  }
371 
372  /* Add the timestamp. */
373  if ( $this->fld_timestamp ) {
374  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
375  }
376 
377  if ( $this->fld_notificationtimestamp ) {
378  $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
379  ? ''
380  : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
381  }
382 
383  /* Add edit summary / log summary. */
384  if ( $this->fld_comment || $this->fld_parsedcomment ) {
385  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_COMMENT ) {
386  $vals['commenthidden'] = true;
387  $anyHidden = true;
388  }
389  if ( RevisionRecord::userCanBitfield(
390  $recentChangeInfo['rc_deleted'],
391  RevisionRecord::DELETED_COMMENT,
392  $user
393  ) ) {
394  $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text;
395  if ( $this->fld_comment ) {
396  $vals['comment'] = $comment;
397  }
398 
399  if ( $this->fld_parsedcomment ) {
400  $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
401  }
402  }
403  }
404 
405  /* Add the patrolled flag */
406  if ( $this->fld_patrol ) {
407  $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] != RecentChange::PRC_UNPATROLLED;
408  $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
409  $vals['autopatrolled'] = $recentChangeInfo['rc_patrolled'] == RecentChange::PRC_AUTOPATROLLED;
410  }
411 
412  if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
413  if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
414  $vals['actionhidden'] = true;
415  $anyHidden = true;
416  }
418  $recentChangeInfo['rc_deleted'],
420  $user
421  ) ) {
422  $vals['logid'] = (int)$recentChangeInfo['rc_logid'];
423  $vals['logtype'] = $recentChangeInfo['rc_log_type'];
424  $vals['logaction'] = $recentChangeInfo['rc_log_action'];
425 
426  $logFormatter = LogFormatter::newFromRow( $recentChangeInfo );
427  $vals['logparams'] = $logFormatter->formatParametersForApi();
428  $vals['logdisplay'] = $logFormatter->getActionText();
429  }
430  }
431 
432  if ( $this->fld_tags ) {
433  if ( $recentChangeInfo['rc_tags'] ) {
434  $tags = explode( ',', $recentChangeInfo['rc_tags'] );
435  ApiResult::setIndexedTagName( $tags, 'tag' );
436  $vals['tags'] = $tags;
437  } else {
438  $vals['tags'] = [];
439  }
440  }
441 
442  if ( $this->fld_expiry ) {
443  // Add expiration, T263796
444  $expiry = $watchedItem->getExpiry( TS_ISO_8601 );
445  $vals['expiry'] = ( $expiry ?? false );
446  }
447 
448  if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_RESTRICTED ) ) {
449  $vals['suppressed'] = true;
450  }
451 
452  $this->getHookRunner()->onApiQueryWatchlistExtractOutputData(
453  $this, $watchedItem, $recentChangeInfo, $vals );
454 
455  return $vals;
456  }
457 
458  public function getAllowedParams() {
459  return [
460  'allrev' => false,
461  'start' => [
462  ApiBase::PARAM_TYPE => 'timestamp'
463  ],
464  'end' => [
465  ApiBase::PARAM_TYPE => 'timestamp'
466  ],
467  'namespace' => [
468  ApiBase::PARAM_ISMULTI => true,
469  ApiBase::PARAM_TYPE => 'namespace'
470  ],
471  'user' => [
472  ApiBase::PARAM_TYPE => 'user',
473  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
474  ],
475  'excludeuser' => [
476  ApiBase::PARAM_TYPE => 'user',
477  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
478  ],
479  'dir' => [
480  ApiBase::PARAM_DFLT => 'older',
482  'newer',
483  'older'
484  ],
485  ApiHelp::PARAM_HELP_MSG => 'api-help-param-direction',
486  ],
487  'limit' => [
488  ApiBase::PARAM_DFLT => 10,
489  ApiBase::PARAM_TYPE => 'limit',
490  ApiBase::PARAM_MIN => 1,
493  ],
494  'prop' => [
495  ApiBase::PARAM_ISMULTI => true,
496  ApiBase::PARAM_DFLT => 'ids|title|flags',
499  'ids',
500  'title',
501  'flags',
502  'user',
503  'userid',
504  'comment',
505  'parsedcomment',
506  'timestamp',
507  'patrol',
508  'sizes',
509  'notificationtimestamp',
510  'loginfo',
511  'tags',
512  'expiry',
513  ]
514  ],
515  'show' => [
516  ApiBase::PARAM_ISMULTI => true,
530  ]
531  ],
532  'type' => [
533  ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
534  ApiBase::PARAM_ISMULTI => true,
537  ],
538  'owner' => [
539  ApiBase::PARAM_TYPE => 'user',
540  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name' ],
541  ],
542  'token' => [
543  ApiBase::PARAM_TYPE => 'string',
544  ApiBase::PARAM_SENSITIVE => true,
545  ],
546  'continue' => [
547  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
548  ],
549  ];
550  }
551 
552  protected function getExamplesMessages() {
553  return [
554  'action=query&list=watchlist'
555  => 'apihelp-query+watchlist-example-simple',
556  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
557  => 'apihelp-query+watchlist-example-props',
558  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment|expiry'
559  => 'apihelp-query+watchlist-example-expiry',
560  'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
561  => 'apihelp-query+watchlist-example-allrev',
562  'action=query&generator=watchlist&prop=info'
563  => 'apihelp-query+watchlist-example-generator',
564  'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
565  => 'apihelp-query+watchlist-example-generator-rev',
566  'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
567  => 'apihelp-query+watchlist-example-wlowner',
568  ];
569  }
570 
571  public function getHelpUrls() {
572  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Watchlist';
573  }
574 }
ApiQueryWatchlist\$fld_title
$fld_title
Definition: ApiQueryWatchlist.php:61
ApiQuery
This is the main query class.
Definition: ApiQuery.php:37
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:47
WatchedItemQueryService\INCLUDE_COMMENT
const INCLUDE_COMMENT
Definition: WatchedItemQueryService.php:31
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:180
WatchedItemQueryService\FILTER_NOT_AUTOPATROLLED
const FILTER_NOT_AUTOPATROLLED
Definition: WatchedItemQueryService.php:50
WatchedItemQueryService\FILTER_PATROLLED
const FILTER_PATROLLED
Definition: WatchedItemQueryService.php:47
ApiQueryWatchlist\$fld_user
$fld_user
Definition: ApiQueryWatchlist.php:62
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1382
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:105
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1692
ApiBase\PARAM_TYPE
const PARAM_TYPE
Definition: ApiBase.php:72
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:571
ApiQueryWatchlist\$fld_userid
$fld_userid
Definition: ApiQueryWatchlist.php:64
LogEventsList\userCanBitfield
static userCanBitfield( $bitfield, $field, Authority $performer)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:545
RecentChange\getChangeTypes
static getChangeTypes()
Get an array of all change types.
Definition: RecentChange.php:206
CommentStore
Handle database storage of comments such as edit summaries and log reasons.
Definition: CommentStore.php:42
ApiQueryWatchlist\$fld_loginfo
$fld_loginfo
Definition: ApiQueryWatchlist.php:65
ApiQueryWatchlist\$fld_notificationtimestamp
$fld_notificationtimestamp
Definition: ApiQueryWatchlist.php:64
RecentChange\parseToRCType
static parseToRCType( $type)
Parsing text to RC_* constants.
Definition: RecentChange.php:173
RC_NEW
const RC_NEW
Definition: Defines.php:116
ContextSource\getUser
getUser()
Definition: ContextSource.php:135
WatchedItemQueryService\INCLUDE_TAGS
const INCLUDE_TAGS
Definition: WatchedItemQueryService.php:36
ApiBase\PARAM_SENSITIVE
const PARAM_SENSITIVE
Definition: ApiBase.php:83
Title\castFromPageIdentity
static castFromPageIdentity(?PageIdentity $pageIdentity)
Return a Title for a given PageIdentity.
Definition: Title.php:334
Wikimedia\ParamValidator\ParamValidator::TypeDef\UserDef
Type definition for user types.
Definition: UserDef.php:24
WatchedItemQueryService\INCLUDE_LOG_INFO
const INCLUDE_LOG_INFO
Definition: WatchedItemQueryService.php:35
RC_LOG
const RC_LOG
Definition: Defines.php:117
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
Definition: ApiQueryGeneratorBase.php:83
WatchedItem\getExpiry
getExpiry(?int $style=TS_MW)
When the watched item will expire.
Definition: WatchedItem.php:160
ApiBase\PARAM_MIN
const PARAM_MIN
Definition: ApiBase.php:75
LogFormatter\newFromRow
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
Definition: LogFormatter.php:74
ApiQueryWatchlist\$fld_sizes
$fld_sizes
Definition: ApiQueryWatchlist.php:63
WatchedItemQueryService\FILTER_MINOR
const FILTER_MINOR
Definition: WatchedItemQueryService.php:41
WatchedItemQueryService\INCLUDE_AUTOPATROL_INFO
const INCLUDE_AUTOPATROL_INFO
Definition: WatchedItemQueryService.php:33
WatchedItemQueryService\INCLUDE_USER
const INCLUDE_USER
Definition: WatchedItemQueryService.php:29
ApiBase\LIMIT_BIG1
const LIMIT_BIG1
Fast query, standard limit.
Definition: ApiBase.php:163
WatchedItemQueryService\FILTER_NOT_BOT
const FILTER_NOT_BOT
Definition: WatchedItemQueryService.php:44
WatchedItemQueryService\INCLUDE_PATROL_INFO
const INCLUDE_PATROL_INFO
Definition: WatchedItemQueryService.php:32
ApiBase\PARAM_MAX
const PARAM_MAX
Definition: ApiBase.php:73
ApiQueryWatchlist\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQueryWatchlist.php:458
ApiQueryWatchlist\getFieldsToInclude
getFieldsToInclude()
Definition: ApiQueryWatchlist.php:246
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:718
WatchedItemQueryService\FILTER_BOT
const FILTER_BOT
Definition: WatchedItemQueryService.php:43
$title
$title
Definition: testCompression.php:38
WatchedItemQueryService\INCLUDE_USER_ID
const INCLUDE_USER_ID
Definition: WatchedItemQueryService.php:30
ApiQueryWatchlist\executeGenerator
executeGenerator( $resultPageSet)
Execute this module as a generator.
Definition: ApiQueryWatchlist.php:57
ApiQueryWatchlist\showParamsConflicting
showParamsConflicting(array $show)
Definition: ApiQueryWatchlist.php:276
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:39
ApiQueryWatchlist\__construct
__construct(ApiQuery $query, $moduleName, CommentStore $commentStore)
Definition: ApiQueryWatchlist.php:44
ApiQueryWatchlist\$commentStore
CommentStore $commentStore
Definition: ApiQueryWatchlist.php:37
WatchedItemQueryService\DIR_NEWER
const DIR_NEWER
Definition: WatchedItemQueryService.php:26
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:607
ApiBase\getWatchlistUser
getWatchlistUser( $params)
Gets the user for whom to get the watchlist.
Definition: ApiBase.php:1134
ApiBase\requireMaxOneParameter
requireMaxOneParameter( $params,... $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:890
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:1565
WatchedItem
Representation of a pair of user and title for watchlist entries.
Definition: WatchedItem.php:36
WatchedItemQueryService\FILTER_NOT_PATROLLED
const FILTER_NOT_PATROLLED
Definition: WatchedItemQueryService.php:48
ApiQueryWatchlist\$fld_timestamp
$fld_timestamp
Definition: ApiQueryWatchlist.php:62
WatchedItemQueryService\FILTER_NOT_MINOR
const FILTER_NOT_MINOR
Definition: WatchedItemQueryService.php:42
WatchedItem\getTarget
getTarget()
Definition: WatchedItem.php:139
WatchedItemQueryService\INCLUDE_FLAGS
const INCLUDE_FLAGS
Definition: WatchedItemQueryService.php:28
ApiQueryWatchlist\extractOutputData
extractOutputData(WatchedItem $watchedItem, array $recentChangeInfo)
Definition: ApiQueryWatchlist.php:293
RecentChange\PRC_AUTOPATROLLED
const PRC_AUTOPATROLLED
Definition: RecentChange.php:93
ApiQueryWatchlist\$fld_expiry
bool $fld_expiry
Definition: ApiQueryWatchlist.php:68
Title\newFromLinkTarget
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition: Title.php:297
Linker\formatComment
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Definition: Linker.php:1208
ApiQueryGeneratorBase
Definition: ApiQueryGeneratorBase.php:28
WatchedItemQueryService\DIR_OLDER
const DIR_OLDER
Definition: WatchedItemQueryService.php:25
ApiQueryWatchlist\$fld_tags
$fld_tags
Definition: ApiQueryWatchlist.php:65
ApiQueryWatchlist\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryWatchlist.php:571
ApiQueryWatchlist
This query action allows clients to retrieve a list of recently modified pages that are part of the l...
Definition: ApiQueryWatchlist.php:34
ApiQueryBase\selectNamedDB
selectNamedDB( $name, $db, $groups)
Selects the query database connection with the given name.
Definition: ApiQueryBase.php:133
ApiQueryWatchlist\$fld_ids
$fld_ids
Definition: ApiQueryWatchlist.php:61
ApiBase\LIMIT_BIG2
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition: ApiBase.php:165
WatchedItemQueryService\FILTER_AUTOPATROLLED
const FILTER_AUTOPATROLLED
Definition: WatchedItemQueryService.php:49
WatchedItemQueryService\FILTER_NOT_UNREAD
const FILTER_NOT_UNREAD
Definition: WatchedItemQueryService.php:52
RecentChange\parseFromRCType
static parseFromRCType( $rcType)
Parsing RC_* constants to human-readable test.
Definition: RecentChange.php:195
ApiQueryWatchlist\$fld_patrol
$fld_patrol
Definition: ApiQueryWatchlist.php:61
ApiBase\PARAM_DFLT
const PARAM_DFLT
Definition: ApiBase.php:70
RecentChange\PRC_UNPATROLLED
const PRC_UNPATROLLED
Definition: RecentChange.php:91
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:440
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
Definition: ApiBase.php:71
WatchedItemQueryService\FILTER_NOT_ANON
const FILTER_NOT_ANON
Definition: WatchedItemQueryService.php:46
ApiQueryWatchlist\$fld_comment
$fld_comment
Definition: ApiQueryWatchlist.php:63
ApiBase\PARAM_MAX2
const PARAM_MAX2
Definition: ApiBase.php:74
ApiQueryWatchlist\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: ApiQueryWatchlist.php:53
WatchedItem\getNotificationTimestamp
getNotificationTimestamp()
Get the notification timestamp of this entry.
Definition: WatchedItem.php:148
ChangesList\isUnpatrolled
static isUnpatrolled( $rc, User $user)
Definition: ChangesList.php:878
ApiQueryWatchlist\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryWatchlist.php:552
WatchedItemQueryService\INCLUDE_SIZES
const INCLUDE_SIZES
Definition: WatchedItemQueryService.php:34
ApiQueryWatchlist\$fld_parsedcomment
$fld_parsedcomment
Definition: ApiQueryWatchlist.php:63
MediaWiki\Linker\LinkTarget
Definition: LinkTarget.php:26
ApiBase\PARAM_HELP_MSG_PER_VALUE
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
Definition: ApiBase.php:138
ApiQueryWatchlist\run
run( $resultPageSet=null)
Definition: ApiQueryWatchlist.php:74
ApiBase\getHookRunner
getHookRunner()
Get an ApiHookRunner for running core API hooks.
Definition: ApiBase.php:664
WatchedItemQueryService\FILTER_ANON
const FILTER_ANON
Definition: WatchedItemQueryService.php:45
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:1577
WatchedItemQueryService\FILTER_UNREAD
const FILTER_UNREAD
Definition: WatchedItemQueryService.php:51
ApiQueryWatchlist\$fld_flags
$fld_flags
Definition: ApiQueryWatchlist.php:62
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:466
$type
$type
Definition: testCompression.php:52