MediaWiki  1.31.0
ApiQueryWatchlist.php
Go to the documentation of this file.
1 <?php
24 
32 
34  private $commentStore;
35 
36  public function __construct( ApiQuery $query, $moduleName ) {
37  parent::__construct( $query, $moduleName, 'wl' );
38  }
39 
40  public function execute() {
41  $this->run();
42  }
43 
44  public function executeGenerator( $resultPageSet ) {
45  $this->run( $resultPageSet );
46  }
47 
48  private $fld_ids = false, $fld_title = false, $fld_patrol = false,
49  $fld_flags = false, $fld_timestamp = false, $fld_user = false,
50  $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
53 
58  private function run( $resultPageSet = null ) {
59  $this->selectNamedDB( 'watchlist', DB_REPLICA, 'watchlist' );
60 
61  $params = $this->extractRequestParams();
62 
63  $user = $this->getUser();
64  $wlowner = $this->getWatchlistUser( $params );
65 
66  if ( !is_null( $params['prop'] ) && is_null( $resultPageSet ) ) {
67  $prop = array_flip( $params['prop'] );
68 
69  $this->fld_ids = isset( $prop['ids'] );
70  $this->fld_title = isset( $prop['title'] );
71  $this->fld_flags = isset( $prop['flags'] );
72  $this->fld_user = isset( $prop['user'] );
73  $this->fld_userid = isset( $prop['userid'] );
74  $this->fld_comment = isset( $prop['comment'] );
75  $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
76  $this->fld_timestamp = isset( $prop['timestamp'] );
77  $this->fld_sizes = isset( $prop['sizes'] );
78  $this->fld_patrol = isset( $prop['patrol'] );
79  $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
80  $this->fld_loginfo = isset( $prop['loginfo'] );
81  $this->fld_tags = isset( $prop['tags'] );
82 
83  if ( $this->fld_patrol ) {
84  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
85  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'patrol' );
86  }
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 ( is_null( $resultPageSet ) ) {
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 ( !is_null( $params['continue'] ) ) {
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 ( !is_null( $params['namespace'] ) ) {
129  $options['namespaceIds'] = $params['namespace'];
130  }
131 
132  if ( $params['allrev'] ) {
133  $options['allRevisions'] = true;
134  }
135 
136  if ( !is_null( $params['show'] ) ) {
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 ( !is_null( $params['type'] ) ) {
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 ( !is_null( $params['user'] ) ) {
169  $options['onlyByUser'] = $params['user'];
170  }
171  if ( !is_null( $params['excludeuser'] ) ) {
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  $count = 0;
183  $watchedItemQuery = MediaWikiServices::getInstance()->getWatchedItemQueryService();
184  $items = $watchedItemQuery->getWatchedItemsWithRecentChangeInfo( $wlowner, $options, $startFrom );
185 
186  foreach ( $items as list( $watchedItem, $recentChangeInfo ) ) {
188  if ( is_null( $resultPageSet ) ) {
189  $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
190  $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
191  if ( !$fit ) {
192  $startFrom = [ $recentChangeInfo['rc_timestamp'], $recentChangeInfo['rc_id'] ];
193  break;
194  }
195  } else {
196  if ( $params['allrev'] ) {
197  $ids[] = intval( $recentChangeInfo['rc_this_oldid'] );
198  } else {
199  $ids[] = intval( $recentChangeInfo['rc_cur_id'] );
200  }
201  }
202  }
203 
204  if ( $startFrom !== null ) {
205  $this->setContinueEnumParameter( 'continue', implode( '|', $startFrom ) );
206  }
207 
208  if ( is_null( $resultPageSet ) ) {
209  $this->getResult()->addIndexedTagName(
210  [ 'query', $this->getModuleName() ],
211  'item'
212  );
213  } elseif ( $params['allrev'] ) {
214  $resultPageSet->populateFromRevisionIDs( $ids );
215  } else {
216  $resultPageSet->populateFromPageIDs( $ids );
217  }
218  }
219 
220  private function getFieldsToInclude() {
221  $includeFields = [];
222  if ( $this->fld_flags ) {
223  $includeFields[] = WatchedItemQueryService::INCLUDE_FLAGS;
224  }
225  if ( $this->fld_user || $this->fld_userid ) {
226  $includeFields[] = WatchedItemQueryService::INCLUDE_USER_ID;
227  }
228  if ( $this->fld_user ) {
229  $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
230  }
231  if ( $this->fld_comment || $this->fld_parsedcomment ) {
232  $includeFields[] = WatchedItemQueryService::INCLUDE_COMMENT;
233  }
234  if ( $this->fld_patrol ) {
237  }
238  if ( $this->fld_sizes ) {
239  $includeFields[] = WatchedItemQueryService::INCLUDE_SIZES;
240  }
241  if ( $this->fld_loginfo ) {
243  }
244  if ( $this->fld_tags ) {
245  $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
246  }
247  return $includeFields;
248  }
249 
250  private function showParamsConflicting( array $show ) {
251  return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
252  && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
253  || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
254  && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
255  || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
256  && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
257  || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
263  || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
264  && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
265  }
266 
267  private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
268  /* Determine the title of the page that has been changed. */
269  $title = Title::newFromLinkTarget( $watchedItem->getLinkTarget() );
270  $user = $this->getUser();
271 
272  /* Our output data. */
273  $vals = [];
274  $type = intval( $recentChangeInfo['rc_type'] );
275  $vals['type'] = RecentChange::parseFromRCType( $type );
276  $anyHidden = false;
277 
278  /* Create a new entry in the result for the title. */
279  if ( $this->fld_title || $this->fld_ids ) {
280  // These should already have been filtered out of the query, but just in case.
281  if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
282  $vals['actionhidden'] = true;
283  $anyHidden = true;
284  }
285  if ( $type !== RC_LOG ||
287  $recentChangeInfo['rc_deleted'],
289  $user
290  )
291  ) {
292  if ( $this->fld_title ) {
294  }
295  if ( $this->fld_ids ) {
296  $vals['pageid'] = intval( $recentChangeInfo['rc_cur_id'] );
297  $vals['revid'] = intval( $recentChangeInfo['rc_this_oldid'] );
298  $vals['old_revid'] = intval( $recentChangeInfo['rc_last_oldid'] );
299  }
300  }
301  }
302 
303  /* Add user data and 'anon' flag, if user is anonymous. */
304  if ( $this->fld_user || $this->fld_userid ) {
305  if ( $recentChangeInfo['rc_deleted'] & Revision::DELETED_USER ) {
306  $vals['userhidden'] = true;
307  $anyHidden = true;
308  }
310  $recentChangeInfo['rc_deleted'],
312  $user
313  ) ) {
314  if ( $this->fld_userid ) {
315  $vals['userid'] = (int)$recentChangeInfo['rc_user'];
316  // for backwards compatibility
317  $vals['user'] = (int)$recentChangeInfo['rc_user'];
318  }
319 
320  if ( $this->fld_user ) {
321  $vals['user'] = $recentChangeInfo['rc_user_text'];
322  }
323 
324  if ( !$recentChangeInfo['rc_user'] ) {
325  $vals['anon'] = true;
326  }
327  }
328  }
329 
330  /* Add flags, such as new, minor, bot. */
331  if ( $this->fld_flags ) {
332  $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
333  $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
334  $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
335  }
336 
337  /* Add sizes of each revision. (Only available on 1.10+) */
338  if ( $this->fld_sizes ) {
339  $vals['oldlen'] = intval( $recentChangeInfo['rc_old_len'] );
340  $vals['newlen'] = intval( $recentChangeInfo['rc_new_len'] );
341  }
342 
343  /* Add the timestamp. */
344  if ( $this->fld_timestamp ) {
345  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
346  }
347 
348  if ( $this->fld_notificationtimestamp ) {
349  $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
350  ? ''
351  : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
352  }
353 
354  /* Add edit summary / log summary. */
355  if ( $this->fld_comment || $this->fld_parsedcomment ) {
356  if ( $recentChangeInfo['rc_deleted'] & Revision::DELETED_COMMENT ) {
357  $vals['commenthidden'] = true;
358  $anyHidden = true;
359  }
361  $recentChangeInfo['rc_deleted'],
363  $user
364  ) ) {
365  $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text;
366  if ( $this->fld_comment ) {
367  $vals['comment'] = $comment;
368  }
369 
370  if ( $this->fld_parsedcomment ) {
371  $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
372  }
373  }
374  }
375 
376  /* Add the patrolled flag */
377  if ( $this->fld_patrol ) {
378  $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] != RecentChange::PRC_UNPATROLLED;
379  $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
380  $vals['autopatrolled'] = $recentChangeInfo['rc_patrolled'] == RecentChange::PRC_AUTOPATROLLED;
381  }
382 
383  if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
384  if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
385  $vals['actionhidden'] = true;
386  $anyHidden = true;
387  }
389  $recentChangeInfo['rc_deleted'],
391  $user
392  ) ) {
393  $vals['logid'] = intval( $recentChangeInfo['rc_logid'] );
394  $vals['logtype'] = $recentChangeInfo['rc_log_type'];
395  $vals['logaction'] = $recentChangeInfo['rc_log_action'];
396  $vals['logparams'] = LogFormatter::newFromRow( $recentChangeInfo )->formatParametersForApi();
397  }
398  }
399 
400  if ( $this->fld_tags ) {
401  if ( $recentChangeInfo['rc_tags'] ) {
402  $tags = explode( ',', $recentChangeInfo['rc_tags'] );
403  ApiResult::setIndexedTagName( $tags, 'tag' );
404  $vals['tags'] = $tags;
405  } else {
406  $vals['tags'] = [];
407  }
408  }
409 
410  if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & Revision::DELETED_RESTRICTED ) ) {
411  $vals['suppressed'] = true;
412  }
413 
414  Hooks::run( 'ApiQueryWatchlistExtractOutputData', [
415  $this, $watchedItem, $recentChangeInfo, &$vals
416  ] );
417 
418  return $vals;
419  }
420 
421  public function getAllowedParams() {
422  return [
423  'allrev' => false,
424  'start' => [
425  ApiBase::PARAM_TYPE => 'timestamp'
426  ],
427  'end' => [
428  ApiBase::PARAM_TYPE => 'timestamp'
429  ],
430  'namespace' => [
431  ApiBase::PARAM_ISMULTI => true,
432  ApiBase::PARAM_TYPE => 'namespace'
433  ],
434  'user' => [
435  ApiBase::PARAM_TYPE => 'user',
436  ],
437  'excludeuser' => [
438  ApiBase::PARAM_TYPE => 'user',
439  ],
440  'dir' => [
441  ApiBase::PARAM_DFLT => 'older',
443  'newer',
444  'older'
445  ],
446  ApiHelp::PARAM_HELP_MSG => 'api-help-param-direction',
447  ],
448  'limit' => [
449  ApiBase::PARAM_DFLT => 10,
450  ApiBase::PARAM_TYPE => 'limit',
451  ApiBase::PARAM_MIN => 1,
454  ],
455  'prop' => [
456  ApiBase::PARAM_ISMULTI => true,
457  ApiBase::PARAM_DFLT => 'ids|title|flags',
460  'ids',
461  'title',
462  'flags',
463  'user',
464  'userid',
465  'comment',
466  'parsedcomment',
467  'timestamp',
468  'patrol',
469  'sizes',
470  'notificationtimestamp',
471  'loginfo',
472  'tags',
473  ]
474  ],
475  'show' => [
476  ApiBase::PARAM_ISMULTI => true,
490  ]
491  ],
492  'type' => [
493  ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
494  ApiBase::PARAM_ISMULTI => true,
497  ],
498  'owner' => [
499  ApiBase::PARAM_TYPE => 'user'
500  ],
501  'token' => [
502  ApiBase::PARAM_TYPE => 'string',
503  ApiBase::PARAM_SENSITIVE => true,
504  ],
505  'continue' => [
506  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
507  ],
508  ];
509  }
510 
511  protected function getExamplesMessages() {
512  return [
513  'action=query&list=watchlist'
514  => 'apihelp-query+watchlist-example-simple',
515  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
516  => 'apihelp-query+watchlist-example-props',
517  'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
518  => 'apihelp-query+watchlist-example-allrev',
519  'action=query&generator=watchlist&prop=info'
520  => 'apihelp-query+watchlist-example-generator',
521  'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
522  => 'apihelp-query+watchlist-example-generator-rev',
523  'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
524  => 'apihelp-query+watchlist-example-wlowner',
525  ];
526  }
527 
528  public function getHelpUrls() {
529  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Watchlist';
530  }
531 }
Revision\DELETED_USER
const DELETED_USER
Definition: Revision.php:49
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:244
Revision\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: Revision.php:50
ApiQueryWatchlist\$fld_title
$fld_title
Definition: ApiQueryWatchlist.php:48
ApiQuery
This is the main query class.
Definition: ApiQuery.php:36
Revision\DELETED_COMMENT
const DELETED_COMMENT
Definition: Revision.php:48
WatchedItemQueryService\INCLUDE_COMMENT
const INCLUDE_COMMENT
Definition: WatchedItemQueryService.php:26
Revision\userCanBitfield
static userCanBitfield( $bitfield, $field, User $user=null, Title $title=null)
Determine if the current user is allowed to view a particular field of this revision,...
Definition: Revision.php:1205
WatchedItemQueryService\FILTER_NOT_AUTOPATROLLED
const FILTER_NOT_AUTOPATROLLED
Definition: WatchedItemQueryService.php:45
WatchedItemQueryService\FILTER_PATROLLED
const FILTER_PATROLLED
Definition: WatchedItemQueryService.php:42
captcha-old.count
count
Definition: captcha-old.py:249
ApiQueryWatchlist\$fld_user
$fld_user
Definition: ApiQueryWatchlist.php:49
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1895
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:124
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1968
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:87
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:641
RC_LOG
const RC_LOG
Definition: Defines.php:145
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
ApiQueryWatchlist\$fld_userid
$fld_userid
Definition: ApiQueryWatchlist.php:51
RecentChange\getChangeTypes
static getChangeTypes()
Get an array of all change types.
Definition: RecentChange.php:171
CommentStore
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Definition: CommentStore.php:31
$params
$params
Definition: styleTest.css.php:40
ApiQueryWatchlist\$fld_loginfo
$fld_loginfo
Definition: ApiQueryWatchlist.php:52
ApiQueryWatchlist\$fld_notificationtimestamp
$fld_notificationtimestamp
Definition: ApiQueryWatchlist.php:51
RecentChange\parseToRCType
static parseToRCType( $type)
Parsing text to RC_* constants.
Definition: RecentChange.php:138
ContextSource\getUser
getUser()
Definition: ContextSource.php:120
ApiQueryBase\$options
$options
Definition: ApiQueryBase.php:35
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
WatchedItemQueryService\INCLUDE_TAGS
const INCLUDE_TAGS
Definition: WatchedItemQueryService.php:31
ApiBase\PARAM_SENSITIVE
const PARAM_SENSITIVE
(boolean) Is the parameter sensitive? Note 'password'-type fields are always sensitive regardless of ...
Definition: ApiBase.php:193
WatchedItemQueryService\INCLUDE_LOG_INFO
const INCLUDE_LOG_INFO
Definition: WatchedItemQueryService.php:30
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
Definition: ApiQueryGeneratorBase.php:84
$query
null for the wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1591
ApiBase\PARAM_MIN
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition: ApiBase.php:99
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:934
LogFormatter\newFromRow
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
Definition: LogFormatter.php:76
ApiQueryWatchlist\$fld_sizes
$fld_sizes
Definition: ApiQueryWatchlist.php:50
WatchedItemQueryService\FILTER_MINOR
const FILTER_MINOR
Definition: WatchedItemQueryService.php:36
Title\newFromLinkTarget
static newFromLinkTarget(LinkTarget $linkTarget)
Create a new Title from a LinkTarget.
Definition: Title.php:244
WatchedItemQueryService\INCLUDE_AUTOPATROL_INFO
const INCLUDE_AUTOPATROL_INFO
Definition: WatchedItemQueryService.php:28
WatchedItemQueryService\INCLUDE_USER
const INCLUDE_USER
Definition: WatchedItemQueryService.php:24
ApiBase\LIMIT_BIG1
const LIMIT_BIG1
Fast query, standard limit.
Definition: ApiBase.php:234
WatchedItemQueryService\FILTER_NOT_BOT
const FILTER_NOT_BOT
Definition: WatchedItemQueryService.php:39
WatchedItemQueryService\INCLUDE_PATROL_INFO
const INCLUDE_PATROL_INFO
Definition: WatchedItemQueryService.php:27
ApiBase\PARAM_MAX
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition: ApiBase.php:90
ApiQueryWatchlist\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQueryWatchlist.php:421
ApiQueryWatchlist\getFieldsToInclude
getFieldsToInclude()
Definition: ApiQueryWatchlist.php:220
WatchedItemQueryService\FILTER_BOT
const FILTER_BOT
Definition: WatchedItemQueryService.php:38
WatchedItemQueryService\INCLUDE_USER_ID
const INCLUDE_USER_ID
Definition: WatchedItemQueryService.php:25
ApiQueryWatchlist\executeGenerator
executeGenerator( $resultPageSet)
Execute this module as a generator.
Definition: ApiQueryWatchlist.php:44
ApiQueryWatchlist\showParamsConflicting
showParamsConflicting(array $show)
Definition: ApiQueryWatchlist.php:250
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
list
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:32
ApiQueryWatchlist\$commentStore
CommentStore $commentStore
Definition: ApiQueryWatchlist.php:34
WatchedItemQueryService\DIR_NEWER
const DIR_NEWER
Definition: WatchedItemQueryService.php:21
ApiBase\extractRequestParams
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:749
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:1687
$e
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Definition: hooks.txt:2163
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:2066
WatchedItem
Representation of a pair of user and title for watchlist entries.
Definition: WatchedItem.php:32
WatchedItemQueryService\FILTER_NOT_PATROLLED
const FILTER_NOT_PATROLLED
Definition: WatchedItemQueryService.php:43
ApiQueryWatchlist\$fld_timestamp
$fld_timestamp
Definition: ApiQueryWatchlist.php:49
WatchedItemQueryService\FILTER_NOT_MINOR
const FILTER_NOT_MINOR
Definition: WatchedItemQueryService.php:37
RC_NEW
const RC_NEW
Definition: Defines.php:144
WatchedItemQueryService\INCLUDE_FLAGS
const INCLUDE_FLAGS
Definition: WatchedItemQueryService.php:23
ApiBase\requireMaxOneParameter
requireMaxOneParameter( $params, $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:823
ApiQueryWatchlist\extractOutputData
extractOutputData(WatchedItem $watchedItem, array $recentChangeInfo)
Definition: ApiQueryWatchlist.php:267
RecentChange\PRC_AUTOPATROLLED
const PRC_AUTOPATROLLED
Definition: RecentChange.php:79
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:1109
ApiQueryGeneratorBase
Definition: ApiQueryGeneratorBase.php:26
WatchedItemQueryService\DIR_OLDER
const DIR_OLDER
Definition: WatchedItemQueryService.php:20
ApiQueryWatchlist\$fld_tags
$fld_tags
Definition: ApiQueryWatchlist.php:52
ApiQueryWatchlist\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryWatchlist.php:528
ApiQueryWatchlist
This query action allows clients to retrieve a list of recently modified pages that are part of the l...
Definition: ApiQueryWatchlist.php:31
ApiQueryBase\selectNamedDB
selectNamedDB( $name, $db, $groups)
Selects the query database connection with the given name.
Definition: ApiQueryBase.php:121
ApiQueryWatchlist\$fld_ids
$fld_ids
Definition: ApiQueryWatchlist.php:48
ApiBase\LIMIT_BIG2
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition: ApiBase.php:236
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:543
WatchedItemQueryService\FILTER_AUTOPATROLLED
const FILTER_AUTOPATROLLED
Definition: WatchedItemQueryService.php:44
WatchedItemQueryService\FILTER_NOT_UNREAD
const FILTER_NOT_UNREAD
Definition: WatchedItemQueryService.php:47
RecentChange\parseFromRCType
static parseFromRCType( $rcType)
Parsing RC_* constants to human-readable test.
Definition: RecentChange.php:160
ApiQueryWatchlist\$fld_patrol
$fld_patrol
Definition: ApiQueryWatchlist.php:48
ApiBase\PARAM_DFLT
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:48
RecentChange\PRC_UNPATROLLED
const PRC_UNPATROLLED
Definition: RecentChange.php:77
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:521
WatchedItem\getLinkTarget
getLinkTarget()
Definition: WatchedItem.php:73
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition: ApiBase.php:51
WatchedItemQueryService\FILTER_NOT_ANON
const FILTER_NOT_ANON
Definition: WatchedItemQueryService.php:41
ApiQueryWatchlist\$fld_comment
$fld_comment
Definition: ApiQueryWatchlist.php:50
ApiBase\PARAM_MAX2
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right,...
Definition: ApiBase.php:96
ApiQueryWatchlist\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: ApiQueryWatchlist.php:40
WatchedItem\getNotificationTimestamp
getNotificationTimestamp()
Get the notification timestamp of this entry.
Definition: WatchedItem.php:82
ChangesList\isUnpatrolled
static isUnpatrolled( $rc, User $user)
Definition: ChangesList.php:712
ApiQueryWatchlist\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryWatchlist.php:511
WatchedItemQueryService\INCLUDE_SIZES
const INCLUDE_SIZES
Definition: WatchedItemQueryService.php:29
ApiQueryWatchlist\$fld_parsedcomment
$fld_parsedcomment
Definition: ApiQueryWatchlist.php:50
MediaWikiServices
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
Definition: injection.txt:23
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:157
ApiQueryWatchlist\run
run( $resultPageSet=null)
Definition: ApiQueryWatchlist.php:58
CommentStore\getStore
static getStore()
Definition: CommentStore.php:130
WatchedItemQueryService\FILTER_ANON
const FILTER_ANON
Definition: WatchedItemQueryService.php:40
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:203
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:2078
WatchedItemQueryService\FILTER_UNREAD
const FILTER_UNREAD
Definition: WatchedItemQueryService.php:46
ApiQueryWatchlist\$fld_flags
$fld_flags
Definition: ApiQueryWatchlist.php:49
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:482
ApiQueryWatchlist\__construct
__construct(ApiQuery $query, $moduleName)
Definition: ApiQueryWatchlist.php:36
array
the array() calling protocol came about after MediaWiki 1.4rc1.
$type
$type
Definition: testCompression.php:48