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