MediaWiki  master
ApiQueryDeletedrevs.php
Go to the documentation of this file.
1 <?php
33 
41 
43  private $commentStore;
44 
47 
49  private $revisionStore;
50 
53 
56 
66  public function __construct(
67  ApiQuery $query,
68  $moduleName,
74  ) {
75  parent::__construct( $query, $moduleName, 'dr' );
76  $this->commentStore = $commentStore;
77  $this->commentFormatter = $commentFormatter;
78  $this->revisionStore = $revisionStore;
79  $this->changeTagDefStore = $changeTagDefStore;
80  $this->linkBatchFactory = $linkBatchFactory;
81  }
82 
83  public function execute() {
84  // Before doing anything at all, let's check permissions
85  $this->checkUserRightsAny( 'deletedhistory' );
86 
87  $this->addDeprecation( 'apiwarn-deprecation-deletedrevs', 'action=query&list=deletedrevs' );
88 
89  $user = $this->getUser();
90  $db = $this->getDB();
91  $params = $this->extractRequestParams( false );
92  $prop = array_fill_keys( $params['prop'], true );
93  $fld_parentid = isset( $prop['parentid'] );
94  $fld_revid = isset( $prop['revid'] );
95  $fld_user = isset( $prop['user'] );
96  $fld_userid = isset( $prop['userid'] );
97  $fld_comment = isset( $prop['comment'] );
98  $fld_parsedcomment = isset( $prop['parsedcomment'] );
99  $fld_minor = isset( $prop['minor'] );
100  $fld_len = isset( $prop['len'] );
101  $fld_sha1 = isset( $prop['sha1'] );
102  $fld_content = isset( $prop['content'] );
103  $fld_token = isset( $prop['token'] );
104  $fld_tags = isset( $prop['tags'] );
105 
106  // If we're in a mode that breaks the same-origin policy, no tokens can
107  // be obtained
108  if ( $this->lacksSameOriginSecurity() ) {
109  $fld_token = false;
110  }
111 
112  // If user can't undelete, no tokens
113  if ( !$this->getAuthority()->isAllowed( 'undelete' ) ) {
114  $fld_token = false;
115  }
116 
117  $result = $this->getResult();
118  $pageSet = $this->getPageSet();
119  $titles = $pageSet->getPages();
120 
121  // This module operates in three modes:
122  // 'revs': List deleted revs for certain titles (1)
123  // 'user': List deleted revs by a certain user (2)
124  // 'all': List all deleted revs in NS (3)
125  $mode = 'all';
126  if ( count( $titles ) > 0 ) {
127  $mode = 'revs';
128  } elseif ( $params['user'] !== null ) {
129  $mode = 'user';
130  }
131 
132  if ( $mode == 'revs' || $mode == 'user' ) {
133  // Ignore namespace and unique due to inability to know whether they were purposely set
134  foreach ( [ 'from', 'to', 'prefix', /*'namespace', 'unique'*/ ] as $p ) {
135  if ( $params[$p] !== null ) {
136  $this->dieWithError( [ 'apierror-deletedrevs-param-not-1-2', $p ], 'badparams' );
137  }
138  }
139  } else {
140  foreach ( [ 'start', 'end' ] as $p ) {
141  if ( $params[$p] !== null ) {
142  $this->dieWithError( [ 'apierror-deletedrevs-param-not-3', $p ], 'badparams' );
143  }
144  }
145  }
146 
147  if ( $params['user'] !== null && $params['excludeuser'] !== null ) {
148  $this->dieWithError( 'user and excludeuser cannot be used together', 'badparams' );
149  }
150 
151  $arQuery = $this->revisionStore->getArchiveQueryInfo();
152  $this->addTables( $arQuery['tables'] );
153  $this->addFields( $arQuery['fields'] );
154  $this->addJoinConds( $arQuery['joins'] );
155  $this->addFields( [ 'ar_title', 'ar_namespace' ] );
156 
157  if ( $fld_tags ) {
158  $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'archive' ) ] );
159  }
160 
161  if ( $params['tag'] !== null ) {
162  $this->addTables( 'change_tag' );
163  $this->addJoinConds(
164  [ 'change_tag' => [ 'JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
165  );
166  try {
167  $this->addWhereFld( 'ct_tag_id', $this->changeTagDefStore->getId( $params['tag'] ) );
168  } catch ( NameTableAccessException $exception ) {
169  // Return nothing.
170  $this->addWhere( '1=0' );
171  }
172  }
173 
174  // This means stricter restrictions
175  if ( $fld_content ) {
176  $this->checkUserRightsAny( [ 'deletedtext', 'undelete' ] );
177  }
178  // Check limits
179  $userMax = $fld_content ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1;
180  $botMax = $fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2;
181 
182  $limit = $params['limit'];
183 
184  if ( $limit == 'max' ) {
185  $limit = $this->getMain()->canApiHighLimits() ? $botMax : $userMax;
186  $this->getResult()->addParsedLimit( $this->getModuleName(), $limit );
187  }
188 
189  $limit = $this->getMain()->getParamValidator()->validateValue(
190  $this, 'limit', $limit, [
191  ParamValidator::PARAM_TYPE => 'limit',
192  IntegerDef::PARAM_MIN => 1,
193  IntegerDef::PARAM_MAX => $userMax,
194  IntegerDef::PARAM_MAX2 => $botMax,
195  IntegerDef::PARAM_IGNORE_RANGE => true,
196  ]
197  );
198 
199  if ( $fld_token ) {
200  // Undelete tokens are identical for all pages, so we cache one here
201  $token = $user->getEditToken( '', $this->getMain()->getRequest() );
202  }
203 
204  $dir = $params['dir'];
205 
206  // We need a custom WHERE clause that matches all titles.
207  if ( $mode == 'revs' ) {
208  $lb = $this->linkBatchFactory->newLinkBatch( $titles );
209  $where = $lb->constructSet( 'ar', $db );
210  $this->addWhere( $where );
211  } elseif ( $mode == 'all' ) {
212  $this->addWhereFld( 'ar_namespace', $params['namespace'] );
213 
214  $from = $params['from'] === null
215  ? null
216  : $this->titlePartToKey( $params['from'], $params['namespace'] );
217  $to = $params['to'] === null
218  ? null
219  : $this->titlePartToKey( $params['to'], $params['namespace'] );
220  $this->addWhereRange( 'ar_title', $dir, $from, $to );
221 
222  if ( isset( $params['prefix'] ) ) {
223  $this->addWhere( 'ar_title' . $db->buildLike(
224  $this->titlePartToKey( $params['prefix'], $params['namespace'] ),
225  $db->anyString() ) );
226  }
227  }
228 
229  if ( $params['user'] !== null ) {
230  // We already join on actor due to getArchiveQueryInfo()
231  $this->addWhereFld( 'actor_name', $params['user'] );
232  } elseif ( $params['excludeuser'] !== null ) {
233  $this->addWhere( 'actor_name<>' . $db->addQuotes( $params['excludeuser'] ) );
234  }
235 
236  if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
237  // Paranoia: avoid brute force searches (T19342)
238  // (shouldn't be able to get here without 'deletedhistory', but
239  // check it again just in case)
240  if ( !$this->getAuthority()->isAllowed( 'deletedhistory' ) ) {
241  $bitmask = RevisionRecord::DELETED_USER;
242  } elseif ( !$this->getAuthority()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
243  $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
244  } else {
245  $bitmask = 0;
246  }
247  if ( $bitmask ) {
248  $this->addWhere( $db->bitAnd( 'ar_deleted', $bitmask ) . " != $bitmask" );
249  }
250  }
251 
252  if ( $params['continue'] !== null ) {
253  $cont = explode( '|', $params['continue'] );
254  $op = ( $dir == 'newer' ? '>' : '<' );
255  if ( $mode == 'all' || $mode == 'revs' ) {
256  $this->dieContinueUsageIf( count( $cont ) != 4 );
257  $ns = (int)$cont[0];
258  $this->dieContinueUsageIf( strval( $ns ) !== $cont[0] );
259  $title = $db->addQuotes( $cont[1] );
260  $ts = $db->addQuotes( $db->timestamp( $cont[2] ) );
261  $ar_id = (int)$cont[3];
262  $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[3] );
263  $this->addWhere( "ar_namespace $op $ns OR " .
264  "(ar_namespace = $ns AND " .
265  "(ar_title $op $title OR " .
266  "(ar_title = $title AND " .
267  "(ar_timestamp $op $ts OR " .
268  "(ar_timestamp = $ts AND " .
269  "ar_id $op= $ar_id)))))" );
270  } else {
271  $this->dieContinueUsageIf( count( $cont ) != 2 );
272  $ts = $db->addQuotes( $db->timestamp( $cont[0] ) );
273  $ar_id = (int)$cont[1];
274  $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[1] );
275  $this->addWhere( "ar_timestamp $op $ts OR " .
276  "(ar_timestamp = $ts AND " .
277  "ar_id $op= $ar_id)" );
278  }
279  }
280 
281  $this->addOption( 'LIMIT', $limit + 1 );
282  if ( $mode == 'all' ) {
283  if ( $params['unique'] ) {
284  // @todo Does this work on non-MySQL?
285  $this->addOption( 'GROUP BY', 'ar_title' );
286  } else {
287  $sort = ( $dir == 'newer' ? '' : ' DESC' );
288  $this->addOption( 'ORDER BY', [
289  'ar_title' . $sort,
290  'ar_timestamp' . $sort,
291  'ar_id' . $sort,
292  ] );
293  }
294  } else {
295  if ( $mode == 'revs' ) {
296  // Sort by ns and title in the same order as timestamp for efficiency
297  $this->addWhereRange( 'ar_namespace', $dir, null, null );
298  $this->addWhereRange( 'ar_title', $dir, null, null );
299  }
300  $this->addTimestampWhereRange( 'ar_timestamp', $dir, $params['start'], $params['end'] );
301  // Include in ORDER BY for uniqueness
302  $this->addWhereRange( 'ar_id', $dir, null, null );
303  }
304  $res = $this->select( __METHOD__ );
305 
306  $formattedComments = [];
307  if ( $fld_parsedcomment ) {
308  $formattedComments = $this->commentFormatter->formatItems(
309  $this->commentFormatter->rows( $res )
310  ->indexField( 'ar_id' )
311  ->commentKey( 'ar_comment' )
312  ->namespaceField( 'ar_namespace' )
313  ->titleField( 'ar_title' )
314  );
315  }
316 
317  $pageMap = []; // Maps ns&title to (fake) pageid
318  $count = 0;
319  $newPageID = 0;
320  foreach ( $res as $row ) {
321  if ( ++$count > $limit ) {
322  // We've had enough
323  if ( $mode == 'all' || $mode == 'revs' ) {
324  $this->setContinueEnumParameter( 'continue',
325  "$row->ar_namespace|$row->ar_title|$row->ar_timestamp|$row->ar_id"
326  );
327  } else {
328  $this->setContinueEnumParameter( 'continue', "$row->ar_timestamp|$row->ar_id" );
329  }
330  break;
331  }
332 
333  $rev = [];
334  $anyHidden = false;
335 
336  $rev['timestamp'] = wfTimestamp( TS_ISO_8601, $row->ar_timestamp );
337  if ( $fld_revid ) {
338  $rev['revid'] = (int)$row->ar_rev_id;
339  }
340  if ( $fld_parentid && $row->ar_parent_id !== null ) {
341  $rev['parentid'] = (int)$row->ar_parent_id;
342  }
343  if ( $fld_user || $fld_userid ) {
344  if ( $row->ar_deleted & RevisionRecord::DELETED_USER ) {
345  $rev['userhidden'] = true;
346  $anyHidden = true;
347  }
348  if ( RevisionRecord::userCanBitfield(
349  $row->ar_deleted,
350  RevisionRecord::DELETED_USER,
351  $user
352  ) ) {
353  if ( $fld_user ) {
354  $rev['user'] = $row->ar_user_text;
355  }
356  if ( $fld_userid ) {
357  $rev['userid'] = (int)$row->ar_user;
358  }
359  }
360  }
361 
362  if ( $fld_comment || $fld_parsedcomment ) {
363  if ( $row->ar_deleted & RevisionRecord::DELETED_COMMENT ) {
364  $rev['commenthidden'] = true;
365  $anyHidden = true;
366  }
367  if ( RevisionRecord::userCanBitfield(
368  $row->ar_deleted,
369  RevisionRecord::DELETED_COMMENT,
370  $user
371  ) ) {
372  $comment = $this->commentStore->getComment( 'ar_comment', $row )->text;
373  if ( $fld_comment ) {
374  $rev['comment'] = $comment;
375  }
376  if ( $fld_parsedcomment ) {
377  $rev['parsedcomment'] = $formattedComments[$row->ar_id];
378  }
379  }
380  }
381 
382  if ( $fld_minor ) {
383  $rev['minor'] = $row->ar_minor_edit == 1;
384  }
385  if ( $fld_len ) {
386  $rev['len'] = $row->ar_len;
387  }
388  if ( $fld_sha1 ) {
389  if ( $row->ar_deleted & RevisionRecord::DELETED_TEXT ) {
390  $rev['sha1hidden'] = true;
391  $anyHidden = true;
392  }
393  if ( RevisionRecord::userCanBitfield(
394  $row->ar_deleted,
395  RevisionRecord::DELETED_TEXT,
396  $user
397  ) ) {
398  if ( $row->ar_sha1 != '' ) {
399  $rev['sha1'] = Wikimedia\base_convert( $row->ar_sha1, 36, 16, 40 );
400  } else {
401  $rev['sha1'] = '';
402  }
403  }
404  }
405  if ( $fld_content ) {
406  if ( $row->ar_deleted & RevisionRecord::DELETED_TEXT ) {
407  $rev['texthidden'] = true;
408  $anyHidden = true;
409  }
410  if ( RevisionRecord::userCanBitfield(
411  $row->ar_deleted,
412  RevisionRecord::DELETED_TEXT,
413  $user
414  ) ) {
415  ApiResult::setContentValue( $rev, 'text',
416  $this->revisionStore->newRevisionFromArchiveRow( $row )
417  ->getContent( SlotRecord::MAIN )->serialize() );
418  }
419  }
420 
421  if ( $fld_tags ) {
422  if ( $row->ts_tags ) {
423  $tags = explode( ',', $row->ts_tags );
424  ApiResult::setIndexedTagName( $tags, 'tag' );
425  $rev['tags'] = $tags;
426  } else {
427  $rev['tags'] = [];
428  }
429  }
430 
431  if ( $anyHidden && ( $row->ar_deleted & RevisionRecord::DELETED_RESTRICTED ) ) {
432  $rev['suppressed'] = true;
433  }
434 
435  if ( !isset( $pageMap[$row->ar_namespace][$row->ar_title] ) ) {
436  $pageID = $newPageID++;
437  $pageMap[$row->ar_namespace][$row->ar_title] = $pageID;
438  $a = [ 'revisions' => [ $rev ] ];
439  ApiResult::setIndexedTagName( $a['revisions'], 'rev' );
440  $title = Title::makeTitle( $row->ar_namespace, $row->ar_title );
442  if ( $fld_token ) {
443  $a['token'] = $token;
444  }
445  $fit = $result->addValue( [ 'query', $this->getModuleName() ], $pageID, $a );
446  } else {
447  $pageID = $pageMap[$row->ar_namespace][$row->ar_title];
448  $fit = $result->addValue(
449  [ 'query', $this->getModuleName(), $pageID, 'revisions' ],
450  null, $rev );
451  }
452  if ( !$fit ) {
453  if ( $mode == 'all' || $mode == 'revs' ) {
454  $this->setContinueEnumParameter( 'continue',
455  "$row->ar_namespace|$row->ar_title|$row->ar_timestamp|$row->ar_id"
456  );
457  } else {
458  $this->setContinueEnumParameter( 'continue', "$row->ar_timestamp|$row->ar_id" );
459  }
460  break;
461  }
462  }
463  $result->addIndexedTagName( [ 'query', $this->getModuleName() ], 'page' );
464  }
465 
466  public function isDeprecated() {
467  return true;
468  }
469 
470  public function getAllowedParams() {
471  return [
472  'start' => [
473  ApiBase::PARAM_TYPE => 'timestamp',
474  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 1, 2 ] ],
475  ],
476  'end' => [
477  ApiBase::PARAM_TYPE => 'timestamp',
478  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 1, 2 ] ],
479  ],
480  'dir' => [
482  'newer',
483  'older'
484  ],
485  ApiBase::PARAM_DFLT => 'older',
486  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
487  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 1, 3 ] ],
488  ],
489  'from' => [
490  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
491  ],
492  'to' => [
493  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
494  ],
495  'prefix' => [
496  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
497  ],
498  'unique' => [
499  ApiBase::PARAM_DFLT => false,
500  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
501  ],
502  'namespace' => [
503  ApiBase::PARAM_TYPE => 'namespace',
505  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'modes', 3 ] ],
506  ],
507  'tag' => null,
508  'user' => [
509  ApiBase::PARAM_TYPE => 'user',
510  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
511  ],
512  'excludeuser' => [
513  ApiBase::PARAM_TYPE => 'user',
514  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
515  ],
516  'prop' => [
517  ApiBase::PARAM_DFLT => 'user|comment',
519  'revid',
520  'parentid',
521  'user',
522  'userid',
523  'comment',
524  'parsedcomment',
525  'minor',
526  'len',
527  'sha1',
528  'content',
529  'token',
530  'tags'
531  ],
533  ],
534  'limit' => [
535  ApiBase::PARAM_DFLT => 10,
536  ApiBase::PARAM_TYPE => 'limit',
537  ApiBase::PARAM_MIN => 1,
540  ],
541  'continue' => [
542  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
543  ],
544  ];
545  }
546 
547  protected function getExamplesMessages() {
548  return [
549  'action=query&list=deletedrevs&titles=Main%20Page|Talk:Main%20Page&' .
550  'drprop=user|comment|content'
551  => 'apihelp-query+deletedrevs-example-mode1',
552  'action=query&list=deletedrevs&druser=Bob&drlimit=50'
553  => 'apihelp-query+deletedrevs-example-mode2',
554  'action=query&list=deletedrevs&drdir=newer&drlimit=50'
555  => 'apihelp-query+deletedrevs-example-mode3-main',
556  'action=query&list=deletedrevs&drdir=newer&drlimit=50&drnamespace=1&drunique='
557  => 'apihelp-query+deletedrevs-example-mode3-talk',
558  ];
559  }
560 
561  public function getHelpUrls() {
562  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Deletedrevs';
563  }
564 }
ChangeTags\makeTagSummarySubquery
static makeTagSummarySubquery( $tables)
Make the tag summary subquery based on the given tables and return it.
Definition: ChangeTags.php:983
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:37
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:47
MediaWiki\Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:88
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1379
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:105
true
return true
Definition: router.php:90
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1668
ApiBase\PARAM_TYPE
const PARAM_TYPE
Definition: ApiBase.php:72
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:571
ApiBase\checkUserRightsAny
checkUserRightsAny( $rights, $user=null)
Helper function for permission-denied errors.
Definition: ApiBase.php:1488
CommentStore
Handle database storage of comments such as edit summaries and log reasons.
Definition: CommentStore.php:42
ApiQueryDeletedrevs\isDeprecated
isDeprecated()
Indicates whether this module is deprecated.
Definition: ApiQueryDeletedrevs.php:466
ContextSource\getRequest
getRequest()
Definition: ContextSource.php:81
ApiQueryBase\addOption
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
Definition: ApiQueryBase.php:378
$res
$res
Definition: testCompression.php:57
ContextSource\getUser
getUser()
Definition: ContextSource.php:136
ApiBase\lacksSameOriginSecurity
lacksSameOriginSecurity()
Returns true if the current request breaks the same-origin policy.
Definition: ApiBase.php:502
NS_MAIN
const NS_MAIN
Definition: Defines.php:64
Wikimedia\ParamValidator\ParamValidator::TypeDef\UserDef
Type definition for user types.
Definition: UserDef.php:26
ApiResult\setContentValue
static setContentValue(array &$arr, $name, $value, $flags=0)
Add an output value to the array by name and mark as META_CONTENT.
Definition: ApiResult.php:466
ApiQueryDeletedrevs\$changeTagDefStore
NameTableStore $changeTagDefStore
Definition: ApiQueryDeletedrevs.php:52
ApiBase\PARAM_MIN
const PARAM_MIN
Definition: ApiBase.php:75
ApiQueryBase
This is a base class for all Query modules.
Definition: ApiQueryBase.php:37
ApiBase\LIMIT_BIG1
const LIMIT_BIG1
Fast query, standard limit.
Definition: ApiBase.php:163
MediaWiki\Cache\LinkBatchFactory
Definition: LinkBatchFactory.php:39
ApiQueryDeletedrevs\$revisionStore
RevisionStore $revisionStore
Definition: ApiQueryDeletedrevs.php:49
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:117
ApiQueryDeletedrevs\$commentFormatter
RowCommentFormatter $commentFormatter
Definition: ApiQueryDeletedrevs.php:46
ApiBase\PARAM_MAX
const PARAM_MAX
Definition: ApiBase.php:73
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:707
$title
$title
Definition: testCompression.php:38
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:650
ApiQueryBase\addWhereRange
addWhereRange( $field, $dir, $start, $end, $sort=true)
Add a WHERE clause corresponding to a range, and an ORDER BY clause to sort in the right direction.
Definition: ApiQueryBase.php:337
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:603
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:1569
ApiBase\addDeprecation
addDeprecation( $msg, $feature, $data=[])
Add a deprecation warning for this module.
Definition: ApiBase.php:1311
ContextSource\getAuthority
getAuthority()
Definition: ContextSource.php:144
ApiBase\LIMIT_SML2
const LIMIT_SML2
Slow query, apihighlimits limit.
Definition: ApiBase.php:169
ApiQueryDeletedrevs\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: ApiQueryDeletedrevs.php:83
ApiQueryBase\addJoinConds
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
Definition: ApiQueryBase.php:201
ApiQueryBase\addWhereFld
addWhereFld( $field, $value)
Equivalent to addWhere( [ $field => $value ] )
Definition: ApiQueryBase.php:282
MediaWiki\Storage\NameTableStore
Definition: NameTableStore.php:36
ApiBase\PARAM_HELP_MSG_INFO
const PARAM_HELP_MSG_INFO
(array) Specify additional information tags for the parameter.
Definition: ApiBase.php:122
ApiQueryBase\getPageSet
getPageSet()
Get the PageSet object to work on.
Definition: ApiQueryBase.php:143
ApiQueryDeletedrevs\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQueryDeletedrevs.php:470
Wikimedia\ParamValidator\TypeDef\IntegerDef
Type definition for integer types.
Definition: IntegerDef.php:23
ApiQueryDeletedrevs\$linkBatchFactory
LinkBatchFactory $linkBatchFactory
Definition: ApiQueryDeletedrevs.php:55
MediaWiki\CommentFormatter\RowCommentFormatter
This is basically a CommentFormatter with a CommentStore dependency, allowing it to retrieve comment ...
Definition: RowCommentFormatter.php:15
ApiQueryDeletedrevs\__construct
__construct(ApiQuery $query, $moduleName, CommentStore $commentStore, RowCommentFormatter $commentFormatter, RevisionStore $revisionStore, NameTableStore $changeTagDefStore, LinkBatchFactory $linkBatchFactory)
Definition: ApiQueryDeletedrevs.php:66
ApiBase\LIMIT_BIG2
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition: ApiBase.php:165
ApiBase\PARAM_DFLT
const PARAM_DFLT
Definition: ApiBase.php:70
ApiQueryDeletedrevs\$commentStore
CommentStore $commentStore
Definition: ApiQueryDeletedrevs.php:43
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:440
MediaWiki\Storage\NameTableAccessException
Exception representing a failure to look up a row from a name table.
Definition: NameTableAccessException.php:33
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
Definition: ApiBase.php:71
ApiBase\PARAM_MAX2
const PARAM_MAX2
Definition: ApiBase.php:74
ApiBase\getMain
getMain()
Get the main module.
Definition: ApiBase.php:456
ApiQueryBase\addWhere
addWhere( $value)
Add a set of WHERE clauses to the internal array.
Definition: ApiQueryBase.php:245
ApiQueryBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Set a query-continue value.
Definition: ApiQueryBase.php:515
ApiQueryDeletedrevs\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryDeletedrevs.php:547
ApiQueryBase\titlePartToKey
titlePartToKey( $titlePart, $namespace=NS_MAIN)
Convert an input title or title prefix into a dbkey.
Definition: ApiQueryBase.php:529
ApiQueryDeletedrevs\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryDeletedrevs.php:561
ApiQueryDeletedrevs
Query module to enumerate all deleted revisions.
Definition: ApiQueryDeletedrevs.php:40
Wikimedia\ParamValidator\ParamValidator
Service for formatting and validating API parameters.
Definition: ParamValidator.php:42
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:466
MediaWiki\Revision\SlotRecord
Value object representing a content slot associated with a page revision.
Definition: SlotRecord.php:40
ApiBase\LIMIT_SML1
const LIMIT_SML1
Slow query, standard limit.
Definition: ApiBase.php:167