MediaWiki  master
ApiQueryAllDeletedRevisions.php
Go to the documentation of this file.
1 <?php
33 
40 
42  private $revisionStore;
43 
46 
48  private $namespaceInfo;
49 
60  public function __construct(
61  ApiQuery $query,
62  $moduleName,
69  ) {
70  parent::__construct(
71  $query,
72  $moduleName,
73  'adr',
78  );
79  $this->revisionStore = $revisionStore;
80  $this->changeTagDefStore = $changeTagDefStore;
81  $this->namespaceInfo = $namespaceInfo;
82  }
83 
88  protected function run( ApiPageSet $resultPageSet = null ) {
89  $user = $this->getUser();
90  $db = $this->getDB();
91  $params = $this->extractRequestParams( false );
92 
93  $result = $this->getResult();
94 
95  // If the user wants no namespaces, they get no pages.
96  if ( $params['namespace'] === [] ) {
97  if ( $resultPageSet === null ) {
98  $result->addValue( 'query', $this->getModuleName(), [] );
99  }
100  return;
101  }
102 
103  // This module operates in two modes:
104  // 'user': List deleted revs by a certain user
105  // 'all': List all deleted revs in NS
106  $mode = 'all';
107  if ( $params['user'] !== null ) {
108  $mode = 'user';
109  }
110 
111  if ( $mode == 'user' ) {
112  foreach ( [ 'from', 'to', 'prefix', 'excludeuser' ] as $param ) {
113  if ( $params[$param] !== null ) {
114  $p = $this->getModulePrefix();
115  $this->dieWithError(
116  [ 'apierror-invalidparammix-cannotusewith', $p . $param, "{$p}user" ],
117  'invalidparammix'
118  );
119  }
120  }
121  } else {
122  foreach ( [ 'start', 'end' ] as $param ) {
123  if ( $params[$param] !== null ) {
124  $p = $this->getModulePrefix();
125  $this->dieWithError(
126  [ 'apierror-invalidparammix-mustusewith', $p . $param, "{$p}user" ],
127  'invalidparammix'
128  );
129  }
130  }
131  }
132 
133  // If we're generating titles only, we can use DISTINCT for a better
134  // query. But we can't do that in 'user' mode (wrong index), and we can
135  // only do it when sorting ASC (because MySQL apparently can't use an
136  // index backwards for grouping even though it can for ORDER BY, WTF?)
137  $dir = $params['dir'];
138  $optimizeGenerateTitles = false;
139  if ( $mode === 'all' && $params['generatetitles'] && $resultPageSet !== null ) {
140  if ( $dir === 'newer' ) {
141  $optimizeGenerateTitles = true;
142  } else {
143  $p = $this->getModulePrefix();
144  $this->addWarning( [ 'apiwarn-alldeletedrevisions-performance', $p ], 'performance' );
145  }
146  }
147 
148  if ( $resultPageSet === null ) {
149  $this->parseParameters( $params );
150  $arQuery = $this->revisionStore->getArchiveQueryInfo();
151  $this->addTables( $arQuery['tables'] );
152  $this->addJoinConds( $arQuery['joins'] );
153  $this->addFields( $arQuery['fields'] );
154  $this->addFields( [ 'ar_title', 'ar_namespace' ] );
155  } else {
156  $this->limit = $this->getParameter( 'limit' ) ?: 10;
157  $this->addTables( 'archive' );
158  $this->addFields( [ 'ar_title', 'ar_namespace' ] );
159  if ( $optimizeGenerateTitles ) {
160  $this->addOption( 'DISTINCT' );
161  } else {
162  $this->addFields( [ 'ar_timestamp', 'ar_rev_id', 'ar_id' ] );
163  }
164  if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
165  $this->addTables( 'actor' );
166  $this->addJoinConds( [ 'actor' => 'actor_id=ar_actor' ] );
167  }
168  }
169 
170  if ( $this->fld_tags ) {
171  $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'archive' ) ] );
172  }
173 
174  if ( $params['tag'] !== null ) {
175  $this->addTables( 'change_tag' );
176  $this->addJoinConds(
177  [ 'change_tag' => [ 'JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
178  );
179  try {
180  $this->addWhereFld( 'ct_tag_id', $this->changeTagDefStore->getId( $params['tag'] ) );
181  } catch ( NameTableAccessException $exception ) {
182  // Return nothing.
183  $this->addWhere( '1=0' );
184  }
185  }
186 
187  // This means stricter restrictions
188  if ( ( $this->fld_comment || $this->fld_parsedcomment ) &&
189  !$this->getAuthority()->isAllowed( 'deletedhistory' )
190  ) {
191  $this->dieWithError( 'apierror-cantview-deleted-comment', 'permissiondenied' );
192  }
193  if ( $this->fetchContent &&
194  !$this->getAuthority()->isAllowedAny( 'deletedtext', 'undelete' )
195  ) {
196  $this->dieWithError( 'apierror-cantview-deleted-revision-content', 'permissiondenied' );
197  }
198 
199  $miser_ns = null;
200 
201  if ( $mode == 'all' ) {
202  $namespaces = $params['namespace'] ?? $this->namespaceInfo->getValidNamespaces();
203  $this->addWhereFld( 'ar_namespace', $namespaces );
204 
205  // For from/to/prefix, we have to consider the potential
206  // transformations of the title in all specified namespaces.
207  // Generally there will be only one transformation, but wikis with
208  // some namespaces case-sensitive could have two.
209  if ( $params['from'] !== null || $params['to'] !== null ) {
210  $isDirNewer = ( $dir === 'newer' );
211  $after = ( $isDirNewer ? '>=' : '<=' );
212  $before = ( $isDirNewer ? '<=' : '>=' );
213  $where = [];
214  foreach ( $namespaces as $ns ) {
215  $w = [];
216  if ( $params['from'] !== null ) {
217  $w[] = 'ar_title' . $after .
218  $db->addQuotes( $this->titlePartToKey( $params['from'], $ns ) );
219  }
220  if ( $params['to'] !== null ) {
221  $w[] = 'ar_title' . $before .
222  $db->addQuotes( $this->titlePartToKey( $params['to'], $ns ) );
223  }
224  $w = $db->makeList( $w, LIST_AND );
225  $where[$w][] = $ns;
226  }
227  if ( count( $where ) == 1 ) {
228  $where = key( $where );
229  $this->addWhere( $where );
230  } else {
231  $where2 = [];
232  foreach ( $where as $w => $ns ) {
233  $where2[] = $db->makeList( [ $w, 'ar_namespace' => $ns ], LIST_AND );
234  }
235  $this->addWhere( $db->makeList( $where2, LIST_OR ) );
236  }
237  }
238 
239  if ( isset( $params['prefix'] ) ) {
240  $where = [];
241  foreach ( $namespaces as $ns ) {
242  $w = 'ar_title' . $db->buildLike(
243  $this->titlePartToKey( $params['prefix'], $ns ),
244  $db->anyString() );
245  $where[$w][] = $ns;
246  }
247  if ( count( $where ) == 1 ) {
248  $where = key( $where );
249  $this->addWhere( $where );
250  } else {
251  $where2 = [];
252  foreach ( $where as $w => $ns ) {
253  $where2[] = $db->makeList( [ $w, 'ar_namespace' => $ns ], LIST_AND );
254  }
255  $this->addWhere( $db->makeList( $where2, LIST_OR ) );
256  }
257  }
258  } else {
259  if ( $this->getConfig()->get( 'MiserMode' ) ) {
260  $miser_ns = $params['namespace'];
261  } else {
262  $this->addWhereFld( 'ar_namespace', $params['namespace'] );
263  }
264  $this->addTimestampWhereRange( 'ar_timestamp', $dir, $params['start'], $params['end'] );
265  }
266 
267  if ( $params['user'] !== null ) {
268  // We could get the actor ID from the ActorStore, but it's probably
269  // uncached at this point, and the non-generator case needs an actor
270  // join anyway so adding this join here is normally free. This should
271  // use the ar_actor_timestamp index.
272  $this->addWhereFld( 'actor_name', $params['user'] );
273  } elseif ( $params['excludeuser'] !== null ) {
274  $this->addWhere( 'actor_name<>' . $db->addQuotes( $params['excludeuser'] ) );
275  }
276 
277  if ( $params['user'] !== null || $params['excludeuser'] !== null ) {
278  // Paranoia: avoid brute force searches (T19342)
279  if ( !$this->getAuthority()->isAllowed( 'deletedhistory' ) ) {
280  $bitmask = RevisionRecord::DELETED_USER;
281  } elseif ( !$this->getAuthority()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
282  $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
283  } else {
284  $bitmask = 0;
285  }
286  if ( $bitmask ) {
287  $this->addWhere( $db->bitAnd( 'ar_deleted', $bitmask ) . " != $bitmask" );
288  }
289  }
290 
291  if ( $params['continue'] !== null ) {
292  $cont = explode( '|', $params['continue'] );
293  $op = ( $dir == 'newer' ? '>' : '<' );
294  if ( $optimizeGenerateTitles ) {
295  $this->dieContinueUsageIf( count( $cont ) != 2 );
296  $ns = (int)$cont[0];
297  $this->dieContinueUsageIf( strval( $ns ) !== $cont[0] );
298  $title = $db->addQuotes( $cont[1] );
299  $this->addWhere( "ar_namespace $op $ns OR " .
300  "(ar_namespace = $ns AND ar_title $op= $title)" );
301  } elseif ( $mode == 'all' ) {
302  $this->dieContinueUsageIf( count( $cont ) != 4 );
303  $ns = (int)$cont[0];
304  $this->dieContinueUsageIf( strval( $ns ) !== $cont[0] );
305  $title = $db->addQuotes( $cont[1] );
306  $ts = $db->addQuotes( $db->timestamp( $cont[2] ) );
307  $ar_id = (int)$cont[3];
308  $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[3] );
309  $this->addWhere( "ar_namespace $op $ns OR " .
310  "(ar_namespace = $ns AND " .
311  "(ar_title $op $title OR " .
312  "(ar_title = $title AND " .
313  "(ar_timestamp $op $ts OR " .
314  "(ar_timestamp = $ts AND " .
315  "ar_id $op= $ar_id)))))" );
316  } else {
317  $this->dieContinueUsageIf( count( $cont ) != 2 );
318  $ts = $db->addQuotes( $db->timestamp( $cont[0] ) );
319  $ar_id = (int)$cont[1];
320  $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[1] );
321  $this->addWhere( "ar_timestamp $op $ts OR " .
322  "(ar_timestamp = $ts AND " .
323  "ar_id $op= $ar_id)" );
324  }
325  }
326 
327  $this->addOption( 'LIMIT', $this->limit + 1 );
328 
329  $sort = ( $dir == 'newer' ? '' : ' DESC' );
330  $orderby = [];
331  if ( $optimizeGenerateTitles ) {
332  // Targeting index ar_name_title_timestamp
333  if ( $params['namespace'] === null || count( array_unique( $params['namespace'] ) ) > 1 ) {
334  $orderby[] = "ar_namespace $sort";
335  }
336  $orderby[] = "ar_title $sort";
337  } elseif ( $mode == 'all' ) {
338  // Targeting index ar_name_title_timestamp
339  if ( $params['namespace'] === null || count( array_unique( $params['namespace'] ) ) > 1 ) {
340  $orderby[] = "ar_namespace $sort";
341  }
342  $orderby[] = "ar_title $sort";
343  $orderby[] = "ar_timestamp $sort";
344  $orderby[] = "ar_id $sort";
345  } else {
346  // Targeting index usertext_timestamp
347  // 'user' is always constant.
348  $orderby[] = "ar_timestamp $sort";
349  $orderby[] = "ar_id $sort";
350  }
351  $this->addOption( 'ORDER BY', $orderby );
352 
353  $res = $this->select( __METHOD__ );
354 
355  if ( $resultPageSet === null ) {
356  $this->executeGenderCacheFromResultWrapper( $res, __METHOD__, 'ar' );
357  }
358 
359  $pageMap = []; // Maps ns&title to array index
360  $count = 0;
361  $nextIndex = 0;
362  $generated = [];
363  foreach ( $res as $row ) {
364  if ( ++$count > $this->limit ) {
365  // We've had enough
366  if ( $optimizeGenerateTitles ) {
367  $this->setContinueEnumParameter( 'continue', "$row->ar_namespace|$row->ar_title" );
368  } elseif ( $mode == 'all' ) {
369  $this->setContinueEnumParameter( 'continue',
370  "$row->ar_namespace|$row->ar_title|$row->ar_timestamp|$row->ar_id"
371  );
372  } else {
373  $this->setContinueEnumParameter( 'continue', "$row->ar_timestamp|$row->ar_id" );
374  }
375  break;
376  }
377 
378  // Miser mode namespace check
379  if ( $miser_ns !== null && !in_array( $row->ar_namespace, $miser_ns ) ) {
380  continue;
381  }
382 
383  if ( $resultPageSet !== null ) {
384  if ( $params['generatetitles'] ) {
385  $key = "{$row->ar_namespace}:{$row->ar_title}";
386  if ( !isset( $generated[$key] ) ) {
387  $generated[$key] = Title::makeTitle( $row->ar_namespace, $row->ar_title );
388  }
389  } else {
390  $generated[] = $row->ar_rev_id;
391  }
392  } else {
393  $revision = $this->revisionStore->newRevisionFromArchiveRow( $row );
394  $rev = $this->extractRevisionInfo( $revision, $row );
395 
396  if ( !isset( $pageMap[$row->ar_namespace][$row->ar_title] ) ) {
397  $index = $nextIndex++;
398  $pageMap[$row->ar_namespace][$row->ar_title] = $index;
399  $title = Title::newFromLinkTarget( $revision->getPageAsLinkTarget() );
400  $a = [
401  'pageid' => $title->getArticleID(),
402  'revisions' => [ $rev ],
403  ];
404  ApiResult::setIndexedTagName( $a['revisions'], 'rev' );
406  $fit = $result->addValue( [ 'query', $this->getModuleName() ], $index, $a );
407  } else {
408  $index = $pageMap[$row->ar_namespace][$row->ar_title];
409  $fit = $result->addValue(
410  [ 'query', $this->getModuleName(), $index, 'revisions' ],
411  null, $rev );
412  }
413  if ( !$fit ) {
414  if ( $mode == 'all' ) {
415  $this->setContinueEnumParameter( 'continue',
416  "$row->ar_namespace|$row->ar_title|$row->ar_timestamp|$row->ar_id"
417  );
418  } else {
419  $this->setContinueEnumParameter( 'continue', "$row->ar_timestamp|$row->ar_id" );
420  }
421  break;
422  }
423  }
424  }
425 
426  if ( $resultPageSet !== null ) {
427  if ( $params['generatetitles'] ) {
428  $resultPageSet->populateFromTitles( $generated );
429  } else {
430  $resultPageSet->populateFromRevisionIDs( $generated );
431  }
432  } else {
433  $result->addIndexedTagName( [ 'query', $this->getModuleName() ], 'page' );
434  }
435  }
436 
437  public function getAllowedParams() {
438  $ret = parent::getAllowedParams() + [
439  'user' => [
440  ApiBase::PARAM_TYPE => 'user',
441  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
442  ],
443  'namespace' => [
444  ApiBase::PARAM_ISMULTI => true,
445  ApiBase::PARAM_TYPE => 'namespace',
446  ],
447  'start' => [
448  ApiBase::PARAM_TYPE => 'timestamp',
449  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'useronly' ] ],
450  ],
451  'end' => [
452  ApiBase::PARAM_TYPE => 'timestamp',
453  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'useronly' ] ],
454  ],
455  'dir' => [
457  'newer',
458  'older'
459  ],
460  ApiBase::PARAM_DFLT => 'older',
461  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
462  ],
463  'from' => [
464  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'nonuseronly' ] ],
465  ],
466  'to' => [
467  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'nonuseronly' ] ],
468  ],
469  'prefix' => [
470  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'nonuseronly' ] ],
471  ],
472  'excludeuser' => [
473  ApiBase::PARAM_TYPE => 'user',
474  UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'id', 'interwiki' ],
475  ApiBase::PARAM_HELP_MSG_INFO => [ [ 'nonuseronly' ] ],
476  ],
477  'tag' => null,
478  'continue' => [
479  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
480  ],
481  'generatetitles' => [
482  ApiBase::PARAM_DFLT => false
483  ],
484  ];
485 
486  if ( $this->getConfig()->get( 'MiserMode' ) ) {
487  $ret['user'][ApiBase::PARAM_HELP_MSG_APPEND] = [
488  'apihelp-query+alldeletedrevisions-param-miser-user-namespace',
489  ];
490  $ret['namespace'][ApiBase::PARAM_HELP_MSG_APPEND] = [
491  'apihelp-query+alldeletedrevisions-param-miser-user-namespace',
492  ];
493  }
494 
495  return $ret;
496  }
497 
498  protected function getExamplesMessages() {
499  return [
500  'action=query&list=alldeletedrevisions&adruser=Example&adrlimit=50'
501  => 'apihelp-query+alldeletedrevisions-example-user',
502  'action=query&list=alldeletedrevisions&adrdir=newer&adrnamespace=0&adrlimit=50'
503  => 'apihelp-query+alldeletedrevisions-example-ns-main',
504  ];
505  }
506 
507  public function getHelpUrls() {
508  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Alldeletedrevisions';
509  }
510 }
LIST_OR
const LIST_OR
Definition: Defines.php:46
ApiQueryRevisionsBase\parseParameters
parseParameters( $params)
Parse the parameters into the various instance fields.
Definition: ApiQueryRevisionsBase.php:124
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: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
ApiBase\addWarning
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
Definition: ApiBase.php:1293
ApiQueryAllDeletedRevisions\$revisionStore
RevisionStore $revisionStore
Definition: ApiQueryAllDeletedRevisions.php:42
ApiQueryRevisionsBase\$contentHandlerFactory
IContentHandlerFactory $contentHandlerFactory
Definition: ApiQueryRevisionsBase.php:67
MediaWiki\Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:87
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1374
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
LIST_AND
const LIST_AND
Definition: Defines.php:43
ApiBase\PARAM_TYPE
const PARAM_TYPE
Definition: ApiBase.php:72
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:571
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\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:112
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:25
ApiQueryAllDeletedRevisions\$changeTagDefStore
NameTableStore $changeTagDefStore
Definition: ApiQueryAllDeletedRevisions.php:45
ApiQueryRevisionsBase
A base class for functions common to producing a list of revisions.
Definition: ApiQueryRevisionsBase.php:41
ApiQueryAllDeletedRevisions\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryAllDeletedRevisions.php:507
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
Definition: ApiQueryGeneratorBase.php:83
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:626
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:117
ApiQueryAllDeletedRevisions\getAllowedParams
getAllowedParams()
Definition: ApiQueryAllDeletedRevisions.php:437
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:680
ApiQueryAllDeletedRevisions\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryAllDeletedRevisions.php:498
ApiQueryAllDeletedRevisions\run
run(ApiPageSet $resultPageSet=null)
Definition: ApiQueryAllDeletedRevisions.php:88
ApiBase\getModulePrefix
getModulePrefix()
Get parameter prefix (usually two letters or an empty string).
Definition: ApiBase.php:448
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:607
ParserFactory
Definition: ParserFactory.php:36
ApiQueryAllDeletedRevisions\__construct
__construct(ApiQuery $query, $moduleName, RevisionStore $revisionStore, IContentHandlerFactory $contentHandlerFactory, ParserFactory $parserFactory, SlotRoleRegistry $slotRoleRegistry, NameTableStore $changeTagDefStore, NamespaceInfo $namespaceInfo)
Definition: ApiQueryAllDeletedRevisions.php:60
ApiQueryRevisionsBase\$parserFactory
ParserFactory $parserFactory
Definition: ApiQueryRevisionsBase.php:70
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:1557
MediaWiki\Content\IContentHandlerFactory
Definition: IContentHandlerFactory.php:10
ContextSource\getAuthority
getAuthority()
Definition: ContextSource.php:144
ApiQueryRevisionsBase\extractRevisionInfo
extractRevisionInfo(RevisionRecord $revision, $row)
Extract information from the RevisionRecord.
Definition: ApiQueryRevisionsBase.php:279
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
ApiQueryRevisionsBase\$slotRoleRegistry
SlotRoleRegistry $slotRoleRegistry
Definition: ApiQueryRevisionsBase.php:73
ApiBase\PARAM_HELP_MSG_INFO
const PARAM_HELP_MSG_INFO
(array) Specify additional information tags for the parameter.
Definition: ApiBase.php:122
Title\newFromLinkTarget
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition: Title.php:327
ApiBase\PARAM_DFLT
const PARAM_DFLT
Definition: ApiBase.php:70
ApiBase\getParameter
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
Definition: ApiBase.php:827
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
ApiQueryAllDeletedRevisions\$namespaceInfo
NamespaceInfo $namespaceInfo
Definition: ApiQueryAllDeletedRevisions.php:48
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
NamespaceInfo
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Definition: NamespaceInfo.php:35
ApiQueryBase\titlePartToKey
titlePartToKey( $titlePart, $namespace=NS_MAIN)
Convert an input title or title prefix into a dbkey.
Definition: ApiQueryBase.php:529
ApiQueryAllDeletedRevisions
Query module to enumerate all deleted revisions.
Definition: ApiQueryAllDeletedRevisions.php:39
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:466