MediaWiki  master
ApiQueryWatchlist.php
Go to the documentation of this file.
1 <?php
26 
34 
36  private $commentStore;
37 
40 
43 
45  private $namespaceInfo;
46 
48  private $genderCache;
49 
59  public function __construct(
60  ApiQuery $query,
61  $moduleName,
67  ) {
68  parent::__construct( $query, $moduleName, 'wl' );
69  $this->commentStore = $commentStore;
70  $this->watchedItemQueryService = $watchedItemQueryService;
71  $this->contentLanguage = $contentLanguage;
72  $this->namespaceInfo = $namespaceInfo;
73  $this->genderCache = $genderCache;
74  }
75 
76  public function execute() {
77  $this->run();
78  }
79 
80  public function executeGenerator( $resultPageSet ) {
81  $this->run( $resultPageSet );
82  }
83 
84  private $fld_ids = false, $fld_title = false, $fld_patrol = false,
85  $fld_flags = false, $fld_timestamp = false, $fld_user = false,
86  $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
89 
91  private $fld_expiry = false;
92 
97  private function run( $resultPageSet = null ) {
98  $this->selectNamedDB( 'watchlist', DB_REPLICA, 'watchlist' );
99 
100  $params = $this->extractRequestParams();
101 
102  $user = $this->getUser();
103  $wlowner = $this->getWatchlistUser( $params );
104 
105  if ( $params['prop'] !== null && $resultPageSet === null ) {
106  $prop = array_fill_keys( $params['prop'], true );
107 
108  $this->fld_ids = isset( $prop['ids'] );
109  $this->fld_title = isset( $prop['title'] );
110  $this->fld_flags = isset( $prop['flags'] );
111  $this->fld_user = isset( $prop['user'] );
112  $this->fld_userid = isset( $prop['userid'] );
113  $this->fld_comment = isset( $prop['comment'] );
114  $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
115  $this->fld_timestamp = isset( $prop['timestamp'] );
116  $this->fld_sizes = isset( $prop['sizes'] );
117  $this->fld_patrol = isset( $prop['patrol'] );
118  $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
119  $this->fld_loginfo = isset( $prop['loginfo'] );
120  $this->fld_tags = isset( $prop['tags'] );
121  $this->fld_expiry = isset( $prop['expiry'] );
122 
123  if ( $this->fld_patrol && !$user->useRCPatrol() && !$user->useNPPatrol() ) {
124  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'patrol' );
125  }
126  }
127 
128  $options = [
129  'dir' => $params['dir'] === 'older'
132  ];
133 
134  if ( $resultPageSet === null ) {
135  $options['includeFields'] = $this->getFieldsToInclude();
136  } else {
137  $options['usedInGenerator'] = true;
138  }
139 
140  if ( $params['start'] ) {
141  $options['start'] = $params['start'];
142  }
143  if ( $params['end'] ) {
144  $options['end'] = $params['end'];
145  }
146 
147  $startFrom = null;
148  if ( $params['continue'] !== null ) {
149  $cont = explode( '|', $params['continue'] );
150  $this->dieContinueUsageIf( count( $cont ) != 2 );
151  $continueTimestamp = $cont[0];
152  $continueId = (int)$cont[1];
153  $this->dieContinueUsageIf( $continueId != $cont[1] );
154  $startFrom = [ $continueTimestamp, $continueId ];
155  }
156 
157  if ( $wlowner !== $user ) {
158  $options['watchlistOwner'] = $wlowner;
159  $options['watchlistOwnerToken'] = $params['token'];
160  }
161 
162  if ( $params['namespace'] !== null ) {
163  $options['namespaceIds'] = $params['namespace'];
164  }
165 
166  if ( $params['allrev'] ) {
167  $options['allRevisions'] = true;
168  }
169 
170  if ( $params['show'] !== null ) {
171  $show = array_fill_keys( $params['show'], true );
172 
173  /* Check for conflicting parameters. */
174  if ( $this->showParamsConflicting( $show ) ) {
175  $this->dieWithError( 'apierror-show' );
176  }
177 
178  // Check permissions.
179  if ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
181  ) {
182  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
183  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
184  }
185  }
186 
187  $options['filters'] = array_keys( $show );
188  }
189 
190  if ( $params['type'] !== null ) {
191  try {
192  $rcTypes = RecentChange::parseToRCType( $params['type'] );
193  if ( $rcTypes ) {
194  $options['rcTypes'] = $rcTypes;
195  }
196  } catch ( Exception $e ) {
197  ApiBase::dieDebug( __METHOD__, $e->getMessage() );
198  }
199  }
200 
201  $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
202  if ( $params['user'] !== null ) {
203  $options['onlyByUser'] = $params['user'];
204  }
205  if ( $params['excludeuser'] !== null ) {
206  $options['notByUser'] = $params['excludeuser'];
207  }
208 
209  $options['limit'] = $params['limit'];
210 
211  $this->getHookRunner()->onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions(
212  $this, $params, $options );
213 
214  $ids = [];
215  $items = $this->watchedItemQueryService->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
216 
217  // Get gender information
218  if ( $items !== [] && $resultPageSet === null && $this->fld_title &&
219  $this->contentLanguage->needsGenderDistinction()
220  ) {
221  $usernames = [];
222  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
224  $linkTarget = $watchedItem->getTarget();
225  if ( $this->namespaceInfo->hasGenderDistinction( $linkTarget->getNamespace() ) ) {
226  $usernames[] = $linkTarget->getText();
227  }
228  }
229  if ( $usernames !== [] ) {
230  $this->genderCache->doQuery( $usernames, __METHOD__ );
231  }
232  }
233 
234  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
236  if ( $resultPageSet === null ) {
237  $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
238  $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
239  if ( !$fit ) {
240  $startFrom = [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ];
241  break;
242  }
243  } elseif ( $params['allrev'] ) {
244  $ids[] = (int)$recentChangeInfo['rc_this_oldid'];
245  } else {
246  $ids[] = (int)$recentChangeInfo['rc_cur_id'];
247  }
248  }
249 
250  if ( $startFrom !== null ) {
251  $this->setContinueEnumParameter( 'continue', implode( '|', $startFrom ) );
252  }
253 
254  if ( $resultPageSet === null ) {
255  $this->getResult()->addIndexedTagName(
256  [ 'query', $this->getModuleName() ],
257  'item'
258  );
259  } elseif ( $params['allrev'] ) {
260  $resultPageSet->populateFromRevisionIDs( $ids );
261  } else {
262  $resultPageSet->populateFromPageIDs( $ids );
263  }
264  }
265 
266  private function getFieldsToInclude() {
267  $includeFields = [];
268  if ( $this->fld_flags ) {
269  $includeFields[] = WatchedItemQueryService::INCLUDE_FLAGS;
270  }
271  if ( $this->fld_user || $this->fld_userid || $this->fld_loginfo ) {
272  $includeFields[] = WatchedItemQueryService::INCLUDE_USER_ID;
273  }
274  if ( $this->fld_user || $this->fld_loginfo ) {
275  $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
276  }
277  if ( $this->fld_comment || $this->fld_parsedcomment ) {
278  $includeFields[] = WatchedItemQueryService::INCLUDE_COMMENT;
279  }
280  if ( $this->fld_patrol ) {
283  }
284  if ( $this->fld_sizes ) {
285  $includeFields[] = WatchedItemQueryService::INCLUDE_SIZES;
286  }
287  if ( $this->fld_loginfo ) {
289  }
290  if ( $this->fld_tags ) {
291  $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
292  }
293  return $includeFields;
294  }
295 
296  private function showParamsConflicting( array $show ) {
297  return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
298  && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
299  || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
300  && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
301  || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
302  && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
303  || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
309  || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
310  && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
311  }
312 
313  private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
314  /* Determine the title of the page that has been changed. */
315  $target = $watchedItem->getTarget();
316  if ( $target instanceof LinkTarget ) {
317  $title = Title::newFromLinkTarget( $target );
318  } else {
319  $title = Title::castFromPageIdentity( $target );
320  }
321  $user = $this->getUser();
322 
323  /* Our output data. */
324  $vals = [];
325  $type = (int)$recentChangeInfo['rc_type'];
326  $vals['type'] = RecentChange::parseFromRCType( $type );
327  $anyHidden = false;
328 
329  /* Create a new entry in the result for the title. */
330  if ( $this->fld_title || $this->fld_ids ) {
331  // These should already have been filtered out of the query, but just in case.
332  if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
333  $vals['actionhidden'] = true;
334  $anyHidden = true;
335  }
336  if ( $type !== RC_LOG ||
338  $recentChangeInfo['rc_deleted'],
340  $user
341  )
342  ) {
343  if ( $this->fld_title ) {
345  }
346  if ( $this->fld_ids ) {
347  $vals['pageid'] = (int)$recentChangeInfo['rc_cur_id'];
348  $vals['revid'] = (int)$recentChangeInfo['rc_this_oldid'];
349  $vals['old_revid'] = (int)$recentChangeInfo['rc_last_oldid'];
350  }
351  }
352  }
353 
354  /* Add user data and 'anon' flag, if user is anonymous. */
355  if ( $this->fld_user || $this->fld_userid ) {
356  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_USER ) {
357  $vals['userhidden'] = true;
358  $anyHidden = true;
359  }
360  if ( RevisionRecord::userCanBitfield(
361  $recentChangeInfo['rc_deleted'],
362  RevisionRecord::DELETED_USER,
363  $user
364  ) ) {
365  if ( $this->fld_userid ) {
366  $vals['userid'] = (int)$recentChangeInfo['rc_user'];
367  // for backwards compatibility
368  $vals['user'] = (int)$recentChangeInfo['rc_user'];
369  }
370 
371  if ( $this->fld_user ) {
372  $vals['user'] = $recentChangeInfo['rc_user_text'];
373  }
374 
375  $vals['anon'] = !$recentChangeInfo['rc_user'];
376  }
377  }
378 
379  /* Add flags, such as new, minor, bot. */
380  if ( $this->fld_flags ) {
381  $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
382  $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
383  $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
384  }
385 
386  /* Add sizes of each revision. (Only available on 1.10+) */
387  if ( $this->fld_sizes ) {
388  $vals['oldlen'] = (int)$recentChangeInfo['rc_old_len'];
389  $vals['newlen'] = (int)$recentChangeInfo['rc_new_len'];
390  }
391 
392  /* Add the timestamp. */
393  if ( $this->fld_timestamp ) {
394  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
395  }
396 
397  if ( $this->fld_notificationtimestamp ) {
398  $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
399  ? ''
400  : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
401  }
402 
403  /* Add edit summary / log summary. */
404  if ( $this->fld_comment || $this->fld_parsedcomment ) {
405  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_COMMENT ) {
406  $vals['commenthidden'] = true;
407  $anyHidden = true;
408  }
409  if ( RevisionRecord::userCanBitfield(
410  $recentChangeInfo['rc_deleted'],
411  RevisionRecord::DELETED_COMMENT,
412  $user
413  ) ) {
414  $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text;
415  if ( $this->fld_comment ) {
416  $vals['comment'] = $comment;
417  }
418 
419  if ( $this->fld_parsedcomment ) {
420  $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
421  }
422  }
423  }
424 
425  /* Add the patrolled flag */
426  if ( $this->fld_patrol ) {
427  $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] != RecentChange::PRC_UNPATROLLED;
428  $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
429  $vals['autopatrolled'] = $recentChangeInfo['rc_patrolled'] == RecentChange::PRC_AUTOPATROLLED;
430  }
431 
432  if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
433  if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
434  $vals['actionhidden'] = true;
435  $anyHidden = true;
436  }
438  $recentChangeInfo['rc_deleted'],
440  $user
441  ) ) {
442  $vals['logid'] = (int)$recentChangeInfo['rc_logid'];
443  $vals['logtype'] = $recentChangeInfo['rc_log_type'];
444  $vals['logaction'] = $recentChangeInfo['rc_log_action'];
445 
446  $logFormatter = LogFormatter::newFromRow( $recentChangeInfo );
447  $vals['logparams'] = $logFormatter->formatParametersForApi();
448  $vals['logdisplay'] = $logFormatter->getActionText();
449  }
450  }
451 
452  if ( $this->fld_tags ) {
453  if ( $recentChangeInfo['rc_tags'] ) {
454  $tags = explode( ',', $recentChangeInfo['rc_tags'] );
455  ApiResult::setIndexedTagName( $tags, 'tag' );
456  $vals['tags'] = $tags;
457  } else {
458  $vals['tags'] = [];
459  }
460  }
461 
462  if ( $this->fld_expiry ) {
463  // Add expiration, T263796
464  $expiry = $watchedItem->getExpiry( TS_ISO_8601 );
465  $vals['expiry'] = ( $expiry ?? false );
466  }
467 
468  if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_RESTRICTED ) ) {
469  $vals['suppressed'] = true;
470  }
471 
472  $this->getHookRunner()->onApiQueryWatchlistExtractOutputData(
473  $this, $watchedItem, $recentChangeInfo, $vals );
474 
475  return $vals;
476  }
477 
478  public function getAllowedParams() {
479  return [
480  'allrev' => false,
481  'start' => [
482  ApiBase::PARAM_TYPE => 'timestamp'
483  ],
484  'end' => [
485  ApiBase::PARAM_TYPE => 'timestamp'
486  ],
487  'namespace' => [
488  ApiBase::PARAM_ISMULTI => true,
489  ApiBase::PARAM_TYPE => 'namespace'
490  ],
491  'user' => [
492  ApiBase::PARAM_TYPE => 'user',
493  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
494  ],
495  'excludeuser' => [
496  ApiBase::PARAM_TYPE => 'user',
497  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
498  ],
499  'dir' => [
500  ApiBase::PARAM_DFLT => 'older',
502  'newer',
503  'older'
504  ],
505  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
506  ],
507  'limit' => [
508  ApiBase::PARAM_DFLT => 10,
509  ApiBase::PARAM_TYPE => 'limit',
510  ApiBase::PARAM_MIN => 1,
513  ],
514  'prop' => [
515  ApiBase::PARAM_ISMULTI => true,
516  ApiBase::PARAM_DFLT => 'ids|title|flags',
519  'ids',
520  'title',
521  'flags',
522  'user',
523  'userid',
524  'comment',
525  'parsedcomment',
526  'timestamp',
527  'patrol',
528  'sizes',
529  'notificationtimestamp',
530  'loginfo',
531  'tags',
532  'expiry',
533  ]
534  ],
535  'show' => [
536  ApiBase::PARAM_ISMULTI => true,
550  ]
551  ],
552  'type' => [
553  ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
554  ApiBase::PARAM_ISMULTI => true,
557  ],
558  'owner' => [
559  ApiBase::PARAM_TYPE => 'user',
560  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name' ],
561  ],
562  'token' => [
563  ApiBase::PARAM_TYPE => 'string',
564  ApiBase::PARAM_SENSITIVE => true,
565  ],
566  'continue' => [
567  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
568  ],
569  ];
570  }
571 
572  protected function getExamplesMessages() {
573  return [
574  'action=query&list=watchlist'
575  => 'apihelp-query+watchlist-example-simple',
576  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
577  => 'apihelp-query+watchlist-example-props',
578  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment|expiry'
579  => 'apihelp-query+watchlist-example-expiry',
580  'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
581  => 'apihelp-query+watchlist-example-allrev',
582  'action=query&generator=watchlist&prop=info'
583  => 'apihelp-query+watchlist-example-generator',
584  'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
585  => 'apihelp-query+watchlist-example-generator-rev',
586  'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
587  => 'apihelp-query+watchlist-example-wlowner',
588  ];
589  }
590 
591  public function getHelpUrls() {
592  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Watchlist';
593  }
594 }
ApiQueryWatchlist\$fld_title
$fld_title
Definition: ApiQueryWatchlist.php:84
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
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:85
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1379
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:1691
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:87
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:535
GenderCache
Caches user genders when needed to use correct namespace aliases.
Definition: GenderCache.php:36
RecentChange\getChangeTypes
static getChangeTypes()
Get an array of all change types.
Definition: RecentChange.php:203
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:88
ApiQueryWatchlist\$fld_notificationtimestamp
$fld_notificationtimestamp
Definition: ApiQueryWatchlist.php:87
ApiQueryWatchlist\$contentLanguage
Language $contentLanguage
Definition: ApiQueryWatchlist.php:42
RecentChange\parseToRCType
static parseToRCType( $type)
Parsing text to RC_* constants.
Definition: RecentChange.php:170
RC_NEW
const RC_NEW
Definition: Defines.php:116
ContextSource\getUser
getUser()
Definition: ContextSource.php:136
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:332
Wikimedia\ParamValidator\ParamValidator::TypeDef\UserDef
Type definition for user types.
Definition: UserDef.php:26
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
ApiQueryWatchlist\$genderCache
GenderCache $genderCache
Definition: ApiQueryWatchlist.php:48
WatchedItem\getExpiry
getExpiry(?int $style=TS_MW)
When the watched item will expire.
Definition: WatchedItem.php:150
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:86
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
Definition: WatchedItemQueryService.php:23
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:478
ApiQueryWatchlist\getFieldsToInclude
getFieldsToInclude()
Definition: ApiQueryWatchlist.php:266
ApiQueryWatchlist\$watchedItemQueryService
WatchedItemQueryService $watchedItemQueryService
Definition: ApiQueryWatchlist.php:39
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:707
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:80
ApiQueryWatchlist\showParamsConflicting
showParamsConflicting(array $show)
Definition: ApiQueryWatchlist.php:296
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:39
ApiQueryWatchlist\$commentStore
CommentStore $commentStore
Definition: ApiQueryWatchlist.php:36
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:603
ApiBase\getWatchlistUser
getWatchlistUser( $params)
Gets the user for whom to get the watchlist.
Definition: ApiBase.php:1123
ApiBase\requireMaxOneParameter
requireMaxOneParameter( $params,... $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:879
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:1569
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:85
WatchedItemQueryService\FILTER_NOT_MINOR
const FILTER_NOT_MINOR
Definition: WatchedItemQueryService.php:42
WatchedItem\getTarget
getTarget()
Definition: WatchedItem.php:129
WatchedItemQueryService\INCLUDE_FLAGS
const INCLUDE_FLAGS
Definition: WatchedItemQueryService.php:28
ApiQueryWatchlist\extractOutputData
extractOutputData(WatchedItem $watchedItem, array $recentChangeInfo)
Definition: ApiQueryWatchlist.php:313
RecentChange\PRC_AUTOPATROLLED
const PRC_AUTOPATROLLED
Definition: RecentChange.php:93
ApiQueryWatchlist\$fld_expiry
bool $fld_expiry
Definition: ApiQueryWatchlist.php:91
Title\newFromLinkTarget
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition: Title.php:295
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:1372
ApiQueryGeneratorBase
Definition: ApiQueryGeneratorBase.php:28
WatchedItemQueryService\DIR_OLDER
const DIR_OLDER
Definition: WatchedItemQueryService.php:25
ApiQueryWatchlist\$fld_tags
$fld_tags
Definition: ApiQueryWatchlist.php:88
ApiQueryWatchlist\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryWatchlist.php:591
ApiQueryWatchlist
This query action allows clients to retrieve a list of recently modified pages that are part of the l...
Definition: ApiQueryWatchlist.php:33
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:84
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:192
ApiQueryWatchlist\$fld_patrol
$fld_patrol
Definition: ApiQueryWatchlist.php:84
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:86
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:76
WatchedItem\getNotificationTimestamp
getNotificationTimestamp()
Get the notification timestamp of this entry.
Definition: WatchedItem.php:138
NamespaceInfo
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Definition: NamespaceInfo.php:35
ChangesList\isUnpatrolled
static isUnpatrolled( $rc, User $user)
Definition: ChangesList.php:864
ApiQueryWatchlist\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryWatchlist.php:572
WatchedItemQueryService\INCLUDE_SIZES
const INCLUDE_SIZES
Definition: WatchedItemQueryService.php:34
ApiQueryWatchlist\$fld_parsedcomment
$fld_parsedcomment
Definition: ApiQueryWatchlist.php:86
ApiQueryWatchlist\$namespaceInfo
NamespaceInfo $namespaceInfo
Definition: ApiQueryWatchlist.php:45
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:97
ApiBase\getHookRunner
getHookRunner()
Get an ApiHookRunner for running core API hooks.
Definition: ApiBase.php:653
WatchedItemQueryService\FILTER_ANON
const FILTER_ANON
Definition: WatchedItemQueryService.php:45
ApiQueryWatchlist\__construct
__construct(ApiQuery $query, $moduleName, CommentStore $commentStore, WatchedItemQueryService $watchedItemQueryService, Language $contentLanguage, NamespaceInfo $namespaceInfo, GenderCache $genderCache)
Definition: ApiQueryWatchlist.php:59
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:1582
WatchedItemQueryService\FILTER_UNREAD
const FILTER_UNREAD
Definition: WatchedItemQueryService.php:51
ApiQueryWatchlist\$fld_flags
$fld_flags
Definition: ApiQueryWatchlist.php:85
Language
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition: Language.php:42
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