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