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  $this->dieContinueUsageIf( true );
430  }
431 
432  ksort( $this->cont );
433  }
434 
435  $this->runFirstQuery( $resultPageSet );
436  if ( $this->redirect && count( $this->redirTitles ) ) {
437  $this->resetQueryParams();
438  $this->runSecondQuery( $resultPageSet );
439  }
440 
441  // Fill in any missing fields in case it's needed below
442  $this->cont += [ 0, 0, 0, '', 0, 0, 0 ];
443 
444  if ( $resultPageSet === null ) {
445  // Try to add the result data in one go and pray that it fits
446  $code = $this->bl_code;
447  $data = array_map( function ( $arr ) use ( $code ) {
448  if ( isset( $arr['redirlinks'] ) ) {
449  $arr['redirlinks'] = array_values( $arr['redirlinks'] );
450  ApiResult::setIndexedTagName( $arr['redirlinks'], $code );
451  }
452  return $arr;
453  }, array_values( $this->resultArr ) );
454  $fit = $result->addValue( 'query', $this->getModuleName(), $data );
455  if ( !$fit ) {
456  // It didn't fit. Add elements one by one until the
457  // result is full.
458  ksort( $this->resultArr );
459  if ( count( $this->cont ) >= 7 ) {
460  $startAt = $this->cont[6];
461  } else {
462  reset( $this->resultArr );
463  $startAt = key( $this->resultArr );
464  }
465  $idx = 0;
466  foreach ( $this->resultArr as $pageID => $arr ) {
467  if ( $pageID < $startAt ) {
468  continue;
469  }
470 
471  // Add the basic entry without redirlinks first
472  $fit = $result->addValue(
473  [ 'query', $this->getModuleName() ],
474  $idx, array_diff_key( $arr, [ 'redirlinks' => '' ] ) );
475  if ( !$fit ) {
476  $this->continueStr = implode( '|', array_slice( $this->cont, 0, 6 ) ) .
477  "|$pageID";
478  break;
479  }
480 
481  $hasRedirs = false;
482  $redirLinks = isset( $arr['redirlinks'] ) ? (array)$arr['redirlinks'] : [];
483  ksort( $redirLinks );
484  if ( count( $this->cont ) >= 8 && $pageID == $startAt ) {
485  $redirStartAt = $this->cont[7];
486  } else {
487  reset( $redirLinks );
488  $redirStartAt = key( $redirLinks );
489  }
490  foreach ( $redirLinks as $key => $redir ) {
491  if ( $key < $redirStartAt ) {
492  continue;
493  }
494 
495  $fit = $result->addValue(
496  [ 'query', $this->getModuleName(), $idx, 'redirlinks' ],
497  null, $redir );
498  if ( !$fit ) {
499  $this->continueStr = implode( '|', array_slice( $this->cont, 0, 6 ) ) .
500  "|$pageID|$key";
501  break;
502  }
503  $hasRedirs = true;
504  }
505  if ( $hasRedirs ) {
506  $result->addIndexedTagName(
507  [ 'query', $this->getModuleName(), $idx, 'redirlinks' ],
508  $this->bl_code );
509  }
510  if ( !$fit ) {
511  break;
512  }
513 
514  $idx++;
515  }
516  }
517 
518  $result->addIndexedTagName(
519  [ 'query', $this->getModuleName() ],
520  $this->bl_code
521  );
522  }
523  if ( $this->continueStr !== null ) {
524  $this->setContinueEnumParameter( 'continue', $this->continueStr );
525  }
526  }
527 
528  public function getAllowedParams() {
529  $retval = [
530  'title' => [
531  ApiBase::PARAM_TYPE => 'string',
532  ],
533  'pageid' => [
534  ApiBase::PARAM_TYPE => 'integer',
535  ],
536  'continue' => [
537  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
538  ],
539  'namespace' => [
540  ApiBase::PARAM_ISMULTI => true,
541  ApiBase::PARAM_TYPE => 'namespace'
542  ],
543  'dir' => [
544  ApiBase::PARAM_DFLT => 'ascending',
546  'ascending',
547  'descending'
548  ]
549  ],
550  'filterredir' => [
551  ApiBase::PARAM_DFLT => 'all',
553  'all',
554  'redirects',
555  'nonredirects'
556  ]
557  ],
558  'limit' => [
559  ApiBase::PARAM_DFLT => 10,
560  ApiBase::PARAM_TYPE => 'limit',
561  ApiBase::PARAM_MIN => 1,
564  ]
565  ];
566  if ( $this->getModuleName() == 'embeddedin' ) {
567  return $retval;
568  }
569  $retval['redirect'] = false;
570 
571  return $retval;
572  }
573 
574  protected function getExamplesMessages() {
575  static $examples = [
576  'backlinks' => [
577  'action=query&list=backlinks&bltitle=Main%20Page'
578  => 'apihelp-query+backlinks-example-simple',
579  'action=query&generator=backlinks&gbltitle=Main%20Page&prop=info'
580  => 'apihelp-query+backlinks-example-generator',
581  ],
582  'embeddedin' => [
583  'action=query&list=embeddedin&eititle=Template:Stub'
584  => 'apihelp-query+embeddedin-example-simple',
585  'action=query&generator=embeddedin&geititle=Template:Stub&prop=info'
586  => 'apihelp-query+embeddedin-example-generator',
587  ],
588  'imageusage' => [
589  'action=query&list=imageusage&iutitle=File:Albert%20Einstein%20Head.jpg'
590  => 'apihelp-query+imageusage-example-simple',
591  'action=query&generator=imageusage&giutitle=File:Albert%20Einstein%20Head.jpg&prop=info'
592  => 'apihelp-query+imageusage-example-generator',
593  ]
594  ];
595 
596  return $examples[$this->getModuleName()];
597  }
598 
599  public function getHelpUrls() {
600  return $this->helpUrl;
601  }
602 }
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
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:96
ApiBase\PARAM_TYPE
const PARAM_TYPE
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:60
NS_FILE
const NS_FILE
Definition: Defines.php:66
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
ApiBase\PARAM_MIN
const PARAM_MIN
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:63
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
ApiBase\LIMIT_BIG1
const LIMIT_BIG1
Fast query, standard limit.
Definition: ApiBase.php:154
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:107
ApiBase\PARAM_MAX
const PARAM_MAX
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:61
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
$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:602
ApiQueryBase\$where
$where
Definition: ApiQueryBase.php:37
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:616
ApiQueryBase\addWhereFld
addWhereFld( $field, $value)
Equivalent to addWhere( [ $field => $value ] )
Definition: ApiQueryBase.php:267
ApiQueryGeneratorBase
Definition: ApiQueryGeneratorBase.php:26
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:156
ApiBase\PARAM_DFLT
const PARAM_DFLT
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:58
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:59
ApiBase\PARAM_MAX2
const PARAM_MAX2
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:62
ApiQueryBase\addWhere
addWhere( $value)
Add a set of WHERE clauses to the internal array.
Definition: ApiQueryBase.php:230
$t
$t
Definition: testCompression.php:71
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:462