MediaWiki  master
ApiQueryBacklinks.php
Go to the documentation of this file.
1 <?php
25 
35 
39  private $rootTitle;
40 
41  private $params;
43  private $cont;
44  private $redirect;
46 
48  private $helpUrl;
49 
55  private $pageMap = [];
56  private $resultArr;
57 
58  private $redirTitles = [];
59  private $continueStr = null;
60 
61  // output element name, database column field prefix, database table
62  private $backlinksSettings = [
63  'backlinks' => [
64  'code' => 'bl',
65  'prefix' => 'pl',
66  'linktbl' => 'pagelinks',
67  'helpurl' => 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Backlinks',
68  ],
69  'embeddedin' => [
70  'code' => 'ei',
71  'prefix' => 'tl',
72  'linktbl' => 'templatelinks',
73  'helpurl' => 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Embeddedin',
74  ],
75  'imageusage' => [
76  'code' => 'iu',
77  'prefix' => 'il',
78  'linktbl' => 'imagelinks',
79  'helpurl' => 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Imageusage',
80  ]
81  ];
82 
83  public function __construct( ApiQuery $query, $moduleName ) {
84  $settings = $this->backlinksSettings[$moduleName];
85  $prefix = $settings['prefix'];
86  $code = $settings['code'];
87  $this->resultArr = [];
88 
89  parent::__construct( $query, $moduleName, $code );
90  $this->bl_ns = $prefix . '_namespace';
91  $this->bl_from = $prefix . '_from';
92  $this->bl_from_ns = $prefix . '_from_namespace';
93  $this->bl_table = $settings['linktbl'];
94  $this->bl_code = $code;
95  $this->helpUrl = $settings['helpurl'];
96 
97  $this->hasNS = $moduleName !== 'imageusage';
98  if ( $this->hasNS ) {
99  $this->bl_title = $prefix . '_title';
100  $this->bl_fields = [
101  $this->bl_ns,
103  ];
104  } else {
105  $this->bl_title = $prefix . '_to';
106  $this->bl_fields = [
108  ];
109  }
110  }
111 
112  public function execute() {
113  $this->run();
114  }
115 
116  public function getCacheMode( $params ) {
117  return 'public';
118  }
119 
120  public function executeGenerator( $resultPageSet ) {
121  $this->run( $resultPageSet );
122  }
123 
128  private function runFirstQuery( $resultPageSet = null ) {
129  $this->addTables( [ $this->bl_table, 'page' ] );
130  $this->addWhere( "{$this->bl_from}=page_id" );
131  if ( $resultPageSet === null ) {
132  $this->addFields( [ 'page_id', 'page_title', 'page_namespace' ] );
133  } else {
134  $this->addFields( $resultPageSet->getPageTableFields() );
135  }
136  $this->addFields( [ 'page_is_redirect', 'from_ns' => 'page_namespace' ] );
137 
138  $this->addWhereFld( $this->bl_title, $this->rootTitle->getDBkey() );
139  if ( $this->hasNS ) {
140  $this->addWhereFld( $this->bl_ns, $this->rootTitle->getNamespace() );
141  }
142  $this->addWhereFld( $this->bl_from_ns, $this->params['namespace'] );
143 
144  if ( count( $this->cont ) >= 2 ) {
145  $op = $this->params['dir'] == 'descending' ? '<' : '>';
146  if ( $this->params['namespace'] !== null && count( $this->params['namespace'] ) > 1 ) {
147  $this->addWhere(
148  "{$this->bl_from_ns} $op {$this->cont[0]} OR " .
149  "({$this->bl_from_ns} = {$this->cont[0]} AND " .
150  "{$this->bl_from} $op= {$this->cont[1]})"
151  );
152  } else {
153  $this->addWhere( "{$this->bl_from} $op= {$this->cont[1]}" );
154  }
155  }
156 
157  if ( $this->params['filterredir'] == 'redirects' ) {
158  $this->addWhereFld( 'page_is_redirect', 1 );
159  } elseif ( $this->params['filterredir'] == 'nonredirects' && !$this->redirect ) {
160  // T24245 - Check for !redirect, as filtering nonredirects, when
161  // getting what links to them is contradictory
162  $this->addWhereFld( 'page_is_redirect', 0 );
163  }
164 
165  $this->addOption( 'LIMIT', $this->params['limit'] + 1 );
166  $sort = ( $this->params['dir'] == 'descending' ? ' DESC' : '' );
167  $orderBy = [];
168  if ( $this->params['namespace'] !== null && count( $this->params['namespace'] ) > 1 ) {
169  $orderBy[] = $this->bl_from_ns . $sort;
170  }
171  $orderBy[] = $this->bl_from . $sort;
172  $this->addOption( 'ORDER BY', $orderBy );
173  $this->addOption( 'STRAIGHT_JOIN' );
174 
175  $res = $this->select( __METHOD__ );
176 
177  if ( $resultPageSet === null ) {
178  $this->executeGenderCacheFromResultWrapper( $res, __METHOD__ );
179  }
180 
181  $count = 0;
182  foreach ( $res as $row ) {
183  if ( ++$count > $this->params['limit'] ) {
184  // We've reached the one extra which shows that there are
185  // additional pages to be had. Stop here...
186  // Continue string may be overridden at a later step
187  $this->continueStr = "{$row->from_ns}|{$row->page_id}";
188  break;
189  }
190 
191  // Fill in continuation fields for later steps
192  if ( count( $this->cont ) < 2 ) {
193  $this->cont[] = $row->from_ns;
194  $this->cont[] = $row->page_id;
195  }
196 
197  $this->pageMap[$row->page_namespace][$row->page_title] = $row->page_id;
198  $t = Title::makeTitle( $row->page_namespace, $row->page_title );
199  if ( $row->page_is_redirect ) {
200  $this->redirTitles[] = $t;
201  }
202 
203  if ( $resultPageSet === null ) {
204  $a = [ 'pageid' => (int)$row->page_id ];
206  if ( $row->page_is_redirect ) {
207  $a['redirect'] = true;
208  }
209  // Put all the results in an array first
210  $this->resultArr[$a['pageid']] = $a;
211  } else {
212  $resultPageSet->processDbRow( $row );
213  }
214  }
215  }
216 
221  private function runSecondQuery( $resultPageSet = null ) {
222  $db = $this->getDB();
223  $this->addTables( [ 'page', $this->bl_table ] );
224  $this->addWhere( "{$this->bl_from}=page_id" );
225 
226  if ( $resultPageSet === null ) {
227  $this->addFields( [ 'page_id', 'page_title', 'page_namespace', 'page_is_redirect' ] );
228  } else {
229  $this->addFields( $resultPageSet->getPageTableFields() );
230  }
231 
232  $this->addFields( [ $this->bl_title, 'from_ns' => 'page_namespace' ] );
233  if ( $this->hasNS ) {
234  $this->addFields( $this->bl_ns );
235  }
236 
237  // We can't use LinkBatch here because $this->hasNS may be false
238  $titleWhere = [];
239  $allRedirNs = [];
240  $allRedirDBkey = [];
242  foreach ( $this->redirTitles as $t ) {
243  $redirNs = $t->getNamespace();
244  $redirDBkey = $t->getDBkey();
245  $titleWhere[] = "{$this->bl_title} = " . $db->addQuotes( $redirDBkey ) .
246  ( $this->hasNS ? " AND {$this->bl_ns} = {$redirNs}" : '' );
247  $allRedirNs[$redirNs] = true;
248  $allRedirDBkey[$redirDBkey] = true;
249  }
250  $this->addWhere( $db->makeList( $titleWhere, LIST_OR ) );
251  $this->addWhereFld( 'page_namespace', $this->params['namespace'] );
252 
253  if ( count( $this->cont ) >= 6 ) {
254  $op = $this->params['dir'] == 'descending' ? '<' : '>';
255 
256  $where = "{$this->bl_from} $op= {$this->cont[5]}";
257  // Don't bother with namespace, title, or from_namespace if it's
258  // otherwise constant in the where clause.
259  if ( $this->params['namespace'] !== null && count( $this->params['namespace'] ) > 1 ) {
260  $where = "{$this->bl_from_ns} $op {$this->cont[4]} OR " .
261  "({$this->bl_from_ns} = {$this->cont[4]} AND ($where))";
262  }
263  if ( count( $allRedirDBkey ) > 1 ) {
264  $title = $db->addQuotes( $this->cont[3] );
265  $where = "{$this->bl_title} $op $title OR " .
266  "({$this->bl_title} = $title AND ($where))";
267  }
268  if ( $this->hasNS && count( $allRedirNs ) > 1 ) {
269  $where = "{$this->bl_ns} $op {$this->cont[2]} OR " .
270  "({$this->bl_ns} = {$this->cont[2]} AND ($where))";
271  }
272 
273  $this->addWhere( $where );
274  }
275  if ( $this->params['filterredir'] == 'redirects' ) {
276  $this->addWhereFld( 'page_is_redirect', 1 );
277  } elseif ( $this->params['filterredir'] == 'nonredirects' ) {
278  $this->addWhereFld( 'page_is_redirect', 0 );
279  }
280 
281  $this->addOption( 'LIMIT', $this->params['limit'] + 1 );
282  $orderBy = [];
283  $sort = ( $this->params['dir'] == 'descending' ? ' DESC' : '' );
284  // Don't order by namespace/title/from_namespace if it's constant in the WHERE clause
285  if ( $this->hasNS && count( $allRedirNs ) > 1 ) {
286  $orderBy[] = $this->bl_ns . $sort;
287  }
288  if ( count( $allRedirDBkey ) > 1 ) {
289  $orderBy[] = $this->bl_title . $sort;
290  }
291  if ( $this->params['namespace'] !== null && count( $this->params['namespace'] ) > 1 ) {
292  $orderBy[] = $this->bl_from_ns . $sort;
293  }
294  $orderBy[] = $this->bl_from . $sort;
295  $this->addOption( 'ORDER BY', $orderBy );
296  $this->addOption( 'USE INDEX', [ 'page' => 'PRIMARY' ] );
297 
298  $res = $this->select( __METHOD__ );
299 
300  if ( $resultPageSet === null ) {
301  $this->executeGenderCacheFromResultWrapper( $res, __METHOD__ );
302  }
303 
304  $count = 0;
305  foreach ( $res as $row ) {
306  $ns = $this->hasNS ? $row->{$this->bl_ns} : NS_FILE;
307 
308  if ( ++$count > $this->params['limit'] ) {
309  // We've reached the one extra which shows that there are
310  // additional pages to be had. Stop here...
311  // Note we must keep the parameters for the first query constant
312  // This may be overridden at a later step
313  $title = $row->{$this->bl_title};
314  $this->continueStr = implode( '|', array_slice( $this->cont, 0, 2 ) ) .
315  "|$ns|$title|{$row->from_ns}|{$row->page_id}";
316  break;
317  }
318 
319  // Fill in continuation fields for later steps
320  if ( count( $this->cont ) < 6 ) {
321  $this->cont[] = $ns;
322  $this->cont[] = $row->{$this->bl_title};
323  $this->cont[] = $row->from_ns;
324  $this->cont[] = $row->page_id;
325  }
326 
327  if ( $resultPageSet === null ) {
328  $a = [ 'pageid' => (int)$row->page_id ];
329  ApiQueryBase::addTitleInfo( $a, Title::makeTitle( $row->page_namespace, $row->page_title ) );
330  if ( $row->page_is_redirect ) {
331  $a['redirect'] = true;
332  }
333  $parentID = $this->pageMap[$ns][$row->{$this->bl_title}];
334  // Put all the results in an array first
335  $this->resultArr[$parentID]['redirlinks'][$row->page_id] = $a;
336  } else {
337  $resultPageSet->processDbRow( $row );
338  }
339  }
340  }
341 
346  private function run( $resultPageSet = null ) {
347  $this->params = $this->extractRequestParams( false );
348  $this->redirect = isset( $this->params['redirect'] ) && $this->params['redirect'];
349  $userMax = ( $this->redirect ? ApiBase::LIMIT_BIG1 / 2 : ApiBase::LIMIT_BIG1 );
350  $botMax = ( $this->redirect ? ApiBase::LIMIT_BIG2 / 2 : ApiBase::LIMIT_BIG2 );
351 
352  $result = $this->getResult();
353 
354  if ( $this->params['limit'] == 'max' ) {
355  $this->params['limit'] = $this->getMain()->canApiHighLimits() ? $botMax : $userMax;
356  $result->addParsedLimit( $this->getModuleName(), $this->params['limit'] );
357  } else {
358  $this->params['limit'] = $this->getMain()->getParamValidator()->validateValue(
359  $this, 'limit', (int)$this->params['limit'], [
360  ParamValidator::PARAM_TYPE => 'limit',
361  IntegerDef::PARAM_MIN => 1,
362  IntegerDef::PARAM_MAX => $userMax,
363  IntegerDef::PARAM_MAX2 => $botMax,
364  IntegerDef::PARAM_IGNORE_RANGE => true,
365  ]
366  );
367  }
368 
369  $this->rootTitle = $this->getTitleFromTitleOrPageId( $this->params );
370 
371  // only image titles are allowed for the root in imageinfo mode
372  if ( !$this->hasNS && $this->rootTitle->getNamespace() !== NS_FILE ) {
373  $this->dieWithError(
374  [ 'apierror-imageusage-badtitle', $this->getModuleName() ],
375  'bad_image_title'
376  );
377  }
378 
379  // Parse and validate continuation parameter
380  $this->cont = [];
381  if ( $this->params['continue'] !== null ) {
382  $cont = explode( '|', $this->params['continue'] );
383 
384  switch ( count( $cont ) ) {
385  case 8:
386  // redirect page ID for result adding
387  $this->cont[7] = (int)$cont[7];
388  $this->dieContinueUsageIf( $cont[7] !== (string)$this->cont[7] );
389 
390  /* Fall through */
391 
392  case 7:
393  // top-level page ID for result adding
394  $this->cont[6] = (int)$cont[6];
395  $this->dieContinueUsageIf( $cont[6] !== (string)$this->cont[6] );
396 
397  /* Fall through */
398 
399  case 6:
400  // ns for 2nd query (even for imageusage)
401  $this->cont[2] = (int)$cont[2];
402  $this->dieContinueUsageIf( $cont[2] !== (string)$this->cont[2] );
403 
404  // title for 2nd query
405  $this->cont[3] = $cont[3];
406 
407  // from_ns for 2nd query
408  $this->cont[4] = (int)$cont[4];
409  $this->dieContinueUsageIf( $cont[4] !== (string)$this->cont[4] );
410 
411  // from_id for 1st query
412  $this->cont[5] = (int)$cont[5];
413  $this->dieContinueUsageIf( $cont[5] !== (string)$this->cont[5] );
414 
415  /* Fall through */
416 
417  case 2:
418  // from_ns for 1st query
419  $this->cont[0] = (int)$cont[0];
420  $this->dieContinueUsageIf( $cont[0] !== (string)$this->cont[0] );
421 
422  // from_id for 1st query
423  $this->cont[1] = (int)$cont[1];
424  $this->dieContinueUsageIf( $cont[1] !== (string)$this->cont[1] );
425 
426  break;
427 
428  default:
429  // @phan-suppress-next-line PhanImpossibleCondition
430  $this->dieContinueUsageIf( true );
431  }
432 
433  ksort( $this->cont );
434  }
435 
436  $this->runFirstQuery( $resultPageSet );
437  if ( $this->redirect && count( $this->redirTitles ) ) {
438  $this->resetQueryParams();
439  $this->runSecondQuery( $resultPageSet );
440  }
441 
442  // Fill in any missing fields in case it's needed below
443  $this->cont += [ 0, 0, 0, '', 0, 0, 0 ];
444 
445  if ( $resultPageSet === null ) {
446  // Try to add the result data in one go and pray that it fits
447  $code = $this->bl_code;
448  $data = array_map( function ( $arr ) use ( $code ) {
449  if ( isset( $arr['redirlinks'] ) ) {
450  $arr['redirlinks'] = array_values( $arr['redirlinks'] );
451  ApiResult::setIndexedTagName( $arr['redirlinks'], $code );
452  }
453  return $arr;
454  }, array_values( $this->resultArr ) );
455  $fit = $result->addValue( 'query', $this->getModuleName(), $data );
456  if ( !$fit ) {
457  // It didn't fit. Add elements one by one until the
458  // result is full.
459  ksort( $this->resultArr );
460  // @phan-suppress-next-line PhanSuspiciousValueComparison
461  if ( count( $this->cont ) >= 7 ) {
462  $startAt = $this->cont[6];
463  } else {
464  reset( $this->resultArr );
465  $startAt = key( $this->resultArr );
466  }
467  $idx = 0;
468  foreach ( $this->resultArr as $pageID => $arr ) {
469  if ( $pageID < $startAt ) {
470  continue;
471  }
472 
473  // Add the basic entry without redirlinks first
474  $fit = $result->addValue(
475  [ 'query', $this->getModuleName() ],
476  $idx, array_diff_key( $arr, [ 'redirlinks' => '' ] ) );
477  if ( !$fit ) {
478  $this->continueStr = implode( '|', array_slice( $this->cont, 0, 6 ) ) .
479  "|$pageID";
480  break;
481  }
482 
483  $hasRedirs = false;
484  $redirLinks = isset( $arr['redirlinks'] ) ? (array)$arr['redirlinks'] : [];
485  ksort( $redirLinks );
486  // @phan-suppress-next-line PhanSuspiciousValueComparisonInLoop
487  if ( count( $this->cont ) >= 8 && $pageID == $startAt ) {
488  $redirStartAt = $this->cont[7];
489  } else {
490  reset( $redirLinks );
491  $redirStartAt = key( $redirLinks );
492  }
493  foreach ( $redirLinks as $key => $redir ) {
494  if ( $key < $redirStartAt ) {
495  continue;
496  }
497 
498  $fit = $result->addValue(
499  [ 'query', $this->getModuleName(), $idx, 'redirlinks' ],
500  null, $redir );
501  if ( !$fit ) {
502  $this->continueStr = implode( '|', array_slice( $this->cont, 0, 6 ) ) .
503  "|$pageID|$key";
504  break;
505  }
506  $hasRedirs = true;
507  }
508  if ( $hasRedirs ) {
509  $result->addIndexedTagName(
510  [ 'query', $this->getModuleName(), $idx, 'redirlinks' ],
511  $this->bl_code );
512  }
513  if ( !$fit ) {
514  break;
515  }
516 
517  $idx++;
518  }
519  }
520 
521  $result->addIndexedTagName(
522  [ 'query', $this->getModuleName() ],
523  $this->bl_code
524  );
525  }
526  if ( $this->continueStr !== null ) {
527  $this->setContinueEnumParameter( 'continue', $this->continueStr );
528  }
529  }
530 
531  public function getAllowedParams() {
532  $retval = [
533  'title' => [
534  ApiBase::PARAM_TYPE => 'string',
535  ],
536  'pageid' => [
537  ApiBase::PARAM_TYPE => 'integer',
538  ],
539  'continue' => [
540  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
541  ],
542  'namespace' => [
543  ApiBase::PARAM_ISMULTI => true,
544  ApiBase::PARAM_TYPE => 'namespace'
545  ],
546  'dir' => [
547  ApiBase::PARAM_DFLT => 'ascending',
549  'ascending',
550  'descending'
551  ]
552  ],
553  'filterredir' => [
554  ApiBase::PARAM_DFLT => 'all',
556  'all',
557  'redirects',
558  'nonredirects'
559  ]
560  ],
561  'limit' => [
562  ApiBase::PARAM_DFLT => 10,
563  ApiBase::PARAM_TYPE => 'limit',
564  ApiBase::PARAM_MIN => 1,
567  ]
568  ];
569  if ( $this->getModuleName() == 'embeddedin' ) {
570  return $retval;
571  }
572  $retval['redirect'] = false;
573 
574  return $retval;
575  }
576 
577  protected function getExamplesMessages() {
578  static $examples = [
579  'backlinks' => [
580  'action=query&list=backlinks&bltitle=Main%20Page'
581  => 'apihelp-query+backlinks-example-simple',
582  'action=query&generator=backlinks&gbltitle=Main%20Page&prop=info'
583  => 'apihelp-query+backlinks-example-generator',
584  ],
585  'embeddedin' => [
586  'action=query&list=embeddedin&eititle=Template:Stub'
587  => 'apihelp-query+embeddedin-example-simple',
588  'action=query&generator=embeddedin&geititle=Template:Stub&prop=info'
589  => 'apihelp-query+embeddedin-example-generator',
590  ],
591  'imageusage' => [
592  'action=query&list=imageusage&iutitle=File:Albert%20Einstein%20Head.jpg'
593  => 'apihelp-query+imageusage-example-simple',
594  'action=query&generator=imageusage&giutitle=File:Albert%20Einstein%20Head.jpg&prop=info'
595  => 'apihelp-query+imageusage-example-generator',
596  ]
597  ];
598 
599  return $examples[$this->getModuleName()];
600  }
601 
602  public function getHelpUrls() {
603  return $this->helpUrl;
604  }
605 }
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
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:107
ApiBase\PARAM_TYPE
const PARAM_TYPE
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:71
NS_FILE
const NS_FILE
Definition: Defines.php:75
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
ApiBase\PARAM_MIN
const PARAM_MIN
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:74
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:630
LIST_OR
const LIST_OR
Definition: Defines.php:51
ApiBase\LIMIT_BIG1
const LIMIT_BIG1
Fast query, standard limit.
Definition: ApiBase.php:165
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:72
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
$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:592
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:604
ApiQueryBase\addWhereFld
addWhereFld( $field, $value)
Equivalent to addWhere( [ $field => $value ] )
Definition: ApiQueryBase.php:285
ApiQueryGeneratorBase
Stable to extend.
Definition: ApiQueryGeneratorBase.php:28
Title
Represents a title within MediaWiki.
Definition: Title.php:42
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:167
ApiBase\PARAM_DFLT
const PARAM_DFLT
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:69
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:70
ApiBase\PARAM_MAX2
const PARAM_MAX2
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:73
ApiQueryBase\addWhere
addWhere( $value)
Add a set of WHERE clauses to the internal array.
Definition: ApiQueryBase.php:248
$t
$t
Definition: testCompression.php:74
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