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