MediaWiki  1.34.0
ApiQueryWatchlist.php
Go to the documentation of this file.
1 <?php
25 
33 
35  private $commentStore;
36 
37  public function __construct( ApiQuery $query, $moduleName ) {
38  parent::__construct( $query, $moduleName, 'wl' );
39  }
40 
41  public function execute() {
42  $this->run();
43  }
44 
45  public function executeGenerator( $resultPageSet ) {
46  $this->run( $resultPageSet );
47  }
48 
49  private $fld_ids = false, $fld_title = false, $fld_patrol = false,
50  $fld_flags = false, $fld_timestamp = false, $fld_user = false,
51  $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
54 
59  private function run( $resultPageSet = null ) {
60  $this->selectNamedDB( 'watchlist', DB_REPLICA, 'watchlist' );
61 
62  $params = $this->extractRequestParams();
63 
64  $user = $this->getUser();
65  $wlowner = $this->getWatchlistUser( $params );
66 
67  if ( !is_null( $params['prop'] ) && is_null( $resultPageSet ) ) {
68  $prop = array_flip( $params['prop'] );
69 
70  $this->fld_ids = isset( $prop['ids'] );
71  $this->fld_title = isset( $prop['title'] );
72  $this->fld_flags = isset( $prop['flags'] );
73  $this->fld_user = isset( $prop['user'] );
74  $this->fld_userid = isset( $prop['userid'] );
75  $this->fld_comment = isset( $prop['comment'] );
76  $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
77  $this->fld_timestamp = isset( $prop['timestamp'] );
78  $this->fld_sizes = isset( $prop['sizes'] );
79  $this->fld_patrol = isset( $prop['patrol'] );
80  $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
81  $this->fld_loginfo = isset( $prop['loginfo'] );
82  $this->fld_tags = isset( $prop['tags'] );
83 
84  if ( $this->fld_patrol && !$user->useRCPatrol() && !$user->useNPPatrol() ) {
85  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'patrol' );
86  }
87 
88  if ( $this->fld_comment || $this->fld_parsedcomment ) {
89  $this->commentStore = CommentStore::getStore();
90  }
91  }
92 
93  $options = [
94  'dir' => $params['dir'] === 'older'
97  ];
98 
99  if ( is_null( $resultPageSet ) ) {
100  $options['includeFields'] = $this->getFieldsToInclude();
101  } else {
102  $options['usedInGenerator'] = true;
103  }
104 
105  if ( $params['start'] ) {
106  $options['start'] = $params['start'];
107  }
108  if ( $params['end'] ) {
109  $options['end'] = $params['end'];
110  }
111 
112  $startFrom = null;
113  if ( !is_null( $params['continue'] ) ) {
114  $cont = explode( '|', $params['continue'] );
115  $this->dieContinueUsageIf( count( $cont ) != 2 );
116  $continueTimestamp = $cont[0];
117  $continueId = (int)$cont[1];
118  $this->dieContinueUsageIf( $continueId != $cont[1] );
119  $startFrom = [ $continueTimestamp, $continueId ];
120  }
121 
122  if ( $wlowner !== $user ) {
123  $options['watchlistOwner'] = $wlowner;
124  $options['watchlistOwnerToken'] = $params['token'];
125  }
126 
127  if ( !is_null( $params['namespace'] ) ) {
128  $options['namespaceIds'] = $params['namespace'];
129  }
130 
131  if ( $params['allrev'] ) {
132  $options['allRevisions'] = true;
133  }
134 
135  if ( !is_null( $params['show'] ) ) {
136  $show = array_flip( $params['show'] );
137 
138  /* Check for conflicting parameters. */
139  if ( $this->showParamsConflicting( $show ) ) {
140  $this->dieWithError( 'apierror-show' );
141  }
142 
143  // Check permissions.
144  if ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
146  ) {
147  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
148  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
149  }
150  }
151 
152  $options['filters'] = array_keys( $show );
153  }
154 
155  if ( !is_null( $params['type'] ) ) {
156  try {
157  $rcTypes = RecentChange::parseToRCType( $params['type'] );
158  if ( $rcTypes ) {
159  $options['rcTypes'] = $rcTypes;
160  }
161  } catch ( Exception $e ) {
162  ApiBase::dieDebug( __METHOD__, $e->getMessage() );
163  }
164  }
165 
166  $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
167  if ( !is_null( $params['user'] ) ) {
168  $options['onlyByUser'] = $params['user'];
169  }
170  if ( !is_null( $params['excludeuser'] ) ) {
171  $options['notByUser'] = $params['excludeuser'];
172  }
173 
174  $options['limit'] = $params['limit'];
175 
176  Hooks::run( 'ApiQueryWatchlistPrepareWatchedItemQueryServiceOptions', [
177  $this, $params, &$options
178  ] );
179 
180  $ids = [];
181  $watchedItemQuery = MediaWikiServices::getInstance()->getWatchedItemQueryService();
182  $items = $watchedItemQuery->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
183 
184  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
186  if ( is_null( $resultPageSet ) ) {
187  $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
188  $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
189  if ( !$fit ) {
190  $startFrom = [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ];
191  break;
192  }
193  } elseif ( $params['allrev'] ) {
194  $ids[] = (int)$recentChangeInfo['rc_this_oldid'];
195  } else {
196  $ids[] = (int)$recentChangeInfo['rc_cur_id'];
197  }
198  }
199 
200  if ( $startFrom !== null ) {
201  $this->setContinueEnumParameter( 'continue', implode( '|', $startFrom ) );
202  }
203 
204  if ( is_null( $resultPageSet ) ) {
205  $this->getResult()->addIndexedTagName(
206  [ 'query', $this->getModuleName() ],
207  'item'
208  );
209  } elseif ( $params['allrev'] ) {
210  $resultPageSet->populateFromRevisionIDs( $ids );
211  } else {
212  $resultPageSet->populateFromPageIDs( $ids );
213  }
214  }
215 
216  private function getFieldsToInclude() {
217  $includeFields = [];
218  if ( $this->fld_flags ) {
219  $includeFields[] = WatchedItemQueryService::INCLUDE_FLAGS;
220  }
221  if ( $this->fld_user || $this->fld_userid ) {
222  $includeFields[] = WatchedItemQueryService::INCLUDE_USER_ID;
223  }
224  if ( $this->fld_user ) {
225  $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
226  }
227  if ( $this->fld_comment || $this->fld_parsedcomment ) {
228  $includeFields[] = WatchedItemQueryService::INCLUDE_COMMENT;
229  }
230  if ( $this->fld_patrol ) {
233  }
234  if ( $this->fld_sizes ) {
235  $includeFields[] = WatchedItemQueryService::INCLUDE_SIZES;
236  }
237  if ( $this->fld_loginfo ) {
239  }
240  if ( $this->fld_tags ) {
241  $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
242  }
243  return $includeFields;
244  }
245 
246  private function showParamsConflicting( array $show ) {
247  return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
248  && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
249  || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
250  && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
251  || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
252  && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
253  || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
259  || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
260  && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
261  }
262 
263  private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
264  /* Determine the title of the page that has been changed. */
265  $title = Title::newFromLinkTarget( $watchedItem->getLinkTarget() );
266  $user = $this->getUser();
267 
268  /* Our output data. */
269  $vals = [];
270  $type = (int)$recentChangeInfo['rc_type'];
271  $vals['type'] = RecentChange::parseFromRCType( $type );
272  $anyHidden = false;
273 
274  /* Create a new entry in the result for the title. */
275  if ( $this->fld_title || $this->fld_ids ) {
276  // These should already have been filtered out of the query, but just in case.
277  if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
278  $vals['actionhidden'] = true;
279  $anyHidden = true;
280  }
281  if ( $type !== RC_LOG ||
283  $recentChangeInfo['rc_deleted'],
285  $user
286  )
287  ) {
288  if ( $this->fld_title ) {
290  }
291  if ( $this->fld_ids ) {
292  $vals['pageid'] = (int)$recentChangeInfo['rc_cur_id'];
293  $vals['revid'] = (int)$recentChangeInfo['rc_this_oldid'];
294  $vals['old_revid'] = (int)$recentChangeInfo['rc_last_oldid'];
295  }
296  }
297  }
298 
299  /* Add user data and 'anon' flag, if user is anonymous. */
300  if ( $this->fld_user || $this->fld_userid ) {
301  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_USER ) {
302  $vals['userhidden'] = true;
303  $anyHidden = true;
304  }
305  if ( RevisionRecord::userCanBitfield(
306  $recentChangeInfo['rc_deleted'],
307  RevisionRecord::DELETED_USER,
308  $user
309  ) ) {
310  if ( $this->fld_userid ) {
311  $vals['userid'] = (int)$recentChangeInfo['rc_user'];
312  // for backwards compatibility
313  $vals['user'] = (int)$recentChangeInfo['rc_user'];
314  }
315 
316  if ( $this->fld_user ) {
317  $vals['user'] = $recentChangeInfo['rc_user_text'];
318  }
319 
320  if ( !$recentChangeInfo['rc_user'] ) {
321  $vals['anon'] = true;
322  }
323  }
324  }
325 
326  /* Add flags, such as new, minor, bot. */
327  if ( $this->fld_flags ) {
328  $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
329  $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
330  $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
331  }
332 
333  /* Add sizes of each revision. (Only available on 1.10+) */
334  if ( $this->fld_sizes ) {
335  $vals['oldlen'] = (int)$recentChangeInfo['rc_old_len'];
336  $vals['newlen'] = (int)$recentChangeInfo['rc_new_len'];
337  }
338 
339  /* Add the timestamp. */
340  if ( $this->fld_timestamp ) {
341  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
342  }
343 
344  if ( $this->fld_notificationtimestamp ) {
345  $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
346  ? ''
347  : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
348  }
349 
350  /* Add edit summary / log summary. */
351  if ( $this->fld_comment || $this->fld_parsedcomment ) {
352  if ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_COMMENT ) {
353  $vals['commenthidden'] = true;
354  $anyHidden = true;
355  }
356  if ( RevisionRecord::userCanBitfield(
357  $recentChangeInfo['rc_deleted'],
358  RevisionRecord::DELETED_COMMENT,
359  $user
360  ) ) {
361  $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text;
362  if ( $this->fld_comment ) {
363  $vals['comment'] = $comment;
364  }
365 
366  if ( $this->fld_parsedcomment ) {
367  $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
368  }
369  }
370  }
371 
372  /* Add the patrolled flag */
373  if ( $this->fld_patrol ) {
374  $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] != RecentChange::PRC_UNPATROLLED;
375  $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
376  $vals['autopatrolled'] = $recentChangeInfo['rc_patrolled'] == RecentChange::PRC_AUTOPATROLLED;
377  }
378 
379  if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
380  if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
381  $vals['actionhidden'] = true;
382  $anyHidden = true;
383  }
385  $recentChangeInfo['rc_deleted'],
387  $user
388  ) ) {
389  $vals['logid'] = (int)$recentChangeInfo['rc_logid'];
390  $vals['logtype'] = $recentChangeInfo['rc_log_type'];
391  $vals['logaction'] = $recentChangeInfo['rc_log_action'];
392  $vals['logparams'] = LogFormatter::newFromRow( $recentChangeInfo )->formatParametersForApi();
393  }
394  }
395 
396  if ( $this->fld_tags ) {
397  if ( $recentChangeInfo['rc_tags'] ) {
398  $tags = explode( ',', $recentChangeInfo['rc_tags'] );
399  ApiResult::setIndexedTagName( $tags, 'tag' );
400  $vals['tags'] = $tags;
401  } else {
402  $vals['tags'] = [];
403  }
404  }
405 
406  if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & RevisionRecord::DELETED_RESTRICTED ) ) {
407  $vals['suppressed'] = true;
408  }
409 
410  Hooks::run( 'ApiQueryWatchlistExtractOutputData', [
411  $this, $watchedItem, $recentChangeInfo, &$vals
412  ] );
413 
414  return $vals;
415  }
416 
417  public function getAllowedParams() {
418  return [
419  'allrev' => false,
420  'start' => [
421  ApiBase::PARAM_TYPE => 'timestamp'
422  ],
423  'end' => [
424  ApiBase::PARAM_TYPE => 'timestamp'
425  ],
426  'namespace' => [
427  ApiBase::PARAM_ISMULTI => true,
428  ApiBase::PARAM_TYPE => 'namespace'
429  ],
430  'user' => [
431  ApiBase::PARAM_TYPE => 'user',
432  ],
433  'excludeuser' => [
434  ApiBase::PARAM_TYPE => 'user',
435  ],
436  'dir' => [
437  ApiBase::PARAM_DFLT => 'older',
439  'newer',
440  'older'
441  ],
442  ApiHelp::PARAM_HELP_MSG => 'api-help-param-direction',
443  ],
444  'limit' => [
445  ApiBase::PARAM_DFLT => 10,
446  ApiBase::PARAM_TYPE => 'limit',
447  ApiBase::PARAM_MIN => 1,
450  ],
451  'prop' => [
452  ApiBase::PARAM_ISMULTI => true,
453  ApiBase::PARAM_DFLT => 'ids|title|flags',
456  'ids',
457  'title',
458  'flags',
459  'user',
460  'userid',
461  'comment',
462  'parsedcomment',
463  'timestamp',
464  'patrol',
465  'sizes',
466  'notificationtimestamp',
467  'loginfo',
468  'tags',
469  ]
470  ],
471  'show' => [
472  ApiBase::PARAM_ISMULTI => true,
486  ]
487  ],
488  'type' => [
489  ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
490  ApiBase::PARAM_ISMULTI => true,
493  ],
494  'owner' => [
495  ApiBase::PARAM_TYPE => 'user'
496  ],
497  'token' => [
498  ApiBase::PARAM_TYPE => 'string',
499  ApiBase::PARAM_SENSITIVE => true,
500  ],
501  'continue' => [
502  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
503  ],
504  ];
505  }
506 
507  protected function getExamplesMessages() {
508  return [
509  'action=query&list=watchlist'
510  => 'apihelp-query+watchlist-example-simple',
511  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
512  => 'apihelp-query+watchlist-example-props',
513  'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
514  => 'apihelp-query+watchlist-example-allrev',
515  'action=query&generator=watchlist&prop=info'
516  => 'apihelp-query+watchlist-example-generator',
517  'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
518  => 'apihelp-query+watchlist-example-generator-rev',
519  'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
520  => 'apihelp-query+watchlist-example-wlowner',
521  ];
522  }
523 
524  public function getHelpUrls() {
525  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Watchlist';
526  }
527 }
ApiQueryWatchlist\$fld_title
$fld_title
Definition: ApiQueryWatchlist.php:49
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:117
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:50
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:2014
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:131
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1869
ApiBase\PARAM_TYPE
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
Definition: ApiBase.php:94
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:640
RC_LOG
const RC_LOG
Definition: Defines.php:124
ApiQueryWatchlist\$fld_userid
$fld_userid
Definition: ApiQueryWatchlist.php:52
RecentChange\getChangeTypes
static getChangeTypes()
Get an array of all change types.
Definition: RecentChange.php:184
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:53
ApiQueryWatchlist\$fld_notificationtimestamp
$fld_notificationtimestamp
Definition: ApiQueryWatchlist.php:52
RecentChange\parseToRCType
static parseToRCType( $type)
Parsing text to RC_* constants.
Definition: RecentChange.php:151
ContextSource\getUser
getUser()
Definition: ContextSource.php:120
ApiQueryBase\$options
$options
Definition: ApiQueryBase.php:37
WatchedItemQueryService\INCLUDE_TAGS
const INCLUDE_TAGS
Definition: WatchedItemQueryService.php:34
ApiBase\PARAM_SENSITIVE
const PARAM_SENSITIVE
(boolean) Is the parameter sensitive? Note 'password'-type fields are always sensitive regardless of ...
Definition: ApiBase.php:200
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
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition: ApiBase.php:106
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:51
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:259
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
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition: ApiBase.php:97
ApiQueryWatchlist\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQueryWatchlist.php:417
ApiQueryWatchlist\getFieldsToInclude
getFieldsToInclude()
Definition: ApiQueryWatchlist.php:216
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:761
WatchedItemQueryService\FILTER_BOT
const FILTER_BOT
Definition: WatchedItemQueryService.php:41
$title
$title
Definition: testCompression.php:34
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:45
ApiQueryWatchlist\showParamsConflicting
showParamsConflicting(array $show)
Definition: ApiQueryWatchlist.php:246
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:35
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:616
ApiBase\getWatchlistUser
getWatchlistUser( $params)
Gets the user for whom to get the watchlist.
Definition: ApiBase.php:1765
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:2208
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:50
WatchedItemQueryService\FILTER_NOT_MINOR
const FILTER_NOT_MINOR
Definition: WatchedItemQueryService.php:40
RC_NEW
const RC_NEW
Definition: Defines.php:123
WatchedItemQueryService\INCLUDE_FLAGS
const INCLUDE_FLAGS
Definition: WatchedItemQueryService.php:26
ApiBase\requireMaxOneParameter
requireMaxOneParameter( $params, $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:931
ApiQueryWatchlist\extractOutputData
extractOutputData(WatchedItem $watchedItem, array $recentChangeInfo)
Definition: ApiQueryWatchlist.php:263
RecentChange\PRC_AUTOPATROLLED
const PRC_AUTOPATROLLED
Definition: RecentChange.php:81
Title\newFromLinkTarget
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition: Title.php:268
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:1165
ApiQueryGeneratorBase
Definition: ApiQueryGeneratorBase.php:26
WatchedItemQueryService\DIR_OLDER
const DIR_OLDER
Definition: WatchedItemQueryService.php:23
ApiQueryWatchlist\$fld_tags
$fld_tags
Definition: ApiQueryWatchlist.php:53
ApiQueryWatchlist\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryWatchlist.php:524
ApiQueryWatchlist
This query action allows clients to retrieve a list of recently modified pages that are part of the l...
Definition: ApiQueryWatchlist.php:32
ApiQueryBase\selectNamedDB
selectNamedDB( $name, $db, $groups)
Selects the query database connection with the given name.
Definition: ApiQueryBase.php:123
ApiQueryWatchlist\$fld_ids
$fld_ids
Definition: ApiQueryWatchlist.php:49
ApiBase\LIMIT_BIG2
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition: ApiBase.php:261
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:547
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:173
ApiQueryWatchlist\$fld_patrol
$fld_patrol
Definition: ApiQueryWatchlist.php:49
ApiBase\PARAM_DFLT
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:55
RecentChange\PRC_UNPATROLLED
const PRC_UNPATROLLED
Definition: RecentChange.php:79
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:520
WatchedItem\getLinkTarget
getLinkTarget()
Definition: WatchedItem.php:82
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition: ApiBase.php:58
WatchedItemQueryService\FILTER_NOT_ANON
const FILTER_NOT_ANON
Definition: WatchedItemQueryService.php:44
ApiQueryWatchlist\$fld_comment
$fld_comment
Definition: ApiQueryWatchlist.php:51
ApiBase\PARAM_MAX2
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right,...
Definition: ApiBase.php:103
ApiQueryWatchlist\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: ApiQueryWatchlist.php:41
WatchedItem\getNotificationTimestamp
getNotificationTimestamp()
Get the notification timestamp of this entry.
Definition: WatchedItem.php:91
ChangesList\isUnpatrolled
static isUnpatrolled( $rc, User $user)
Definition: ChangesList.php:800
ApiQueryWatchlist\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryWatchlist.php:507
WatchedItemQueryService\INCLUDE_SIZES
const INCLUDE_SIZES
Definition: WatchedItemQueryService.php:32
ApiQueryWatchlist\$fld_parsedcomment
$fld_parsedcomment
Definition: ApiQueryWatchlist.php:51
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:164
ApiQueryWatchlist\run
run( $resultPageSet=null)
Definition: ApiQueryWatchlist.php:59
CommentStore\getStore
static getStore()
Definition: CommentStore.php:139
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:200
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:2220
WatchedItemQueryService\FILTER_UNREAD
const FILTER_UNREAD
Definition: WatchedItemQueryService.php:49
ApiQueryWatchlist\$fld_flags
$fld_flags
Definition: ApiQueryWatchlist.php:50
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:443
ApiQueryWatchlist\__construct
__construct(ApiQuery $query, $moduleName)
Definition: ApiQueryWatchlist.php:37
$type
$type
Definition: testCompression.php:48