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