MediaWiki  master
ApiQueryRevisions.php
Go to the documentation of this file.
1 <?php
32 
42 
44  private $revisionStore;
45 
48 
50  private $actorMigration;
51 
64  public function __construct(
65  ApiQuery $query,
66  $moduleName,
75  ) {
76  parent::__construct(
77  $query,
78  $moduleName,
79  'rv',
86  );
87  $this->revisionStore = $revisionStore;
88  $this->changeTagDefStore = $changeTagDefStore;
89  $this->actorMigration = $actorMigration;
90  }
91 
92  protected function run( ApiPageSet $resultPageSet = null ) {
93  $params = $this->extractRequestParams( false );
94 
95  // If any of those parameters are used, work in 'enumeration' mode.
96  // Enum mode can only be used when exactly one page is provided.
97  // Enumerating revisions on multiple pages make it extremely
98  // difficult to manage continuations and require additional SQL indexes
99  $enumRevMode = ( $params['user'] !== null || $params['excludeuser'] !== null ||
100  $params['limit'] !== null || $params['startid'] !== null ||
101  $params['endid'] !== null || $params['dir'] === 'newer' ||
102  $params['start'] !== null || $params['end'] !== null );
103 
104  $pageSet = $this->getPageSet();
105  $pageCount = $pageSet->getGoodTitleCount();
106  $revCount = $pageSet->getRevisionCount();
107 
108  // Optimization -- nothing to do
109  if ( $revCount === 0 && $pageCount === 0 ) {
110  // Nothing to do
111  return;
112  }
113  if ( $revCount > 0 && count( $pageSet->getLiveRevisionIDs() ) === 0 ) {
114  // We're in revisions mode but all given revisions are deleted
115  return;
116  }
117 
118  if ( $revCount > 0 && $enumRevMode ) {
119  $this->dieWithError(
120  [ 'apierror-revisions-norevids', $this->getModulePrefix() ], 'invalidparammix'
121  );
122  }
123 
124  if ( $pageCount > 1 && $enumRevMode ) {
125  $this->dieWithError(
126  [ 'apierror-revisions-singlepage', $this->getModulePrefix() ], 'invalidparammix'
127  );
128  }
129 
130  // In non-enum mode, rvlimit can't be directly used. Use the maximum
131  // allowed value.
132  if ( !$enumRevMode ) {
133  $this->setParsedLimit = false;
134  $params['limit'] = 'max';
135  }
136 
137  $db = $this->getDB();
138 
139  $idField = 'rev_id';
140  $tsField = 'rev_timestamp';
141  $pageField = 'rev_page';
142 
143  $ignoreIndex = [
144  // T224017: `rev_timestamp` is never the correct index to use for this module, but
145  // MariaDB sometimes insists on trying to use it anyway. Tell it not to.
146  // Last checked with MariaDB 10.4.13
147  'revision' => 'rev_timestamp',
148  ];
149  $useIndex = [];
150 
151  if ( $params['user'] !== null &&
152  ( $this->getConfig()->get( 'ActorTableSchemaMigrationStage' ) & SCHEMA_COMPAT_READ_TEMP )
153  ) {
154  // We're going to want to use the page_actor_timestamp index (on revision_actor_temp)
155  // so use that table's denormalized fields.
156  $idField = 'revactor_rev';
157  $tsField = 'revactor_timestamp';
158  $pageField = 'revactor_page';
159  }
160 
161  if ( $resultPageSet === null ) {
162  $this->parseParameters( $params );
163  $opts = [ 'page' ];
164  if ( $this->fld_user ) {
165  $opts[] = 'user';
166  }
167  $revQuery = $this->revisionStore->getQueryInfo( $opts );
168 
169  if ( $idField !== 'rev_id' ) {
170  $aliasFields = [ 'rev_id' => $idField, 'rev_timestamp' => $tsField, 'rev_page' => $pageField ];
171  $revQuery['fields'] = array_merge(
172  $aliasFields,
173  array_diff( $revQuery['fields'], array_keys( $aliasFields ) )
174  );
175  }
176 
177  $this->addTables( $revQuery['tables'] );
178  $this->addFields( $revQuery['fields'] );
179  $this->addJoinConds( $revQuery['joins'] );
180  } else {
181  $this->limit = $this->getParameter( 'limit' ) ?: 10;
182  // Always join 'page' so orphaned revisions are filtered out
183  $this->addTables( [ 'revision', 'page' ] );
184  $this->addJoinConds(
185  [ 'page' => [ 'JOIN', [ 'page_id = rev_page' ] ] ]
186  );
187  $this->addFields( [
188  'rev_id' => $idField, 'rev_timestamp' => $tsField, 'rev_page' => $pageField
189  ] );
190  }
191 
192  if ( $this->fld_tags ) {
193  $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'revision' ) ] );
194  }
195 
196  if ( $params['tag'] !== null ) {
197  $this->addTables( 'change_tag' );
198  $this->addJoinConds(
199  [ 'change_tag' => [ 'JOIN', [ 'rev_id=ct_rev_id' ] ] ]
200  );
201  try {
202  $this->addWhereFld( 'ct_tag_id', $this->changeTagDefStore->getId( $params['tag'] ) );
203  } catch ( NameTableAccessException $exception ) {
204  // Return nothing.
205  $this->addWhere( '1=0' );
206  }
207  }
208 
209  if ( $resultPageSet === null && $this->fetchContent ) {
210  // For each page we will request, the user must have read rights for that page
211  $status = Status::newGood();
212 
214  foreach ( $pageSet->getGoodTitles() as $title ) {
215  if ( !$this->getAuthority()->authorizeRead( 'read', $title ) ) {
216  $status->fatal( ApiMessage::create(
217  [ 'apierror-cannotviewtitle', wfEscapeWikiText( $title->getPrefixedText() ) ],
218  'accessdenied'
219  ) );
220  }
221  }
222  if ( !$status->isGood() ) {
223  $this->dieStatus( $status );
224  }
225  }
226 
227  if ( $enumRevMode ) {
228  // Indexes targeted:
229  // page_timestamp if we don't have rvuser
230  // page_actor_timestamp (on revision_actor_temp) if we have rvuser in READ_NEW mode
231  // page_user_timestamp if we have a logged-in rvuser
232  // page_timestamp or usertext_timestamp if we have an IP rvuser
233 
234  // This is mostly to prevent parameter errors (and optimize SQL?)
235  $this->requireMaxOneParameter( $params, 'startid', 'start' );
236  $this->requireMaxOneParameter( $params, 'endid', 'end' );
237  $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
238 
239  if ( $params['continue'] !== null ) {
240  $cont = explode( '|', $params['continue'] );
241  $this->dieContinueUsageIf( count( $cont ) != 2 );
242  $op = ( $params['dir'] === 'newer' ? '>' : '<' );
243  $continueTimestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
244  $continueId = (int)$cont[1];
245  $this->dieContinueUsageIf( $continueId != $cont[1] );
246  $this->addWhere( "$tsField $op $continueTimestamp OR " .
247  "($tsField = $continueTimestamp AND " .
248  "$idField $op= $continueId)"
249  );
250  }
251 
252  // Convert startid/endid to timestamps (T163532)
253  $revids = [];
254  if ( $params['startid'] !== null ) {
255  $revids[] = (int)$params['startid'];
256  }
257  if ( $params['endid'] !== null ) {
258  $revids[] = (int)$params['endid'];
259  }
260  if ( $revids ) {
261  $db = $this->getDB();
262  $sql = $db->unionQueries( [
263  $db->selectSQLText(
264  'revision',
265  [ 'id' => 'rev_id', 'ts' => 'rev_timestamp' ],
266  [ 'rev_id' => $revids ],
267  __METHOD__
268  ),
269  $db->selectSQLText(
270  'archive',
271  [ 'id' => 'ar_rev_id', 'ts' => 'ar_timestamp' ],
272  [ 'ar_rev_id' => $revids ],
273  __METHOD__
274  ),
275  ], $db::UNION_DISTINCT );
276  $res = $db->query( $sql, __METHOD__ );
277  foreach ( $res as $row ) {
278  if ( (int)$row->id === (int)$params['startid'] ) {
279  $params['start'] = $row->ts;
280  }
281  if ( (int)$row->id === (int)$params['endid'] ) {
282  $params['end'] = $row->ts;
283  }
284  }
285  if ( $params['startid'] !== null && $params['start'] === null ) {
286  $p = $this->encodeParamName( 'startid' );
287  $this->dieWithError( [ 'apierror-revisions-badid', $p ], "badid_$p" );
288  }
289  if ( $params['endid'] !== null && $params['end'] === null ) {
290  $p = $this->encodeParamName( 'endid' );
291  $this->dieWithError( [ 'apierror-revisions-badid', $p ], "badid_$p" );
292  }
293 
294  if ( $params['start'] !== null ) {
295  $op = ( $params['dir'] === 'newer' ? '>' : '<' );
296  $ts = $db->addQuotes( $db->timestampOrNull( $params['start'] ) );
297  if ( $params['startid'] !== null ) {
298  $this->addWhere( "$tsField $op $ts OR "
299  . "$tsField = $ts AND $idField $op= " . (int)$params['startid'] );
300  } else {
301  $this->addWhere( "$tsField $op= $ts" );
302  }
303  }
304  if ( $params['end'] !== null ) {
305  $op = ( $params['dir'] === 'newer' ? '<' : '>' ); // Yes, opposite of the above
306  $ts = $db->addQuotes( $db->timestampOrNull( $params['end'] ) );
307  if ( $params['endid'] !== null ) {
308  $this->addWhere( "$tsField $op $ts OR "
309  . "$tsField = $ts AND $idField $op= " . (int)$params['endid'] );
310  } else {
311  $this->addWhere( "$tsField $op= $ts" );
312  }
313  }
314  } else {
315  $this->addTimestampWhereRange( $tsField, $params['dir'],
316  $params['start'], $params['end'] );
317  }
318 
319  $sort = ( $params['dir'] === 'newer' ? '' : 'DESC' );
320  $this->addOption( 'ORDER BY', [ "rev_timestamp $sort", "rev_id $sort" ] );
321 
322  // There is only one ID, use it
323  $ids = array_keys( $pageSet->getGoodTitles() );
324  $this->addWhereFld( $pageField, reset( $ids ) );
325 
326  if ( $params['user'] !== null ) {
327  $actorQuery = $this->actorMigration->getWhere( $db, 'rev_user', $params['user'] );
328  $this->addTables( $actorQuery['tables'] );
329  $this->addJoinConds( $actorQuery['joins'] );
330  $this->addWhere( $actorQuery['conds'] );
331  } elseif ( $params['excludeuser'] !== null ) {
332  $actorQuery = $this->actorMigration->getWhere( $db, 'rev_user', $params['excludeuser'] );
333  $this->addTables( $actorQuery['tables'] );
334  $this->addJoinConds( $actorQuery['joins'] );
335  $this->addWhere( 'NOT(' . $actorQuery['conds'] . ')' );
336  } else {
337  // T270033 Index renaming
338  $revIndex = $this->getDB()->indexExists( 'revision', 'page_timestamp', __METHOD__ )
339  ? 'page_timestamp'
340  : 'rev_page_timestamp';
341  // T258480: MariaDB ends up using rev_page_actor_timestamp in some cases here.
342  // Last checked with MariaDB 10.4.13
343  // Unless we are filtering by user (see above), we always want to use the
344  // "history" index on the revision table, namely page_timestamp.
345  $useIndex['revision'] = $revIndex;
346  }
347 
348  if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
349  // Paranoia: avoid brute force searches (T19342)
350  if ( !$this->getAuthority()->isAllowed( 'deletedhistory' ) ) {
351  $bitmask = RevisionRecord::DELETED_USER;
352  } elseif ( !$this->getAuthority()->isAllowedAny( 'suppressrevision', 'viewsuppressed' )
353  ) {
354  $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
355  } else {
356  $bitmask = 0;
357  }
358  if ( $bitmask ) {
359  $this->addWhere( $db->bitAnd( 'rev_deleted', $bitmask ) . " != $bitmask" );
360  }
361  }
362  } elseif ( $revCount > 0 ) {
363  // Always targets the PRIMARY index
364 
365  $revs = $pageSet->getLiveRevisionIDs();
366 
367  // Get all revision IDs
368  $this->addWhereFld( 'rev_id', array_keys( $revs ) );
369 
370  if ( $params['continue'] !== null ) {
371  $this->addWhere( 'rev_id >= ' . (int)$params['continue'] );
372  }
373  $this->addOption( 'ORDER BY', 'rev_id' );
374  } elseif ( $pageCount > 0 ) {
375  // Always targets the rev_page_id index
376 
377  $titles = $pageSet->getGoodTitles();
378 
379  // When working in multi-page non-enumeration mode,
380  // limit to the latest revision only
381  $this->addWhere( 'page_latest=rev_id' );
382 
383  // Get all page IDs
384  $this->addWhereFld( 'page_id', array_keys( $titles ) );
385  // Every time someone relies on equality propagation, god kills a kitten :)
386  $this->addWhereFld( 'rev_page', array_keys( $titles ) );
387 
388  if ( $params['continue'] !== null ) {
389  $cont = explode( '|', $params['continue'] );
390  $this->dieContinueUsageIf( count( $cont ) != 2 );
391  $pageid = (int)$cont[0];
392  $revid = (int)$cont[1];
393  $this->addWhere(
394  "rev_page > $pageid OR " .
395  "(rev_page = $pageid AND " .
396  "rev_id >= $revid)"
397  );
398  }
399  $this->addOption( 'ORDER BY', [
400  'rev_page',
401  'rev_id'
402  ] );
403  } else {
404  ApiBase::dieDebug( __METHOD__, 'param validation?' );
405  }
406 
407  $this->addOption( 'LIMIT', $this->limit + 1 );
408 
409  $this->addOption( 'IGNORE INDEX', $ignoreIndex );
410 
411  if ( $useIndex ) {
412  $this->addOption( 'USE INDEX', $useIndex );
413  }
414 
415  $count = 0;
416  $generated = [];
417  $hookData = [];
418  $res = $this->select( __METHOD__, [], $hookData );
419 
420  foreach ( $res as $row ) {
421  if ( ++$count > $this->limit ) {
422  // We've reached the one extra which shows that there are
423  // additional pages to be had. Stop here...
424  if ( $enumRevMode ) {
425  $this->setContinueEnumParameter( 'continue',
426  $row->rev_timestamp . '|' . (int)$row->rev_id );
427  } elseif ( $revCount > 0 ) {
428  $this->setContinueEnumParameter( 'continue', (int)$row->rev_id );
429  } else {
430  $this->setContinueEnumParameter( 'continue', (int)$row->rev_page .
431  '|' . (int)$row->rev_id );
432  }
433  break;
434  }
435 
436  if ( $resultPageSet !== null ) {
437  $generated[] = $row->rev_id;
438  } else {
439  $revision = $this->revisionStore->newRevisionFromRow( $row, 0, Title::newFromRow( $row ) );
440  $rev = $this->extractRevisionInfo( $revision, $row );
441  $fit = $this->processRow( $row, $rev, $hookData ) &&
442  $this->addPageSubItem( $row->rev_page, $rev, 'rev' );
443  if ( !$fit ) {
444  if ( $enumRevMode ) {
445  $this->setContinueEnumParameter( 'continue',
446  $row->rev_timestamp . '|' . (int)$row->rev_id );
447  } elseif ( $revCount > 0 ) {
448  $this->setContinueEnumParameter( 'continue', (int)$row->rev_id );
449  } else {
450  $this->setContinueEnumParameter( 'continue', (int)$row->rev_page .
451  '|' . (int)$row->rev_id );
452  }
453  break;
454  }
455  }
456  }
457 
458  if ( $resultPageSet !== null ) {
459  $resultPageSet->populateFromRevisionIDs( $generated );
460  }
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  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
493  UserDef::PARAM_RETURN_OBJECT => true,
494  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
495  ],
496  'excludeuser' => [
497  ApiBase::PARAM_TYPE => 'user',
498  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
499  UserDef::PARAM_RETURN_OBJECT => true,
500  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
501  ],
502  'tag' => null,
503  'continue' => [
504  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
505  ],
506  ];
507 
508  $ret['limit'][ApiBase::PARAM_HELP_MSG_INFO] = [ [ 'singlepageonly' ] ];
509 
510  return $ret;
511  }
512 
513  protected function getExamplesMessages() {
514  return [
515  'action=query&prop=revisions&titles=API|Main%20Page&' .
516  'rvslots=*&rvprop=timestamp|user|comment|content'
517  => 'apihelp-query+revisions-example-content',
518  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
519  'rvprop=timestamp|user|comment'
520  => 'apihelp-query+revisions-example-last5',
521  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
522  'rvprop=timestamp|user|comment&rvdir=newer'
523  => 'apihelp-query+revisions-example-first5',
524  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
525  'rvprop=timestamp|user|comment&rvdir=newer&rvstart=2006-05-01T00:00:00Z'
526  => 'apihelp-query+revisions-example-first5-after',
527  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
528  'rvprop=timestamp|user|comment&rvexcludeuser=127.0.0.1'
529  => 'apihelp-query+revisions-example-first5-not-localhost',
530  'action=query&prop=revisions&titles=Main%20Page&rvlimit=5&' .
531  'rvprop=timestamp|user|comment&rvuser=MediaWiki%20default'
532  => 'apihelp-query+revisions-example-first5-user',
533  ];
534  }
535 
536  public function getHelpUrls() {
537  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Revisions';
538  }
539 }
ApiQueryRevisionsBase\parseParameters
parseParameters( $params)
Parse the parameters into the various instance fields.
Definition: ApiQueryRevisionsBase.php:138
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:72
ChangeTags\makeTagSummarySubquery
static makeTagSummarySubquery( $tables)
Make the tag summary subquery based on the given tables and return it.
Definition: ChangeTags.php:999
ApiQueryBase\processRow
processRow( $row, array &$data, array &$hookData)
Call the ApiQueryBaseProcessRow hook.
Definition: ApiQueryBase.php:449
ApiQueryBase\addFields
addFields( $value)
Add a set of fields to select to the internal array.
Definition: ApiQueryBase.php:212
ApiQuery
This is the main query class.
Definition: ApiQuery.php:39
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:47
ApiQueryGeneratorBase\encodeParamName
encodeParamName( $paramName)
Overrides ApiBase to prepend 'g' to every generator parameter.
Definition: ApiQueryGeneratorBase.php:70
ApiQueryRevisions\__construct
__construct(ApiQuery $query, $moduleName, RevisionStore $revisionStore, IContentHandlerFactory $contentHandlerFactory, ParserFactory $parserFactory, SlotRoleRegistry $slotRoleRegistry, NameTableStore $changeTagDefStore, ActorMigration $actorMigration, ContentRenderer $contentRenderer, ContentTransformer $contentTransformer)
Definition: ApiQueryRevisions.php:64
ApiQueryRevisionsBase\$contentHandlerFactory
IContentHandlerFactory $contentHandlerFactory
Definition: ApiQueryRevisionsBase.php:69
MediaWiki\Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:89
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1436
ApiQueryBase\addTimestampWhereRange
addTimestampWhereRange( $field, $dir, $start, $end, $sort=true)
Add a WHERE clause corresponding to a range, similar to addWhereRange, but converts $start and $end t...
Definition: ApiQueryBase.php:366
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:162
ApiBase\PARAM_TYPE
const PARAM_TYPE
Definition: ApiBase.php:81
ApiQueryRevisions\$actorMigration
ActorMigration $actorMigration
Definition: ApiQueryRevisions.php:50
ApiQueryRevisions\run
run(ApiPageSet $resultPageSet=null)
Definition: ApiQueryRevisions.php:92
ApiQueryBase\addOption
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
Definition: ApiQueryBase.php:378
ActorMigration
This is not intended to be a long-term part of MediaWiki; it will be deprecated and removed once acto...
Definition: ActorMigration.php:15
$res
$res
Definition: testCompression.php:57
$revQuery
$revQuery
Definition: testCompression.php:56
ApiPageSet
This class contains a list of pages that the client has requested.
Definition: ApiPageSet.php:45
Wikimedia\ParamValidator\ParamValidator::TypeDef\UserDef
Type definition for user types.
Definition: UserDef.php:26
ApiQueryRevisionsBase
A base class for functions common to producing a list of revisions.
Definition: ApiQueryRevisionsBase.php:43
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
Definition: ApiQueryGeneratorBase.php:83
ApiQueryGeneratorBase\getPageSet
getPageSet()
Get the PageSet object to work on.
Definition: ApiQueryGeneratorBase.php:57
ApiQueryRevisionsBase\$contentRenderer
ContentRenderer $contentRenderer
Definition: ApiQueryRevisionsBase.php:78
Title\newFromRow
static newFromRow( $row)
Make a Title object from a DB row.
Definition: Title.php:577
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:117
ApiQueryRevisions\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryRevisions.php:513
MediaWiki\Content\Transform\ContentTransformer
A service to transform content.
Definition: ContentTransformer.php:15
ApiQueryBase\addTables
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
Definition: ApiQueryBase.php:182
ApiQueryBase\select
select( $method, $extraQuery=[], array &$hookData=null)
Execute a SELECT query based on the values in the internal arrays.
Definition: ApiQueryBase.php:399
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:764
$title
$title
Definition: testCompression.php:38
ApiMessage\create
static create( $msg, $code=null, array $data=null)
Create an IApiMessage for the message.
Definition: ApiMessage.php:43
MediaWiki\Content\Renderer\ContentRenderer
A service to render content.
Definition: ContentRenderer.php:15
ApiBase\getModulePrefix
getModulePrefix()
Get parameter prefix (usually two letters or an empty string).
Definition: ApiBase.php:505
ParserFactory
Definition: ParserFactory.php:37
ApiBase\requireMaxOneParameter
requireMaxOneParameter( $params,... $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:936
ApiQueryRevisionsBase\$parserFactory
ParserFactory $parserFactory
Definition: ApiQueryRevisionsBase.php:72
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:1626
MediaWiki\Content\IContentHandlerFactory
Definition: IContentHandlerFactory.php:10
ContextSource\getAuthority
getAuthority()
Definition: ContextSource.php:144
StatusValue\newGood
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:82
ApiQueryRevisionsBase\extractRevisionInfo
extractRevisionInfo(RevisionRecord $revision, $row)
Extract information from the RevisionRecord.
Definition: ApiQueryRevisionsBase.php:293
ApiQueryBase\addJoinConds
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
Definition: ApiQueryBase.php:201
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition: GlobalFunctions.php:1440
ApiQueryBase\addWhereFld
addWhereFld( $field, $value)
Equivalent to addWhere( [ $field => $value ] )
Definition: ApiQueryBase.php:282
MediaWiki\Storage\NameTableStore
Definition: NameTableStore.php:36
ApiQueryRevisionsBase\$slotRoleRegistry
SlotRoleRegistry $slotRoleRegistry
Definition: ApiQueryRevisionsBase.php:75
ApiBase\PARAM_HELP_MSG_INFO
const PARAM_HELP_MSG_INFO
(array) Specify additional information tags for the parameter.
Definition: ApiBase.php:179
ApiQueryRevisions\$changeTagDefStore
NameTableStore $changeTagDefStore
Definition: ApiQueryRevisions.php:47
Title
Represents a title within MediaWiki.
Definition: Title.php:47
ApiQueryRevisions\$revisionStore
RevisionStore $revisionStore
Definition: ApiQueryRevisions.php:44
ApiQueryRevisionsBase\$contentTransformer
ContentTransformer $contentTransformer
Definition: ApiQueryRevisionsBase.php:81
ApiBase\PARAM_DFLT
const PARAM_DFLT
Definition: ApiBase.php:73
ApiBase\getParameter
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
Definition: ApiBase.php:884
ApiBase\dieStatus
dieStatus(StatusValue $status)
Throw an ApiUsageException based on the Status object.
Definition: ApiBase.php:1499
MediaWiki\Storage\NameTableAccessException
Exception representing a failure to look up a row from a name table.
Definition: NameTableAccessException.php:33
ApiQueryRevisions\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryRevisions.php:536
MediaWiki\Revision\SlotRoleRegistry
A registry service for SlotRoleHandlers, used to define which slot roles are available on which page.
Definition: SlotRoleRegistry.php:48
ApiQueryBase\addWhere
addWhere( $value)
Add a set of WHERE clauses to the internal array.
Definition: ApiQueryBase.php:245
ApiQueryRevisions\getAllowedParams
getAllowedParams()
Definition: ApiQueryRevisions.php:463
ApiQueryBase\addPageSubItem
addPageSubItem( $pageId, $item, $elemname=null)
Same as addPageSubItems(), but one element of $data at a time.
Definition: ApiQueryBase.php:494
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:1639
ApiQueryRevisions
A query action to enumerate revisions of a given page, or show top revisions of multiple pages.
Definition: ApiQueryRevisions.php:41
SCHEMA_COMPAT_READ_TEMP
const SCHEMA_COMPAT_READ_TEMP
Definition: Defines.php:265