MediaWiki  master
ApiQueryRevisions.php
Go to the documentation of this file.
1 <?php
26 
36 
37  private $token = null;
38 
39  public function __construct( ApiQuery $query, $moduleName ) {
40  parent::__construct( $query, $moduleName, 'rv' );
41  }
42 
43  private $tokenFunctions;
44 
46  protected function getTokenFunctions() {
47  // tokenname => function
48  // function prototype is func($pageid, $title, $rev)
49  // should return token or false
50 
51  // Don't call the hooks twice
52  if ( isset( $this->tokenFunctions ) ) {
53  return $this->tokenFunctions;
54  }
55 
56  // If we're in a mode that breaks the same-origin policy, no tokens can
57  // be obtained
58  if ( $this->lacksSameOriginSecurity() ) {
59  return [];
60  }
61 
62  $this->tokenFunctions = [
63  'rollback' => [ self::class, 'getRollbackToken' ]
64  ];
65  Hooks::run( 'APIQueryRevisionsTokens', [ &$this->tokenFunctions ] );
66 
67  return $this->tokenFunctions;
68  }
69 
77  public static function getRollbackToken( $pageid, $title, $rev ) {
78  global $wgUser;
79  if ( !MediaWikiServices::getInstance()->getPermissionManager()
80  ->userHasRight( $wgUser, 'rollback' ) ) {
81  return false;
82  }
83 
84  return $wgUser->getEditToken( 'rollback' );
85  }
86 
87  protected function run( ApiPageSet $resultPageSet = null ) {
88  $params = $this->extractRequestParams( false );
89  $revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
90 
91  // If any of those parameters are used, work in 'enumeration' mode.
92  // Enum mode can only be used when exactly one page is provided.
93  // Enumerating revisions on multiple pages make it extremely
94  // difficult to manage continuations and require additional SQL indexes
95  $enumRevMode = ( $params['user'] !== null || $params['excludeuser'] !== null ||
96  $params['limit'] !== null || $params['startid'] !== null ||
97  $params['endid'] !== null || $params['dir'] === 'newer' ||
98  $params['start'] !== null || $params['end'] !== null );
99 
100  $pageSet = $this->getPageSet();
101  $pageCount = $pageSet->getGoodTitleCount();
102  $revCount = $pageSet->getRevisionCount();
103 
104  // Optimization -- nothing to do
105  if ( $revCount === 0 && $pageCount === 0 ) {
106  // Nothing to do
107  return;
108  }
109  if ( $revCount > 0 && count( $pageSet->getLiveRevisionIDs() ) === 0 ) {
110  // We're in revisions mode but all given revisions are deleted
111  return;
112  }
113 
114  if ( $revCount > 0 && $enumRevMode ) {
115  $this->dieWithError(
116  [ 'apierror-revisions-norevids', $this->getModulePrefix() ], 'invalidparammix'
117  );
118  }
119 
120  if ( $pageCount > 1 && $enumRevMode ) {
121  $this->dieWithError(
122  [ 'apierror-revisions-singlepage', $this->getModulePrefix() ], 'invalidparammix'
123  );
124  }
125 
126  // In non-enum mode, rvlimit can't be directly used. Use the maximum
127  // allowed value.
128  if ( !$enumRevMode ) {
129  $this->setParsedLimit = false;
130  $params['limit'] = 'max';
131  }
132 
133  $db = $this->getDB();
134 
135  $idField = 'rev_id';
136  $tsField = 'rev_timestamp';
137  $pageField = 'rev_page';
138  if ( $params['user'] !== null ) {
139  // We're going to want to use the page_actor_timestamp index (on revision_actor_temp)
140  // so use that table's denormalized fields.
141  $idField = 'revactor_rev';
142  $tsField = 'revactor_timestamp';
143  $pageField = 'revactor_page';
144  }
145 
146  if ( $resultPageSet === null ) {
147  $this->parseParameters( $params );
148  $this->token = $params['token'];
149  $opts = [ 'page' ];
150  if ( $this->fld_user ) {
151  $opts[] = 'user';
152  }
153  $revQuery = $revisionStore->getQueryInfo( $opts );
154 
155  if ( $idField !== 'rev_id' ) {
156  $aliasFields = [ 'rev_id' => $idField, 'rev_timestamp' => $tsField, 'rev_page' => $pageField ];
157  $revQuery['fields'] = array_merge(
158  $aliasFields,
159  array_diff( $revQuery['fields'], array_keys( $aliasFields ) )
160  );
161  }
162 
163  $this->addTables( $revQuery['tables'] );
164  $this->addFields( $revQuery['fields'] );
165  $this->addJoinConds( $revQuery['joins'] );
166  } else {
167  $this->limit = $this->getParameter( 'limit' ) ?: 10;
168  // Always join 'page' so orphaned revisions are filtered out
169  $this->addTables( [ 'revision', 'page' ] );
170  $this->addJoinConds(
171  [ 'page' => [ 'JOIN', [ 'page_id = rev_page' ] ] ]
172  );
173  $this->addFields( [
174  'rev_id' => $idField, 'rev_timestamp' => $tsField, 'rev_page' => $pageField
175  ] );
176  }
177 
178  if ( $this->fld_tags ) {
179  $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'revision' ) ] );
180  }
181 
182  if ( $params['tag'] !== null ) {
183  $this->addTables( 'change_tag' );
184  $this->addJoinConds(
185  [ 'change_tag' => [ 'JOIN', [ 'rev_id=ct_rev_id' ] ] ]
186  );
187  $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
188  try {
189  $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) );
190  } catch ( NameTableAccessException $exception ) {
191  // Return nothing.
192  $this->addWhere( '1=0' );
193  }
194  }
195 
196  if ( $resultPageSet === null && $this->fetchContent ) {
197  // For each page we will request, the user must have read rights for that page
198  $status = Status::newGood();
199  $user = $this->getUser();
200 
202  foreach ( $pageSet->getGoodTitles() as $title ) {
203  if ( !$this->getPermissionManager()->userCan( 'read', $user, $title ) ) {
204  $status->fatal( ApiMessage::create(
205  [ 'apierror-cannotviewtitle', wfEscapeWikiText( $title->getPrefixedText() ) ],
206  'accessdenied'
207  ) );
208  }
209  }
210  if ( !$status->isGood() ) {
211  $this->dieStatus( $status );
212  }
213  }
214 
215  if ( $enumRevMode ) {
216  // Indexes targeted:
217  // page_timestamp if we don't have rvuser
218  // page_actor_timestamp (on revision_actor_temp) if we have rvuser in READ_NEW mode
219  // page_user_timestamp if we have a logged-in rvuser
220  // page_timestamp or usertext_timestamp if we have an IP rvuser
221 
222  // This is mostly to prevent parameter errors (and optimize SQL?)
223  $this->requireMaxOneParameter( $params, 'startid', 'start' );
224  $this->requireMaxOneParameter( $params, 'endid', 'end' );
225  $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
226 
227  if ( $params['continue'] !== null ) {
228  $cont = explode( '|', $params['continue'] );
229  $this->dieContinueUsageIf( count( $cont ) != 2 );
230  $op = ( $params['dir'] === 'newer' ? '>' : '<' );
231  $continueTimestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
232  $continueId = (int)$cont[1];
233  $this->dieContinueUsageIf( $continueId != $cont[1] );
234  $this->addWhere( "$tsField $op $continueTimestamp OR " .
235  "($tsField = $continueTimestamp AND " .
236  "$idField $op= $continueId)"
237  );
238  }
239 
240  // Convert startid/endid to timestamps (T163532)
241  $revids = [];
242  if ( $params['startid'] !== null ) {
243  $revids[] = (int)$params['startid'];
244  }
245  if ( $params['endid'] !== null ) {
246  $revids[] = (int)$params['endid'];
247  }
248  if ( $revids ) {
249  $db = $this->getDB();
250  $sql = $db->unionQueries( [
251  $db->selectSQLText(
252  'revision',
253  [ 'id' => 'rev_id', 'ts' => 'rev_timestamp' ],
254  [ 'rev_id' => $revids ],
255  __METHOD__
256  ),
257  $db->selectSQLText(
258  'archive',
259  [ 'id' => 'ar_rev_id', 'ts' => 'ar_timestamp' ],
260  [ 'ar_rev_id' => $revids ],
261  __METHOD__
262  ),
263  ], $db::UNION_DISTINCT );
264  $res = $db->query( $sql, __METHOD__ );
265  foreach ( $res as $row ) {
266  if ( (int)$row->id === (int)$params['startid'] ) {
267  $params['start'] = $row->ts;
268  }
269  if ( (int)$row->id === (int)$params['endid'] ) {
270  $params['end'] = $row->ts;
271  }
272  }
273  if ( $params['startid'] !== null && $params['start'] === null ) {
274  $p = $this->encodeParamName( 'startid' );
275  $this->dieWithError( [ 'apierror-revisions-badid', $p ], "badid_$p" );
276  }
277  if ( $params['endid'] !== null && $params['end'] === null ) {
278  $p = $this->encodeParamName( 'endid' );
279  $this->dieWithError( [ 'apierror-revisions-badid', $p ], "badid_$p" );
280  }
281 
282  if ( $params['start'] !== null ) {
283  $op = ( $params['dir'] === 'newer' ? '>' : '<' );
284  $ts = $db->addQuotes( $db->timestampOrNull( $params['start'] ) );
285  if ( $params['startid'] !== null ) {
286  $this->addWhere( "$tsField $op $ts OR "
287  . "$tsField = $ts AND $idField $op= " . (int)$params['startid'] );
288  } else {
289  $this->addWhere( "$tsField $op= $ts" );
290  }
291  }
292  if ( $params['end'] !== null ) {
293  $op = ( $params['dir'] === 'newer' ? '<' : '>' ); // Yes, opposite of the above
294  $ts = $db->addQuotes( $db->timestampOrNull( $params['end'] ) );
295  if ( $params['endid'] !== null ) {
296  $this->addWhere( "$tsField $op $ts OR "
297  . "$tsField = $ts AND $idField $op= " . (int)$params['endid'] );
298  } else {
299  $this->addWhere( "$tsField $op= $ts" );
300  }
301  }
302  } else {
303  $this->addTimestampWhereRange( $tsField, $params['dir'],
304  $params['start'], $params['end'] );
305  }
306 
307  $sort = ( $params['dir'] === 'newer' ? '' : 'DESC' );
308  $this->addOption( 'ORDER BY', [ "rev_timestamp $sort", "rev_id $sort" ] );
309 
310  // There is only one ID, use it
311  $ids = array_keys( $pageSet->getGoodTitles() );
312  $this->addWhereFld( $pageField, reset( $ids ) );
313 
314  if ( $params['user'] !== null ) {
315  $actorQuery = ActorMigration::newMigration()
316  ->getWhere( $db, 'rev_user', User::newFromName( $params['user'], false ) );
317  $this->addTables( $actorQuery['tables'] );
318  $this->addJoinConds( $actorQuery['joins'] );
319  $this->addWhere( $actorQuery['conds'] );
320  } elseif ( $params['excludeuser'] !== null ) {
321  $actorQuery = ActorMigration::newMigration()
322  ->getWhere( $db, 'rev_user', User::newFromName( $params['excludeuser'], false ) );
323  $this->addTables( $actorQuery['tables'] );
324  $this->addJoinConds( $actorQuery['joins'] );
325  $this->addWhere( 'NOT(' . $actorQuery['conds'] . ')' );
326  }
327  if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
328  // Paranoia: avoid brute force searches (T19342)
329  if ( !$this->getPermissionManager()->userHasRight( $this->getUser(), 'deletedhistory' ) ) {
330  $bitmask = RevisionRecord::DELETED_USER;
331  } elseif ( !$this->getPermissionManager()
332  ->userHasAnyRight( $this->getUser(), 'suppressrevision', 'viewsuppressed' )
333  ) {
334  $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
335  } else {
336  $bitmask = 0;
337  }
338  if ( $bitmask ) {
339  $this->addWhere( $db->bitAnd( 'rev_deleted', $bitmask ) . " != $bitmask" );
340  }
341  }
342  } elseif ( $revCount > 0 ) {
343  // Always targets the PRIMARY index
344 
345  $revs = $pageSet->getLiveRevisionIDs();
346 
347  // Get all revision IDs
348  $this->addWhereFld( 'rev_id', array_keys( $revs ) );
349 
350  if ( $params['continue'] !== null ) {
351  $this->addWhere( 'rev_id >= ' . (int)$params['continue'] );
352  }
353  $this->addOption( 'ORDER BY', 'rev_id' );
354  } elseif ( $pageCount > 0 ) {
355  // Always targets the rev_page_id index
356 
357  $titles = $pageSet->getGoodTitles();
358 
359  // When working in multi-page non-enumeration mode,
360  // limit to the latest revision only
361  $this->addWhere( 'page_latest=rev_id' );
362 
363  // Get all page IDs
364  $this->addWhereFld( 'page_id', array_keys( $titles ) );
365  // Every time someone relies on equality propagation, god kills a kitten :)
366  $this->addWhereFld( 'rev_page', array_keys( $titles ) );
367 
368  if ( $params['continue'] !== null ) {
369  $cont = explode( '|', $params['continue'] );
370  $this->dieContinueUsageIf( count( $cont ) != 2 );
371  $pageid = (int)$cont[0];
372  $revid = (int)$cont[1];
373  $this->addWhere(
374  "rev_page > $pageid OR " .
375  "(rev_page = $pageid AND " .
376  "rev_id >= $revid)"
377  );
378  }
379  $this->addOption( 'ORDER BY', [
380  'rev_page',
381  'rev_id'
382  ] );
383  } else {
384  ApiBase::dieDebug( __METHOD__, 'param validation?' );
385  }
386 
387  $this->addOption( 'LIMIT', $this->limit + 1 );
388 
389  // T224017: `rev_timestamp` is never the correct index to use for this module, but
390  // MariaDB (10.1.37-39) sometimes insists on trying to use it anyway. Tell it not to.
391  $this->addOption( 'IGNORE INDEX', [ 'revision' => 'rev_timestamp' ] );
392 
393  $count = 0;
394  $generated = [];
395  $hookData = [];
396  $res = $this->select( __METHOD__, [], $hookData );
397 
398  foreach ( $res as $row ) {
399  if ( ++$count > $this->limit ) {
400  // We've reached the one extra which shows that there are
401  // additional pages to be had. Stop here...
402  if ( $enumRevMode ) {
403  $this->setContinueEnumParameter( 'continue',
404  $row->rev_timestamp . '|' . (int)$row->rev_id );
405  } elseif ( $revCount > 0 ) {
406  $this->setContinueEnumParameter( 'continue', (int)$row->rev_id );
407  } else {
408  $this->setContinueEnumParameter( 'continue', (int)$row->rev_page .
409  '|' . (int)$row->rev_id );
410  }
411  break;
412  }
413 
414  if ( $resultPageSet !== null ) {
415  $generated[] = $row->rev_id;
416  } else {
417  $revision = $revisionStore->newRevisionFromRow( $row, 0, Title::newFromRow( $row ) );
418  $rev = $this->extractRevisionInfo( $revision, $row );
419 
420  if ( $this->token !== null ) {
421  $title = Title::newFromLinkTarget( $revision->getPageAsLinkTarget() );
422  $revisionCompat = new Revision( $revision );
424  foreach ( $this->token as $t ) {
425  $val = call_user_func( $tokenFunctions[$t], $title->getArticleID(), $title, $revisionCompat );
426  if ( $val === false ) {
427  $this->addWarning( [ 'apiwarn-tokennotallowed', $t ] );
428  } else {
429  $rev[$t . 'token'] = $val;
430  }
431  }
432  }
433 
434  $fit = $this->processRow( $row, $rev, $hookData ) &&
435  $this->addPageSubItem( $row->rev_page, $rev, 'rev' );
436  if ( !$fit ) {
437  if ( $enumRevMode ) {
438  $this->setContinueEnumParameter( 'continue',
439  $row->rev_timestamp . '|' . (int)$row->rev_id );
440  } elseif ( $revCount > 0 ) {
441  $this->setContinueEnumParameter( 'continue', (int)$row->rev_id );
442  } else {
443  $this->setContinueEnumParameter( 'continue', (int)$row->rev_page .
444  '|' . (int)$row->rev_id );
445  }
446  break;
447  }
448  }
449  }
450 
451  if ( $resultPageSet !== null ) {
452  $resultPageSet->populateFromRevisionIDs( $generated );
453  }
454  }
455 
456  public function getCacheMode( $params ) {
457  if ( isset( $params['token'] ) ) {
458  return 'private';
459  }
460  return parent::getCacheMode( $params );
461  }
462 
463  public function getAllowedParams() {
464  $ret = parent::getAllowedParams() + [
465  'startid' => [
466  ApiBase::PARAM_TYPE => 'integer',
467  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
468  ],
469  'endid' => [
470  ApiBase::PARAM_TYPE => 'integer',
471  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
472  ],
473  'start' => [
474  ApiBase::PARAM_TYPE => 'timestamp',
475  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
476  ],
477  'end' => [
478  ApiBase::PARAM_TYPE => 'timestamp',
479  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
480  ],
481  'dir' => [
482  ApiBase::PARAM_DFLT => 'older',
484  'newer',
485  'older'
486  ],
487  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
488  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
489  ],
490  'user' => [
491  ApiBase::PARAM_TYPE => 'user',
492  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
493  ],
494  'excludeuser' => [
495  ApiBase::PARAM_TYPE => 'user',
496  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
497  ],
498  'tag' => null,
499  'token' => [
501  ApiBase::PARAM_TYPE => array_keys( $this->getTokenFunctions() ),
503  ],
504  'continue' => [
505  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
506  ],
507  ];
508 
509  $ret['limit'][ApiBase::PARAM_HELP_MSG_INFO] = [ [ 'singlepageonly' ] ];
510 
511  return $ret;
512  }
513 
514  protected function getExamplesMessages() {
515  return [
516  'action=query&prop=revisions&titles=API|Main%20Page&' .
517  'rvslots=*&rvprop=timestamp|user|comment|content'
518  => 'apihelp-query+revisions-example-content',
519  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
520  'rvprop=timestamp|user|comment'
521  => 'apihelp-query+revisions-example-last5',
522  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
523  'rvprop=timestamp|user|comment&rvdir=newer'
524  => 'apihelp-query+revisions-example-first5',
525  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
526  'rvprop=timestamp|user|comment&rvdir=newer&rvstart=2006-05-01T00:00:00Z'
527  => 'apihelp-query+revisions-example-first5-after',
528  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
529  'rvprop=timestamp|user|comment&rvexcludeuser=127.0.0.1'
530  => 'apihelp-query+revisions-example-first5-not-localhost',
531  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
532  'rvprop=timestamp|user|comment&rvuser=MediaWiki%20default'
533  => 'apihelp-query+revisions-example-first5-user',
534  ];
535  }
536 
537  public function getHelpUrls() {
538  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Revisions';
539  }
540 }
select( $method, $extraQuery=[], array &$hookData=null)
Execute a SELECT query based on the values in the internal arrays.
static getRollbackToken( $pageid, $title, $rev)
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below...
Definition: ApiBase.php:94
getDB()
Get the Query database connection (read-only)
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking, formatting, etc.
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
This class contains a list of pages that the client has requested.
Definition: ApiPageSet.php:40
processRow( $row, array &$data, array &$hookData)
Call the ApiQueryBaseProcessRow hook.
dieStatus(StatusValue $status)
Throw an ApiUsageException based on the Status object.
Definition: ApiBase.php:2077
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:55
Exception representing a failure to look up a row from a name table.
$sort
const PARAM_HELP_MSG_INFO
(array) Specify additional information tags for the parameter.
Definition: ApiBase.php:148
lacksSameOriginSecurity()
Returns true if the current request breaks the same-origin policy.
Definition: ApiBase.php:568
A base class for functions common to producing a list of revisions.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:2005
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user...
Definition: ApiBase.php:761
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
static newFromRow( $row)
Make a Title object from a DB row.
Definition: Title.php:518
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
Definition: ApiBase.php:876
addPageSubItem( $pageId, $item, $elemname=null)
Same as addPageSubItems(), but one element of $data at a time.
run(ApiPageSet $resultPageSet=null)
static newMigration()
Static constructor.
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:81
dieContinueUsageIf( $condition)
Die with the &#39;badcontinue&#39; error.
Definition: ApiBase.php:2199
addFields( $value)
Add a set of fields to select to the internal array.
This is the main query class.
Definition: ApiQuery.php:37
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter...
Definition: ApiBase.php:131
A query action to enumerate revisions of a given page, or show top revisions of multiple pages...
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition: Title.php:271
addTimestampWhereRange( $field, $dir, $start, $end, $sort=true)
Add a WHERE clause corresponding to a range, similar to addWhereRange, but converts $start and $end t...
getModulePrefix()
Get parameter prefix (usually two letters or an empty string).
Definition: ApiBase.php:528
addWhere( $value)
Add a set of WHERE clauses to the internal array.
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
Definition: ApiBase.php:1924
$revQuery
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition: ApiBase.php:58
getPermissionManager()
Obtain a PermissionManager instance that subclasses may use in their authorization checks...
Definition: ApiBase.php:710
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:2211
addWhereFld( $field, $value)
Equivalent to addWhere( [ $field => $value ] )
extractRevisionInfo(RevisionRecord $revision, $row)
Extract information from the RevisionRecord.
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
const PARAM_DEPRECATED
(boolean) Is the parameter deprecated (will show a warning)?
Definition: ApiBase.php:112
parseParameters( $params)
Parse the parameters into the various instance fields.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:515
__construct(ApiQuery $query, $moduleName)
static makeTagSummarySubquery( $tables)
Make the tag summary subquery based on the given tables and return it.
Definition: ChangeTags.php:837
requireMaxOneParameter( $params,... $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:928
getPageSet()
Get the PageSet object to work on.
encodeParamName( $paramName)
Overrides ApiBase to prepend &#39;g&#39; to every generator parameter.
return true
Definition: router.php:92
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
static create( $msg, $code=null, array $data=null)
Create an IApiMessage for the message.
Definition: ApiMessage.php:40