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  $this->getHookRunner()->onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions(
178  $this, $params, $options );
179 
180  $ids = [];
181  $services = MediaWikiServices::getInstance();
182  $watchedItemQuery = $services->getWatchedItemQueryService();
183  $items = $watchedItemQuery->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
184 
185  // Get gender information
186  if ( $items !== [] && $resultPageSet === null && $this->fld_title &&
187  $services->getContentLanguage()->needsGenderDistinction()
188  ) {
189  $nsInfo = $services->getNamespaceInfo();
190  $usernames = [];
191  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
193  $linkTarget = $watchedItem->getLinkTarget();
194  if ( $nsInfo->hasGenderDistinction( $linkTarget->getNamespace() ) ) {
195  $usernames[] = $linkTarget->getText();
196  }
197  }
198  if ( $usernames !== [] ) {
199  $services->getGenderCache()->doQuery( $usernames, __METHOD__ );
200  }
201  }
202 
203  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
205  if ( $resultPageSet === null ) {
206  $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
207  $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
208  if ( !$fit ) {
209  $startFrom = [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ];
210  break;
211  }
212  } elseif ( $params['allrev'] ) {
213  $ids[] = (int)$recentChangeInfo['rc_this_oldid'];
214  } else {
215  $ids[] = (int)$recentChangeInfo['rc_cur_id'];
216  }
217  }
218 
219  if ( $startFrom !== null ) {
220  $this->setContinueEnumParameter( 'continue', implode( '|', $startFrom ) );
221  }
222 
223  if ( $resultPageSet === null ) {
224  $this->getResult()->addIndexedTagName(
225  [ 'query', $this->getModuleName() ],
226  'item'
227  );
228  } elseif ( $params['allrev'] ) {
229  $resultPageSet->populateFromRevisionIDs( $ids );
230  } else {
231  $resultPageSet->populateFromPageIDs( $ids );
232  }
233  }
234 
235  private function getFieldsToInclude() {
236  $includeFields = [];
237  if ( $this->fld_flags ) {
238  $includeFields[] = WatchedItemQueryService::INCLUDE_FLAGS;
239  }
240  if ( $this->fld_user || $this->fld_userid ) {
241  $includeFields[] = WatchedItemQueryService::INCLUDE_USER_ID;
242  }
243  if ( $this->fld_user ) {
244  $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
245  }
246  if ( $this->fld_comment || $this->fld_parsedcomment ) {
247  $includeFields[] = WatchedItemQueryService::INCLUDE_COMMENT;
248  }
249  if ( $this->fld_patrol ) {
252  }
253  if ( $this->fld_sizes ) {
254  $includeFields[] = WatchedItemQueryService::INCLUDE_SIZES;
255  }
256  if ( $this->fld_loginfo ) {
258  }
259  if ( $this->fld_tags ) {
260  $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
261  }
262  return $includeFields;
263  }
264 
265  private function showParamsConflicting( array $show ) {
266  return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
267  && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
268  || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
269  && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
270  || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
271  && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
272  || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
278  || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
279  && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
280  }
281 
282  private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
283  /* Determine the title of the page that has been changed. */
284  $title = Title::newFromLinkTarget( $watchedItem->getLinkTarget() );
285  $user = $this->getUser();
286 
287  /* Our output data. */
288  $vals = [];
289  $type = (int)$recentChangeInfo['rc_type'];
290  $vals['type'] = RecentChange::parseFromRCType( $type );
291  $anyHidden = false;
292 
293  /* Create a new entry in the result for the title. */
294  if ( $this->fld_title || $this->fld_ids ) {
295  // These should already have been filtered out of the query, but just in case.
296  if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
297  $vals['actionhidden'] = true;
298  $anyHidden = true;
299  }
300  if ( $type !== RC_LOG ||
302  $recentChangeInfo['rc_deleted'],
304  $user
305  )
306  ) {
307  if ( $this->fld_title ) {
309  }
310  if ( $this->fld_ids ) {
311  $vals['pageid'] = (int)$recentChangeInfo['rc_cur_id'];
312  $vals['revid'] = (int)$recentChangeInfo['rc_this_oldid'];
313  $vals['old_revid'] = (int)$recentChangeInfo['rc_last_oldid'];
314  }
315  }
316  }
317 
318  /* Add user data and 'anon' flag, if user is anonymous. */
319  if ( $this->fld_user || $this->fld_userid ) {
320  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_USER ) {
321  $vals['userhidden'] = true;
322  $anyHidden = true;
323  }
324  if ( RevisionRecord::userCanBitfield(
325  $recentChangeInfo['rc_deleted'],
326  RevisionRecord::DELETED_USER,
327  $user
328  ) ) {
329  if ( $this->fld_userid ) {
330  $vals['userid'] = (int)$recentChangeInfo['rc_user'];
331  // for backwards compatibility
332  $vals['user'] = (int)$recentChangeInfo['rc_user'];
333  }
334 
335  if ( $this->fld_user ) {
336  $vals['user'] = $recentChangeInfo['rc_user_text'];
337  }
338 
339  $vals['anon'] = $recentChangeInfo['rc_user'] == 0;
340  }
341  }
342 
343  /* Add flags, such as new, minor, bot. */
344  if ( $this->fld_flags ) {
345  $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
346  $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
347  $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
348  }
349 
350  /* Add sizes of each revision. (Only available on 1.10+) */
351  if ( $this->fld_sizes ) {
352  $vals['oldlen'] = (int)$recentChangeInfo['rc_old_len'];
353  $vals['newlen'] = (int)$recentChangeInfo['rc_new_len'];
354  }
355 
356  /* Add the timestamp. */
357  if ( $this->fld_timestamp ) {
358  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
359  }
360 
361  if ( $this->fld_notificationtimestamp ) {
362  $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
363  ? ''
364  : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
365  }
366 
367  /* Add edit summary / log summary. */
368  if ( $this->fld_comment || $this->fld_parsedcomment ) {
369  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_COMMENT ) {
370  $vals['commenthidden'] = true;
371  $anyHidden = true;
372  }
373  if ( RevisionRecord::userCanBitfield(
374  $recentChangeInfo['rc_deleted'],
375  RevisionRecord::DELETED_COMMENT,
376  $user
377  ) ) {
378  $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text;
379  if ( $this->fld_comment ) {
380  $vals['comment'] = $comment;
381  }
382 
383  if ( $this->fld_parsedcomment ) {
384  $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
385  }
386  }
387  }
388 
389  /* Add the patrolled flag */
390  if ( $this->fld_patrol ) {
391  $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] != RecentChange::PRC_UNPATROLLED;
392  $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
393  $vals['autopatrolled'] = $recentChangeInfo['rc_patrolled'] == RecentChange::PRC_AUTOPATROLLED;
394  }
395 
396  if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
397  if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
398  $vals['actionhidden'] = true;
399  $anyHidden = true;
400  }
402  $recentChangeInfo['rc_deleted'],
404  $user
405  ) ) {
406  $vals['logid'] = (int)$recentChangeInfo['rc_logid'];
407  $vals['logtype'] = $recentChangeInfo['rc_log_type'];
408  $vals['logaction'] = $recentChangeInfo['rc_log_action'];
409  $vals['logparams'] = LogFormatter::newFromRow( $recentChangeInfo )->formatParametersForApi();
410  }
411  }
412 
413  if ( $this->fld_tags ) {
414  if ( $recentChangeInfo['rc_tags'] ) {
415  $tags = explode( ',', $recentChangeInfo['rc_tags'] );
416  ApiResult::setIndexedTagName( $tags, 'tag' );
417  $vals['tags'] = $tags;
418  } else {
419  $vals['tags'] = [];
420  }
421  }
422 
423  if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_RESTRICTED ) ) {
424  $vals['suppressed'] = true;
425  }
426 
427  $this->getHookRunner()->onApiQueryWatchlistExtractOutputData(
428  $this, $watchedItem, $recentChangeInfo, $vals );
429 
430  return $vals;
431  }
432 
433  public function getAllowedParams() {
434  return [
435  'allrev' => false,
436  'start' => [
437  ApiBase::PARAM_TYPE => 'timestamp'
438  ],
439  'end' => [
440  ApiBase::PARAM_TYPE => 'timestamp'
441  ],
442  'namespace' => [
443  ApiBase::PARAM_ISMULTI => true,
444  ApiBase::PARAM_TYPE => 'namespace'
445  ],
446  'user' => [
447  ApiBase::PARAM_TYPE => 'user',
448  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
449  ],
450  'excludeuser' => [
451  ApiBase::PARAM_TYPE => 'user',
452  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
453  ],
454  'dir' => [
455  ApiBase::PARAM_DFLT => 'older',
457  'newer',
458  'older'
459  ],
460  ApiHelp::PARAM_HELP_MSG => 'api-help-param-direction',
461  ],
462  'limit' => [
463  ApiBase::PARAM_DFLT => 10,
464  ApiBase::PARAM_TYPE => 'limit',
465  ApiBase::PARAM_MIN => 1,
468  ],
469  'prop' => [
470  ApiBase::PARAM_ISMULTI => true,
471  ApiBase::PARAM_DFLT => 'ids|title|flags',
474  'ids',
475  'title',
476  'flags',
477  'user',
478  'userid',
479  'comment',
480  'parsedcomment',
481  'timestamp',
482  'patrol',
483  'sizes',
484  'notificationtimestamp',
485  'loginfo',
486  'tags',
487  ]
488  ],
489  'show' => [
490  ApiBase::PARAM_ISMULTI => true,
504  ]
505  ],
506  'type' => [
507  ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
508  ApiBase::PARAM_ISMULTI => true,
511  ],
512  'owner' => [
513  ApiBase::PARAM_TYPE => 'user',
514  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name' ],
515  ],
516  'token' => [
517  ApiBase::PARAM_TYPE => 'string',
518  ApiBase::PARAM_SENSITIVE => true,
519  ],
520  'continue' => [
521  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
522  ],
523  ];
524  }
525 
526  protected function getExamplesMessages() {
527  return [
528  'action=query&list=watchlist'
529  => 'apihelp-query+watchlist-example-simple',
530  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
531  => 'apihelp-query+watchlist-example-props',
532  'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
533  => 'apihelp-query+watchlist-example-allrev',
534  'action=query&generator=watchlist&prop=info'
535  => 'apihelp-query+watchlist-example-generator',
536  'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
537  => 'apihelp-query+watchlist-example-generator-rev',
538  'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
539  => 'apihelp-query+watchlist-example-wlowner',
540  ];
541  }
542 
543  public function getHelpUrls() {
544  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Watchlist';
545  }
546 }
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:31
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:154
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:51
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:107
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1808
ApiBase\PARAM_TYPE
const PARAM_TYPE
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:71
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:565
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:197
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:54
ApiQueryWatchlist\$fld_notificationtimestamp
$fld_notificationtimestamp
Definition: ApiQueryWatchlist.php:53
RecentChange\parseToRCType
static parseToRCType( $type)
Parsing text to RC_* constants.
Definition: RecentChange.php:164
ContextSource\getUser
getUser()
Stable to override.
Definition: ContextSource.php:131
WatchedItemQueryService\INCLUDE_TAGS
const INCLUDE_TAGS
Definition: WatchedItemQueryService.php:36
ApiBase\PARAM_SENSITIVE
const PARAM_SENSITIVE
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:82
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:35
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
Definition: ApiQueryGeneratorBase.php:83
ApiBase\PARAM_MIN
const PARAM_MIN
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:74
LogFormatter\newFromRow
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
Definition: LogFormatter.php:72
ApiQueryWatchlist\$fld_sizes
$fld_sizes
Definition: ApiQueryWatchlist.php:52
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:165
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
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:72
ApiQueryWatchlist\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQueryWatchlist.php:433
ApiQueryWatchlist\getFieldsToInclude
getFieldsToInclude()
Definition: ApiQueryWatchlist.php:235
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:717
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:46
ApiQueryWatchlist\showParamsConflicting
showParamsConflicting(array $show)
Definition: ApiQueryWatchlist.php:265
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:26
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:1133
ApiBase\requireMaxOneParameter
requireMaxOneParameter( $params,... $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:889
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:1562
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:48
ApiQueryWatchlist\$fld_timestamp
$fld_timestamp
Definition: ApiQueryWatchlist.php:51
WatchedItemQueryService\FILTER_NOT_MINOR
const FILTER_NOT_MINOR
Definition: WatchedItemQueryService.php:42
RC_NEW
const RC_NEW
Definition: Defines.php:132
WatchedItemQueryService\INCLUDE_FLAGS
const INCLUDE_FLAGS
Definition: WatchedItemQueryService.php:28
ApiQueryWatchlist\extractOutputData
extractOutputData(WatchedItem $watchedItem, array $recentChangeInfo)
Definition: ApiQueryWatchlist.php:282
RecentChange\PRC_AUTOPATROLLED
const PRC_AUTOPATROLLED
Definition: RecentChange.php:84
Title\newFromLinkTarget
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition: Title.php:281
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:1199
ApiQueryGeneratorBase
Stable to extend.
Definition: ApiQueryGeneratorBase.php:28
WatchedItemQueryService\DIR_OLDER
const DIR_OLDER
Definition: WatchedItemQueryService.php:25
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:543
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:135
ApiQueryWatchlist\$fld_ids
$fld_ids
Definition: ApiQueryWatchlist.php:50
ApiBase\LIMIT_BIG2
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition: ApiBase.php:167
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:560
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:186
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:69
RecentChange\PRC_UNPATROLLED
const PRC_UNPATROLLED
Definition: RecentChange.php:82
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:444
WatchedItem\getLinkTarget
getLinkTarget()
Definition: WatchedItem.php:114
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:70
WatchedItemQueryService\FILTER_NOT_ANON
const FILTER_NOT_ANON
Definition: WatchedItemQueryService.php:46
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:73
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:123
ChangesList\isUnpatrolled
static isUnpatrolled( $rc, User $user)
Definition: ChangesList.php:867
ApiQueryWatchlist\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryWatchlist.php:526
WatchedItemQueryService\INCLUDE_SIZES
const INCLUDE_SIZES
Definition: WatchedItemQueryService.php:34
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:140
ApiQueryWatchlist\run
run( $resultPageSet=null)
Definition: ApiQueryWatchlist.php:60
CommentStore\getStore
static getStore()
Definition: CommentStore.php:120
ApiBase\getHookRunner
getHookRunner()
Get an ApiHookRunner for running core API hooks.
Definition: ApiBase.php:662
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:1574
WatchedItemQueryService\FILTER_UNREAD
const FILTER_UNREAD
Definition: WatchedItemQueryService.php:51
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:470
ApiQueryWatchlist\__construct
__construct(ApiQuery $query, $moduleName)
Definition: ApiQueryWatchlist.php:38
$type
$type
Definition: testCompression.php:52