MediaWiki  master
ApiQueryAllDeletedRevisions.php
Go to the documentation of this file.
1 <?php
29 
36 
37  public function __construct( ApiQuery $query, $moduleName ) {
38  parent::__construct( $query, $moduleName, 'adr' );
39  }
40 
45  protected function run( ApiPageSet $resultPageSet = null ) {
46  $user = $this->getUser();
47  $db = $this->getDB();
48  $params = $this->extractRequestParams( false );
49  $services = MediaWikiServices::getInstance();
50  $revisionStore = $services->getRevisionStore();
51 
52  $result = $this->getResult();
53 
54  // If the user wants no namespaces, they get no pages.
55  if ( $params['namespace'] === [] ) {
56  if ( $resultPageSet === null ) {
57  $result->addValue( 'query', $this->getModuleName(), [] );
58  }
59  return;
60  }
61 
62  // This module operates in two modes:
63  // 'user': List deleted revs by a certain user
64  // 'all': List all deleted revs in NS
65  $mode = 'all';
66  if ( $params['user'] !== null ) {
67  $mode = 'user';
68  }
69 
70  if ( $mode == 'user' ) {
71  foreach ( [ 'from', 'to', 'prefix', 'excludeuser' ] as $param ) {
72  if ( $params[$param] !== null ) {
73  $p = $this->getModulePrefix();
74  $this->dieWithError(
75  [ 'apierror-invalidparammix-cannotusewith', $p . $param, "{$p}user" ],
76  'invalidparammix'
77  );
78  }
79  }
80  } else {
81  foreach ( [ 'start', 'end' ] as $param ) {
82  if ( $params[$param] !== null ) {
83  $p = $this->getModulePrefix();
84  $this->dieWithError(
85  [ 'apierror-invalidparammix-mustusewith', $p . $param, "{$p}user" ],
86  'invalidparammix'
87  );
88  }
89  }
90  }
91 
92  // If we're generating titles only, we can use DISTINCT for a better
93  // query. But we can't do that in 'user' mode (wrong index), and we can
94  // only do it when sorting ASC (because MySQL apparently can't use an
95  // index backwards for grouping even though it can for ORDER BY, WTF?)
96  $dir = $params['dir'];
97  $optimizeGenerateTitles = false;
98  if ( $mode === 'all' && $params['generatetitles'] && $resultPageSet !== null ) {
99  if ( $dir === 'newer' ) {
100  $optimizeGenerateTitles = true;
101  } else {
102  $p = $this->getModulePrefix();
103  $this->addWarning( [ 'apiwarn-alldeletedrevisions-performance', $p ], 'performance' );
104  }
105  }
106 
107  if ( $resultPageSet === null ) {
108  $this->parseParameters( $params );
109  $arQuery = $revisionStore->getArchiveQueryInfo();
110  $this->addTables( $arQuery['tables'] );
111  $this->addJoinConds( $arQuery['joins'] );
112  $this->addFields( $arQuery['fields'] );
113  $this->addFields( [ 'ar_title', 'ar_namespace' ] );
114  } else {
115  $this->limit = $this->getParameter( 'limit' ) ?: 10;
116  $this->addTables( 'archive' );
117  $this->addFields( [ 'ar_title', 'ar_namespace' ] );
118  if ( $optimizeGenerateTitles ) {
119  $this->addOption( 'DISTINCT' );
120  } else {
121  $this->addFields( [ 'ar_timestamp', 'ar_rev_id', 'ar_id' ] );
122  }
123  }
124 
125  if ( $this->fld_tags ) {
126  $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'archive' ) ] );
127  }
128 
129  if ( $params['tag'] !== null ) {
130  $this->addTables( 'change_tag' );
131  $this->addJoinConds(
132  [ 'change_tag' => [ 'JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
133  );
134  $changeTagDefStore = $services->getChangeTagDefStore();
135  try {
136  $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) );
137  } catch ( NameTableAccessException $exception ) {
138  // Return nothing.
139  $this->addWhere( '1=0' );
140  }
141  }
142 
143  // This means stricter restrictions
144  if ( ( $this->fld_comment || $this->fld_parsedcomment ) &&
145  !$this->getPermissionManager()->userHasRight( $user, 'deletedhistory' )
146  ) {
147  $this->dieWithError( 'apierror-cantview-deleted-comment', 'permissiondenied' );
148  }
149  if ( $this->fetchContent &&
150  !$this->getPermissionManager()->userHasAnyRight( $user, 'deletedtext', 'undelete' )
151  ) {
152  $this->dieWithError( 'apierror-cantview-deleted-revision-content', 'permissiondenied' );
153  }
154 
155  $miser_ns = null;
156 
157  if ( $mode == 'all' ) {
158  $namespaces = $params['namespace'] ??
159  $services->getNamespaceInfo()->getValidNamespaces();
160  $this->addWhereFld( 'ar_namespace', $namespaces );
161 
162  // For from/to/prefix, we have to consider the potential
163  // transformations of the title in all specified namespaces.
164  // Generally there will be only one transformation, but wikis with
165  // some namespaces case-sensitive could have two.
166  if ( $params['from'] !== null || $params['to'] !== null ) {
167  $isDirNewer = ( $dir === 'newer' );
168  $after = ( $isDirNewer ? '>=' : '<=' );
169  $before = ( $isDirNewer ? '<=' : '>=' );
170  $where = [];
171  foreach ( $namespaces as $ns ) {
172  $w = [];
173  if ( $params['from'] !== null ) {
174  $w[] = 'ar_title' . $after .
175  $db->addQuotes( $this->titlePartToKey( $params['from'], $ns ) );
176  }
177  if ( $params['to'] !== null ) {
178  $w[] = 'ar_title' . $before .
179  $db->addQuotes( $this->titlePartToKey( $params['to'], $ns ) );
180  }
181  $w = $db->makeList( $w, LIST_AND );
182  $where[$w][] = $ns;
183  }
184  if ( count( $where ) == 1 ) {
185  $where = key( $where );
186  $this->addWhere( $where );
187  } else {
188  $where2 = [];
189  foreach ( $where as $w => $ns ) {
190  $where2[] = $db->makeList( [ $w, 'ar_namespace' => $ns ], LIST_AND );
191  }
192  $this->addWhere( $db->makeList( $where2, LIST_OR ) );
193  }
194  }
195 
196  if ( isset( $params['prefix'] ) ) {
197  $where = [];
198  foreach ( $namespaces as $ns ) {
199  $w = 'ar_title' . $db->buildLike(
200  $this->titlePartToKey( $params['prefix'], $ns ),
201  $db->anyString() );
202  $where[$w][] = $ns;
203  }
204  if ( count( $where ) == 1 ) {
205  $where = key( $where );
206  $this->addWhere( $where );
207  } else {
208  $where2 = [];
209  foreach ( $where as $w => $ns ) {
210  $where2[] = $db->makeList( [ $w, 'ar_namespace' => $ns ], LIST_AND );
211  }
212  $this->addWhere( $db->makeList( $where2, LIST_OR ) );
213  }
214  }
215  } else {
216  if ( $this->getConfig()->get( 'MiserMode' ) ) {
217  $miser_ns = $params['namespace'];
218  } else {
219  $this->addWhereFld( 'ar_namespace', $params['namespace'] );
220  }
221  $this->addTimestampWhereRange( 'ar_timestamp', $dir, $params['start'], $params['end'] );
222  }
223 
224  if ( $params['user'] !== null ) {
225  // Don't query by user ID here, it might be able to use the ar_usertext_timestamp index.
226  $actorQuery = ActorMigration::newMigration()
227  ->getWhere( $db, 'ar_user', User::newFromName( $params['user'], false ), false );
228  $this->addTables( $actorQuery['tables'] );
229  $this->addJoinConds( $actorQuery['joins'] );
230  $this->addWhere( $actorQuery['conds'] );
231  } elseif ( $params['excludeuser'] !== null ) {
232  // Here there's no chance of using ar_usertext_timestamp.
233  $actorQuery = ActorMigration::newMigration()
234  ->getWhere( $db, 'ar_user', User::newFromName( $params['excludeuser'], false ) );
235  $this->addTables( $actorQuery['tables'] );
236  $this->addJoinConds( $actorQuery['joins'] );
237  $this->addWhere( 'NOT(' . $actorQuery['conds'] . ')' );
238  }
239 
240  if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
241  // Paranoia: avoid brute force searches (T19342)
242  if ( !$this->getPermissionManager()->userHasRight( $user, 'deletedhistory' ) ) {
243  $bitmask = RevisionRecord::DELETED_USER;
244  } elseif ( !$this->getPermissionManager()
245  ->userHasAnyRight( $user, 'suppressrevision', 'viewsuppressed' )
246  ) {
247  $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
248  } else {
249  $bitmask = 0;
250  }
251  if ( $bitmask ) {
252  $this->addWhere( $db->bitAnd( 'ar_deleted', $bitmask ) . " != $bitmask" );
253  }
254  }
255 
256  if ( $params['continue'] !== null ) {
257  $cont = explode( '|', $params['continue'] );
258  $op = ( $dir == 'newer' ? '>' : '<' );
259  if ( $optimizeGenerateTitles ) {
260  $this->dieContinueUsageIf( count( $cont ) != 2 );
261  $ns = (int)$cont[0];
262  $this->dieContinueUsageIf( strval( $ns ) !== $cont[0] );
263  $title = $db->addQuotes( $cont[1] );
264  $this->addWhere( "ar_namespace $op $ns OR " .
265  "(ar_namespace = $ns AND ar_title $op= $title)" );
266  } elseif ( $mode == 'all' ) {
267  $this->dieContinueUsageIf( count( $cont ) != 4 );
268  $ns = (int)$cont[0];
269  $this->dieContinueUsageIf( strval( $ns ) !== $cont[0] );
270  $title = $db->addQuotes( $cont[1] );
271  $ts = $db->addQuotes( $db->timestamp( $cont[2] ) );
272  $ar_id = (int)$cont[3];
273  $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[3] );
274  $this->addWhere( "ar_namespace $op $ns OR " .
275  "(ar_namespace = $ns AND " .
276  "(ar_title $op $title OR " .
277  "(ar_title = $title AND " .
278  "(ar_timestamp $op $ts OR " .
279  "(ar_timestamp = $ts AND " .
280  "ar_id $op= $ar_id)))))" );
281  } else {
282  $this->dieContinueUsageIf( count( $cont ) != 2 );
283  $ts = $db->addQuotes( $db->timestamp( $cont[0] ) );
284  $ar_id = (int)$cont[1];
285  $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[1] );
286  $this->addWhere( "ar_timestamp $op $ts OR " .
287  "(ar_timestamp = $ts AND " .
288  "ar_id $op= $ar_id)" );
289  }
290  }
291 
292  $this->addOption( 'LIMIT', $this->limit + 1 );
293 
294  $sort = ( $dir == 'newer' ? '' : ' DESC' );
295  $orderby = [];
296  if ( $optimizeGenerateTitles ) {
297  // Targeting index name_title_timestamp
298  if ( $params['namespace'] === null || count( array_unique( $params['namespace'] ) ) > 1 ) {
299  $orderby[] = "ar_namespace $sort";
300  }
301  $orderby[] = "ar_title $sort";
302  } elseif ( $mode == 'all' ) {
303  // Targeting index name_title_timestamp
304  if ( $params['namespace'] === null || count( array_unique( $params['namespace'] ) ) > 1 ) {
305  $orderby[] = "ar_namespace $sort";
306  }
307  $orderby[] = "ar_title $sort";
308  $orderby[] = "ar_timestamp $sort";
309  $orderby[] = "ar_id $sort";
310  } else {
311  // Targeting index usertext_timestamp
312  // 'user' is always constant.
313  $orderby[] = "ar_timestamp $sort";
314  $orderby[] = "ar_id $sort";
315  }
316  $this->addOption( 'ORDER BY', $orderby );
317 
318  $res = $this->select( __METHOD__ );
319 
320  if ( $resultPageSet === null ) {
321  $this->executeGenderCacheFromResultWrapper( $res, __METHOD__, 'ar' );
322  }
323 
324  $pageMap = []; // Maps ns&title to array index
325  $count = 0;
326  $nextIndex = 0;
327  $generated = [];
328  foreach ( $res as $row ) {
329  if ( ++$count > $this->limit ) {
330  // We've had enough
331  if ( $optimizeGenerateTitles ) {
332  $this->setContinueEnumParameter( 'continue', "$row->ar_namespace|$row->ar_title" );
333  } elseif ( $mode == 'all' ) {
334  $this->setContinueEnumParameter( 'continue',
335  "$row->ar_namespace|$row->ar_title|$row->ar_timestamp|$row->ar_id"
336  );
337  } else {
338  $this->setContinueEnumParameter( 'continue', "$row->ar_timestamp|$row->ar_id" );
339  }
340  break;
341  }
342 
343  // Miser mode namespace check
344  if ( $miser_ns !== null && !in_array( $row->ar_namespace, $miser_ns ) ) {
345  continue;
346  }
347 
348  if ( $resultPageSet !== null ) {
349  if ( $params['generatetitles'] ) {
350  $key = "{$row->ar_namespace}:{$row->ar_title}";
351  if ( !isset( $generated[$key] ) ) {
352  $generated[$key] = Title::makeTitle( $row->ar_namespace, $row->ar_title );
353  }
354  } else {
355  $generated[] = $row->ar_rev_id;
356  }
357  } else {
358  $revision = $revisionStore->newRevisionFromArchiveRow( $row );
359  $rev = $this->extractRevisionInfo( $revision, $row );
360 
361  if ( !isset( $pageMap[$row->ar_namespace][$row->ar_title] ) ) {
362  $index = $nextIndex++;
363  $pageMap[$row->ar_namespace][$row->ar_title] = $index;
364  $title = Title::newFromLinkTarget( $revision->getPageAsLinkTarget() );
365  $a = [
366  'pageid' => $title->getArticleID(),
367  'revisions' => [ $rev ],
368  ];
369  ApiResult::setIndexedTagName( $a['revisions'], 'rev' );
371  $fit = $result->addValue( [ 'query', $this->getModuleName() ], $index, $a );
372  } else {
373  $index = $pageMap[$row->ar_namespace][$row->ar_title];
374  $fit = $result->addValue(
375  [ 'query', $this->getModuleName(), $index, 'revisions' ],
376  null, $rev );
377  }
378  if ( !$fit ) {
379  if ( $mode == 'all' ) {
380  $this->setContinueEnumParameter( 'continue',
381  "$row->ar_namespace|$row->ar_title|$row->ar_timestamp|$row->ar_id"
382  );
383  } else {
384  $this->setContinueEnumParameter( 'continue', "$row->ar_timestamp|$row->ar_id" );
385  }
386  break;
387  }
388  }
389  }
390 
391  if ( $resultPageSet !== null ) {
392  if ( $params['generatetitles'] ) {
393  $resultPageSet->populateFromTitles( $generated );
394  } else {
395  $resultPageSet->populateFromRevisionIDs( $generated );
396  }
397  } else {
398  $result->addIndexedTagName( [ 'query', $this->getModuleName() ], 'page' );
399  }
400  }
401 
402  public function getAllowedParams() {
403  $ret = parent::getAllowedParams() + [
404  'user' => [
405  ApiBase::PARAM_TYPE => 'user'
406  ],
407  'namespace' => [
408  ApiBase::PARAM_ISMULTI => true,
409  ApiBase::PARAM_TYPE => 'namespace',
410  ],
411  'start' => [
412  ApiBase::PARAM_TYPE => 'timestamp',
413  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'useronly' ] ],
414  ],
415  'end' => [
416  ApiBase::PARAM_TYPE => 'timestamp',
417  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'useronly' ] ],
418  ],
419  'dir' => [
421  'newer',
422  'older'
423  ],
424  ApiBase::PARAM_DFLT => 'older',
425  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
426  ],
427  'from' => [
428  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'nonuseronly' ] ],
429  ],
430  'to' => [
431  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'nonuseronly' ] ],
432  ],
433  'prefix' => [
434  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'nonuseronly' ] ],
435  ],
436  'excludeuser' => [
437  ApiBase::PARAM_TYPE => 'user',
438  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'nonuseronly' ] ],
439  ],
440  'tag' => null,
441  'continue' => [
442  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
443  ],
444  'generatetitles' => [
445  ApiBase::PARAM_DFLT => false
446  ],
447  ];
448 
449  if ( $this->getConfig()->get( 'MiserMode' ) ) {
450  $ret['user'][ApiBase::PARAM_HELP_MSG_APPEND] = [
451  'apihelp-query+alldeletedrevisions-param-miser-user-namespace',
452  ];
453  $ret['namespace'][ApiBase::PARAM_HELP_MSG_APPEND] = [
454  'apihelp-query+alldeletedrevisions-param-miser-user-namespace',
455  ];
456  }
457 
458  return $ret;
459  }
460 
461  protected function getExamplesMessages() {
462  return [
463  'action=query&list=alldeletedrevisions&adruser=Example&adrlimit=50'
464  => 'apihelp-query+alldeletedrevisions-example-user',
465  'action=query&list=alldeletedrevisions&adrdir=newer&adrnamespace=0&adrlimit=50'
466  => 'apihelp-query+alldeletedrevisions-example-ns-main',
467  ];
468  }
469 
470  public function getHelpUrls() {
471  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Alldeletedrevisions';
472  }
473 }
ApiQueryRevisionsBase\parseParameters
parseParameters( $params)
Parse the parameters into the various instance fields.
Definition: ApiQueryRevisionsBase.php:77
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:63
ChangeTags\makeTagSummarySubquery
static makeTagSummarySubquery( $tables)
Make the tag summary subquery based on the given tables and return it.
Definition: ChangeTags.php:841
ApiQueryBase\addFields
addFields( $value)
Add a set of fields to select to the internal array.
Definition: ApiQueryBase.php:193
ApiQuery
This is the main query class.
Definition: ApiQuery.php:37
Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:46
ApiBase\addWarning
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
Definition: ApiBase.php:1934
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:130
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:2015
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:357
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:132
ApiBase\PARAM_TYPE
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
Definition: ApiBase.php:95
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:644
User\newFromName
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:537
ApiQueryBase\addOption
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
Definition: ApiQueryBase.php:369
$res
$res
Definition: testCompression.php:54
ContextSource\getUser
getUser()
Definition: ContextSource.php:120
ApiBase\PARAM_HELP_MSG_APPEND
const PARAM_HELP_MSG_APPEND
((string|array|Message)[]) Specify additional i18n messages to append to the normal message for this ...
Definition: ApiBase.php:139
ActorMigration\newMigration
static newMigration()
Static constructor.
Definition: ActorMigration.php:139
ApiPageSet
This class contains a list of pages that the client has requested.
Definition: ApiPageSet.php:40
LIST_AND
const LIST_AND
Definition: Defines.php:39
ApiQueryRevisionsBase
A base class for functions common to producing a list of revisions.
Definition: ApiQueryRevisionsBase.php:34
ApiQueryAllDeletedRevisions\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryAllDeletedRevisions.php:470
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
Definition: ApiQueryGeneratorBase.php:84
ApiQueryBase\executeGenderCacheFromResultWrapper
executeGenderCacheFromResultWrapper(IResultWrapper $res, $fname=__METHOD__, $fieldPrefix='page')
Preprocess the result set to fill the GenderCache with the necessary information before using self::a...
Definition: ApiQueryBase.php:622
LIST_OR
const LIST_OR
Definition: Defines.php:42
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:107
ApiQueryAllDeletedRevisions\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQueryAllDeletedRevisions.php:402
ApiQueryBase\addTables
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
Definition: ApiQueryBase.php:161
ApiQueryBase\select
select( $method, $extraQuery=[], array &$hookData=null)
Execute a SELECT query based on the values in the internal arrays.
Definition: ApiQueryBase.php:394
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:765
$title
$title
Definition: testCompression.php:36
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:584
ApiQueryAllDeletedRevisions\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryAllDeletedRevisions.php:461
ApiQueryBase\$where
$where
Definition: ApiQueryBase.php:37
ApiQueryAllDeletedRevisions\run
run(ApiPageSet $resultPageSet=null)
Definition: ApiQueryAllDeletedRevisions.php:45
ApiBase\getModulePrefix
getModulePrefix()
Get parameter prefix (usually two letters or an empty string).
Definition: ApiBase.php:532
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:616
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:2210
ApiQueryRevisionsBase\extractRevisionInfo
extractRevisionInfo(RevisionRecord $revision, $row)
Extract information from the RevisionRecord.
Definition: ApiQueryRevisionsBase.php:228
ApiBase\getPermissionManager
getPermissionManager()
Obtain a PermissionManager instance that subclasses may use in their authorization checks.
Definition: ApiBase.php:714
ApiQueryBase\addJoinConds
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
Definition: ApiQueryBase.php:182
ApiQueryBase\addWhereFld
addWhereFld( $field, $value)
Equivalent to addWhere( [ $field => $value ] )
Definition: ApiQueryBase.php:267
ApiBase\PARAM_HELP_MSG_INFO
const PARAM_HELP_MSG_INFO
(array) Specify additional information tags for the parameter.
Definition: ApiBase.php:149
Title\newFromLinkTarget
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition: Title.php:269
ApiQueryAllDeletedRevisions\__construct
__construct(ApiQuery $query, $moduleName)
Definition: ApiQueryAllDeletedRevisions.php:37
ApiBase\PARAM_DFLT
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:56
ApiBase\getParameter
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
Definition: ApiBase.php:881
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:524
MediaWiki\Storage\NameTableAccessException
Exception representing a failure to look up a row from a name table.
Definition: NameTableAccessException.php:32
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition: ApiBase.php:59
ApiQueryBase\addWhere
addWhere( $value)
Add a set of WHERE clauses to the internal array.
Definition: ApiQueryBase.php:230
ApiQueryBase\titlePartToKey
titlePartToKey( $titlePart, $namespace=NS_MAIN)
Convert an input title or title prefix into a dbkey.
Definition: ApiQueryBase.php:525
ApiQueryAllDeletedRevisions
Query module to enumerate all deleted revisions.
Definition: ApiQueryAllDeletedRevisions.php:35
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:462