MediaWiki  master
ApiQuerySiteinfo.php
Go to the documentation of this file.
1 <?php
32 
39 
42 
45 
48 
51 
54 
57 
59  private $namespaceInfo;
60 
63 
65  private $parser;
66 
69 
72 
74  private $skinFactory;
75 
77  private $loadBalancer;
78 
80  private $readOnlyMode;
81 
100  public function __construct(
101  ApiQuery $query,
102  $moduleName,
111  Parser $parser,
117  ) {
118  parent::__construct( $query, $moduleName, 'si' );
119  $this->userOptionsLookup = $userOptionsLookup;
120  $this->userGroupManager = $userGroupManager;
121  $this->languageConverterFactory = $languageConverterFactory;
122  $this->languageFactory = $languageFactory;
123  $this->languageNameUtils = $languageNameUtils;
124  $this->contentLanguage = $contentLanguage;
125  $this->namespaceInfo = $namespaceInfo;
126  $this->interwikiLookup = $interwikiLookup;
127  $this->parser = $parser;
128  $this->magicWordFactory = $magicWordFactory;
129  $this->specialPageFactory = $specialPageFactory;
130  $this->skinFactory = $skinFactory;
131  $this->loadBalancer = $loadBalancer;
132  $this->readOnlyMode = $readOnlyMode;
133  }
134 
135  public function execute() {
136  $params = $this->extractRequestParams();
137  $done = [];
138  $fit = false;
139  foreach ( $params['prop'] as $p ) {
140  switch ( $p ) {
141  case 'general':
142  $fit = $this->appendGeneralInfo( $p );
143  break;
144  case 'namespaces':
145  $fit = $this->appendNamespaces( $p );
146  break;
147  case 'namespacealiases':
148  $fit = $this->appendNamespaceAliases( $p );
149  break;
150  case 'specialpagealiases':
151  $fit = $this->appendSpecialPageAliases( $p );
152  break;
153  case 'magicwords':
154  $fit = $this->appendMagicWords( $p );
155  break;
156  case 'interwikimap':
157  $fit = $this->appendInterwikiMap( $p, $params['filteriw'] );
158  break;
159  case 'dbrepllag':
160  $fit = $this->appendDbReplLagInfo( $p, $params['showalldb'] );
161  break;
162  case 'statistics':
163  $fit = $this->appendStatistics( $p );
164  break;
165  case 'usergroups':
166  $fit = $this->appendUserGroups( $p, $params['numberingroup'] );
167  break;
168  case 'libraries':
169  $fit = $this->appendInstalledLibraries( $p );
170  break;
171  case 'extensions':
172  $fit = $this->appendExtensions( $p );
173  break;
174  case 'fileextensions':
175  $fit = $this->appendFileExtensions( $p );
176  break;
177  case 'rightsinfo':
178  $fit = $this->appendRightsInfo( $p );
179  break;
180  case 'restrictions':
181  $fit = $this->appendRestrictions( $p );
182  break;
183  case 'languages':
184  $fit = $this->appendLanguages( $p );
185  break;
186  case 'languagevariants':
187  $fit = $this->appendLanguageVariants( $p );
188  break;
189  case 'skins':
190  $fit = $this->appendSkins( $p );
191  break;
192  case 'extensiontags':
193  $fit = $this->appendExtensionTags( $p );
194  break;
195  case 'functionhooks':
196  $fit = $this->appendFunctionHooks( $p );
197  break;
198  case 'showhooks':
199  $fit = $this->appendSubscribedHooks( $p );
200  break;
201  case 'variables':
202  $fit = $this->appendVariables( $p );
203  break;
204  case 'protocols':
205  $fit = $this->appendProtocols( $p );
206  break;
207  case 'defaultoptions':
208  $fit = $this->appendDefaultOptions( $p );
209  break;
210  case 'uploaddialog':
211  $fit = $this->appendUploadDialog( $p );
212  break;
213  default:
214  ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" ); // @codeCoverageIgnore
215  }
216  if ( !$fit ) {
217  // Abuse siprop as a query-continue parameter
218  // and set it to all unprocessed props
219  $this->setContinueEnumParameter( 'prop', implode( '|',
220  array_diff( $params['prop'], $done ) ) );
221  break;
222  }
223  $done[] = $p;
224  }
225  }
226 
227  protected function appendGeneralInfo( $property ) {
228  $config = $this->getConfig();
229 
230  $data = [];
231  $mainPage = Title::newMainPage();
232  $data['mainpage'] = $mainPage->getPrefixedText();
233  $data['base'] = wfExpandUrl( $mainPage->getFullURL(), PROTO_CURRENT );
234  $data['sitename'] = $config->get( 'Sitename' );
235  $data['mainpageisdomainroot'] = (bool)$config->get( 'MainPageIsDomainRoot' );
236 
237  // A logo can either be a relative or an absolute path
238  // make sure we always return an absolute path
240  $data['logo'] = wfExpandUrl( $logo['1x'], PROTO_RELATIVE );
241 
242  $data['generator'] = 'MediaWiki ' . MW_VERSION;
243 
244  $data['phpversion'] = PHP_VERSION;
245  $data['phpsapi'] = PHP_SAPI;
246  $data['dbtype'] = $config->get( 'DBtype' );
247  $data['dbversion'] = $this->getDB()->getServerVersion();
248 
249  $allowFrom = [ '' ];
250  $allowException = true;
251  if ( !$config->get( 'AllowExternalImages' ) ) {
252  $data['imagewhitelistenabled'] = (bool)$config->get( 'EnableImageWhitelist' );
253  $allowFrom = $config->get( 'AllowExternalImagesFrom' );
254  $allowException = !empty( $allowFrom );
255  }
256  if ( $allowException ) {
257  $data['externalimages'] = (array)$allowFrom;
258  ApiResult::setIndexedTagName( $data['externalimages'], 'prefix' );
259  }
260 
261  $data['langconversion'] = !$this->languageConverterFactory->isConversionDisabled();
262  $data['linkconversion'] = !$this->languageConverterFactory->isLinkConversionDisabled();
263  // For backwards compatibility (soft deprecated since MW 1.36)
264  $data['titleconversion'] = $data['linkconversion'];
265 
266  $contLangConverter = $this->languageConverterFactory->getLanguageConverter( $this->contentLanguage );
267  if ( $this->contentLanguage->linkPrefixExtension() ) {
268  $linkPrefixCharset = $this->contentLanguage->linkPrefixCharset();
269  $data['linkprefixcharset'] = $linkPrefixCharset;
270  // For backwards compatibility
271  $data['linkprefix'] = "/^((?>.*[^$linkPrefixCharset]|))(.+)$/sDu";
272  } else {
273  $data['linkprefixcharset'] = '';
274  $data['linkprefix'] = '';
275  }
276 
277  $linktrail = $this->contentLanguage->linkTrail();
278  $data['linktrail'] = $linktrail ?: '';
279 
280  $data['legaltitlechars'] = Title::legalChars();
281  $data['invalidusernamechars'] = $config->get( 'InvalidUsernameCharacters' );
282 
283  $data['allunicodefixes'] = (bool)$config->get( 'AllUnicodeFixes' );
284  $data['fixarabicunicode'] = true; // Config removed in 1.35, always true
285  $data['fixmalayalamunicode'] = true; // Config removed in 1.35, always true
286 
287  global $IP;
289  if ( $git ) {
290  $data['git-hash'] = $git;
291  $data['git-branch'] =
292  SpecialVersion::getGitCurrentBranch( $GLOBALS['IP'] );
293  }
294 
295  // 'case-insensitive' option is reserved for future
296  $data['case'] = $config->get( 'CapitalLinks' ) ? 'first-letter' : 'case-sensitive';
297  $data['lang'] = $config->get( 'LanguageCode' );
298 
299  $fallbacks = [];
300  foreach ( $this->contentLanguage->getFallbackLanguages() as $code ) {
301  $fallbacks[] = [ 'code' => $code ];
302  }
303  $data['fallback'] = $fallbacks;
304  ApiResult::setIndexedTagName( $data['fallback'], 'lang' );
305 
306  if ( $contLangConverter->hasVariants() ) {
307  $variants = [];
308  foreach ( $contLangConverter->getVariants() as $code ) {
309  $variants[] = [
310  'code' => $code,
311  'name' => $this->contentLanguage->getVariantname( $code ),
312  ];
313  }
314  $data['variants'] = $variants;
315  ApiResult::setIndexedTagName( $data['variants'], 'lang' );
316  }
317 
318  $data['rtl'] = $this->contentLanguage->isRTL();
319  $data['fallback8bitEncoding'] = $this->contentLanguage->fallback8bitEncoding();
320 
321  $data['readonly'] = $this->readOnlyMode->isReadOnly();
322  if ( $data['readonly'] ) {
323  $data['readonlyreason'] = $this->readOnlyMode->getReason();
324  }
325  $data['writeapi'] = true; // Deprecated since MW 1.32
326 
327  $data['maxarticlesize'] = $config->get( 'MaxArticleSize' ) * 1024;
328 
329  $tz = $config->get( 'Localtimezone' );
330  $offset = $config->get( 'LocalTZoffset' );
331  $data['timezone'] = $tz;
332  $data['timeoffset'] = (int)$offset;
333  $data['articlepath'] = $config->get( 'ArticlePath' );
334  $data['scriptpath'] = $config->get( 'ScriptPath' );
335  $data['script'] = $config->get( 'Script' );
336  $data['variantarticlepath'] = $config->get( 'VariantArticlePath' );
337  $data[ApiResult::META_BC_BOOLS][] = 'variantarticlepath';
338  $data['server'] = $config->get( 'Server' );
339  $data['servername'] = $config->get( 'ServerName' );
340  $data['wikiid'] = WikiMap::getCurrentWikiId();
341  $data['time'] = wfTimestamp( TS_ISO_8601, time() );
342 
343  $data['misermode'] = (bool)$config->get( 'MiserMode' );
344 
345  $data['uploadsenabled'] = UploadBase::isEnabled();
346  $data['maxuploadsize'] = UploadBase::getMaxUploadSize();
347  $data['minuploadchunksize'] = ApiUpload::getMinUploadChunkSize( $config );
348 
349  $data['galleryoptions'] = $config->get( 'GalleryOptions' );
350 
351  $data['thumblimits'] = $config->get( 'ThumbLimits' );
352  ApiResult::setArrayType( $data['thumblimits'], 'BCassoc' );
353  ApiResult::setIndexedTagName( $data['thumblimits'], 'limit' );
354  $data['imagelimits'] = [];
355  ApiResult::setArrayType( $data['imagelimits'], 'BCassoc' );
356  ApiResult::setIndexedTagName( $data['imagelimits'], 'limit' );
357  foreach ( $config->get( 'ImageLimits' ) as $k => $limit ) {
358  $data['imagelimits'][$k] = [ 'width' => $limit[0], 'height' => $limit[1] ];
359  }
360 
361  $favicon = $config->get( 'Favicon' );
362  if ( !empty( $favicon ) ) {
363  // wgFavicon can either be a relative or an absolute path
364  // make sure we always return an absolute path
365  $data['favicon'] = wfExpandUrl( $favicon, PROTO_RELATIVE );
366  }
367 
368  $data['centralidlookupprovider'] = $config->get( 'CentralIdLookupProvider' );
369  $providerIds = array_keys( $config->get( 'CentralIdLookupProviders' ) );
370  $data['allcentralidlookupproviders'] = $providerIds;
371 
372  $data['interwikimagic'] = (bool)$config->get( 'InterwikiMagic' );
373  $data['magiclinks'] = $config->get( 'EnableMagicLinks' );
374 
375  $data['categorycollation'] = $config->get( 'CategoryCollation' );
376 
377  $this->getHookRunner()->onAPIQuerySiteInfoGeneralInfo( $this, $data );
378 
379  return $this->getResult()->addValue( 'query', $property, $data );
380  }
381 
382  protected function appendNamespaces( $property ) {
383  $nsProtection = $this->getConfig()->get( 'NamespaceProtection' );
384 
385  $data = [
386  ApiResult::META_TYPE => 'assoc',
387  ];
388  foreach (
389  $this->contentLanguage->getFormattedNamespaces()
390  as $ns => $title
391  ) {
392  $data[$ns] = [
393  'id' => (int)$ns,
394  'case' => $this->namespaceInfo->isCapitalized( $ns ) ? 'first-letter' : 'case-sensitive',
395  ];
396  ApiResult::setContentValue( $data[$ns], 'name', $title );
397  $canonical = $this->namespaceInfo->getCanonicalName( $ns );
398 
399  $data[$ns]['subpages'] = $this->namespaceInfo->hasSubpages( $ns );
400 
401  if ( $canonical ) {
402  $data[$ns]['canonical'] = strtr( $canonical, '_', ' ' );
403  }
404 
405  $data[$ns]['content'] = $this->namespaceInfo->isContent( $ns );
406  $data[$ns]['nonincludable'] = $this->namespaceInfo->isNonincludable( $ns );
407 
408  if ( isset( $nsProtection[$ns] ) ) {
409  if ( is_array( $nsProtection[$ns] ) ) {
410  $specificNs = implode( "|", array_filter( $nsProtection[$ns] ) );
411  } elseif ( $nsProtection[$ns] !== '' ) {
412  $specificNs = $nsProtection[$ns];
413  }
414  if ( isset( $specificNs ) && $specificNs !== '' ) {
415  $data[$ns]['namespaceprotection'] = $specificNs;
416  }
417  }
418 
419  $contentmodel = $this->namespaceInfo->getNamespaceContentModel( $ns );
420  if ( $contentmodel ) {
421  $data[$ns]['defaultcontentmodel'] = $contentmodel;
422  }
423  }
424 
425  ApiResult::setArrayType( $data, 'assoc' );
426  ApiResult::setIndexedTagName( $data, 'ns' );
427 
428  return $this->getResult()->addValue( 'query', $property, $data );
429  }
430 
431  protected function appendNamespaceAliases( $property ) {
432  $aliases = $this->contentLanguage->getNamespaceAliases();
433  $namespaces = $this->contentLanguage->getNamespaces();
434  $data = [];
435  foreach ( $aliases as $title => $ns ) {
436  if ( $namespaces[$ns] == $title ) {
437  // Don't list duplicates
438  continue;
439  }
440  $item = [
441  'id' => (int)$ns
442  ];
443  ApiResult::setContentValue( $item, 'alias', strtr( $title, '_', ' ' ) );
444  $data[] = $item;
445  }
446 
447  sort( $data );
448 
449  ApiResult::setIndexedTagName( $data, 'ns' );
450 
451  return $this->getResult()->addValue( 'query', $property, $data );
452  }
453 
454  protected function appendSpecialPageAliases( $property ) {
455  $data = [];
456  $aliases = $this->contentLanguage->getSpecialPageAliases();
457  foreach ( $this->specialPageFactory->getNames() as $specialpage ) {
458  if ( isset( $aliases[$specialpage] ) ) {
459  $arr = [ 'realname' => $specialpage, 'aliases' => $aliases[$specialpage] ];
460  ApiResult::setIndexedTagName( $arr['aliases'], 'alias' );
461  $data[] = $arr;
462  }
463  }
464  ApiResult::setIndexedTagName( $data, 'specialpage' );
465 
466  return $this->getResult()->addValue( 'query', $property, $data );
467  }
468 
469  protected function appendMagicWords( $property ) {
470  $data = [];
471  foreach (
472  $this->contentLanguage->getMagicWords()
473  as $magicword => $aliases
474  ) {
475  $caseSensitive = array_shift( $aliases );
476  $arr = [ 'name' => $magicword, 'aliases' => $aliases ];
477  $arr['case-sensitive'] = (bool)$caseSensitive;
478  ApiResult::setIndexedTagName( $arr['aliases'], 'alias' );
479  $data[] = $arr;
480  }
481  ApiResult::setIndexedTagName( $data, 'magicword' );
482 
483  return $this->getResult()->addValue( 'query', $property, $data );
484  }
485 
486  protected function appendInterwikiMap( $property, $filter ) {
487  if ( $filter === 'local' ) {
488  $local = 1;
489  } elseif ( $filter === '!local' ) {
490  $local = 0;
491  } else {
492  // $filter === null
493  $local = null;
494  }
495 
496  $params = $this->extractRequestParams();
497  $langCode = $params['inlanguagecode'] ?? '';
498  $interwikiMagic = $this->getConfig()->get( 'InterwikiMagic' );
499 
500  if ( $interwikiMagic ) {
501  $langNames = $this->languageNameUtils->getLanguageNames( $langCode );
502  }
503 
504  $getPrefixes = $this->interwikiLookup->getAllPrefixes( $local );
505  $extraLangPrefixes = $this->getConfig()->get( 'ExtraInterlanguageLinkPrefixes' );
506  $localInterwikis = $this->getConfig()->get( 'LocalInterwikis' );
507  $data = [];
508 
509  foreach ( $getPrefixes as $row ) {
510  $prefix = $row['iw_prefix'];
511  $val = [];
512  $val['prefix'] = $prefix;
513  if ( isset( $row['iw_local'] ) && $row['iw_local'] == '1' ) {
514  $val['local'] = true;
515  }
516  if ( isset( $row['iw_trans'] ) && $row['iw_trans'] == '1' ) {
517  $val['trans'] = true;
518  }
519 
520  if ( $interwikiMagic && isset( $langNames[$prefix] ) ) {
521  $val['language'] = $langNames[$prefix];
522  }
523  if ( in_array( $prefix, $localInterwikis ) ) {
524  $val['localinterwiki'] = true;
525  }
526  if ( $interwikiMagic && in_array( $prefix, $extraLangPrefixes ) ) {
527  $val['extralanglink'] = true;
528 
529  $linktext = wfMessage( "interlanguage-link-$prefix" );
530  if ( !$linktext->isDisabled() ) {
531  $val['linktext'] = $linktext->text();
532  }
533 
534  $sitename = wfMessage( "interlanguage-link-sitename-$prefix" );
535  if ( !$sitename->isDisabled() ) {
536  $val['sitename'] = $sitename->text();
537  }
538  }
539 
540  $val['url'] = wfExpandUrl( $row['iw_url'], PROTO_CURRENT );
541  $val['protorel'] = substr( $row['iw_url'], 0, 2 ) == '//';
542  if ( isset( $row['iw_wikiid'] ) && $row['iw_wikiid'] !== '' ) {
543  $val['wikiid'] = $row['iw_wikiid'];
544  }
545  if ( isset( $row['iw_api'] ) && $row['iw_api'] !== '' ) {
546  $val['api'] = $row['iw_api'];
547  }
548 
549  $data[] = $val;
550  }
551 
552  ApiResult::setIndexedTagName( $data, 'iw' );
553 
554  return $this->getResult()->addValue( 'query', $property, $data );
555  }
556 
557  protected function appendDbReplLagInfo( $property, $includeAll ) {
558  $data = [];
559  $showHostnames = $this->getConfig()->get( 'ShowHostnames' );
560  if ( $includeAll ) {
561  if ( !$showHostnames ) {
562  $this->dieWithError( 'apierror-siteinfo-includealldenied', 'includeAllDenied' );
563  }
564 
565  $lags = $this->loadBalancer->getLagTimes();
566  foreach ( $lags as $i => $lag ) {
567  $data[] = [
568  'host' => $this->loadBalancer->getServerName( $i ),
569  'lag' => $lag
570  ];
571  }
572  } else {
573  list( , $lag, $index ) = $this->loadBalancer->getMaxLag();
574  $data[] = [
575  'host' => $showHostnames
576  ? $this->loadBalancer->getServerName( $index )
577  : '',
578  'lag' => $lag
579  ];
580  }
581 
582  ApiResult::setIndexedTagName( $data, 'db' );
583 
584  return $this->getResult()->addValue( 'query', $property, $data );
585  }
586 
587  protected function appendStatistics( $property ) {
588  $data = [];
589  $data['pages'] = (int)SiteStats::pages();
590  $data['articles'] = (int)SiteStats::articles();
591  $data['edits'] = (int)SiteStats::edits();
592  $data['images'] = (int)SiteStats::images();
593  $data['users'] = (int)SiteStats::users();
594  $data['activeusers'] = (int)SiteStats::activeUsers();
595  $data['admins'] = (int)SiteStats::numberingroup( 'sysop' );
596  $data['jobs'] = (int)SiteStats::jobs();
597 
598  $this->getHookRunner()->onAPIQuerySiteInfoStatisticsInfo( $data );
599 
600  return $this->getResult()->addValue( 'query', $property, $data );
601  }
602 
603  protected function appendUserGroups( $property, $numberInGroup ) {
604  $config = $this->getConfig();
605 
606  $data = [];
607  $result = $this->getResult();
608  $allGroups = array_values( $this->userGroupManager->listAllGroups() );
609  foreach ( $config->get( 'GroupPermissions' ) as $group => $permissions ) {
610  $arr = [
611  'name' => $group,
612  'rights' => array_keys( $permissions, true ),
613  ];
614 
615  if ( $numberInGroup ) {
616  $autopromote = $config->get( 'Autopromote' );
617 
618  if ( $group == 'user' ) {
619  $arr['number'] = SiteStats::users();
620  // '*' and autopromote groups have no size
621  } elseif ( $group !== '*' && !isset( $autopromote[$group] ) ) {
622  $arr['number'] = SiteStats::numberingroup( $group );
623  }
624  }
625 
626  $groupArr = [
627  'add' => $config->get( 'AddGroups' ),
628  'remove' => $config->get( 'RemoveGroups' ),
629  'add-self' => $config->get( 'GroupsAddToSelf' ),
630  'remove-self' => $config->get( 'GroupsRemoveFromSelf' )
631  ];
632 
633  foreach ( $groupArr as $type => $rights ) {
634  if ( isset( $rights[$group] ) ) {
635  if ( $rights[$group] === true ) {
636  $groups = $allGroups;
637  } else {
638  $groups = array_intersect( $rights[$group], $allGroups );
639  }
640  if ( $groups ) {
641  $arr[$type] = $groups;
642  ApiResult::setArrayType( $arr[$type], 'BCarray' );
643  ApiResult::setIndexedTagName( $arr[$type], 'group' );
644  }
645  }
646  }
647 
648  ApiResult::setIndexedTagName( $arr['rights'], 'permission' );
649  $data[] = $arr;
650  }
651 
652  ApiResult::setIndexedTagName( $data, 'group' );
653 
654  return $result->addValue( 'query', $property, $data );
655  }
656 
657  protected function appendFileExtensions( $property ) {
658  $data = [];
659  foreach ( array_unique( $this->getConfig()->get( 'FileExtensions' ) ) as $ext ) {
660  $data[] = [ 'ext' => $ext ];
661  }
662  ApiResult::setIndexedTagName( $data, 'fe' );
663 
664  return $this->getResult()->addValue( 'query', $property, $data );
665  }
666 
667  protected function appendInstalledLibraries( $property ) {
668  global $IP;
669  $path = "$IP/vendor/composer/installed.json";
670  if ( !file_exists( $path ) ) {
671  return true;
672  }
673 
674  $data = [];
675  $installed = new ComposerInstalled( $path );
676  foreach ( $installed->getInstalledDependencies() as $name => $info ) {
677  if ( strpos( $info['type'], 'mediawiki-' ) === 0 ) {
678  // Skip any extensions or skins since they'll be listed
679  // in their proper section
680  continue;
681  }
682  $data[] = [
683  'name' => $name,
684  'version' => $info['version'],
685  ];
686  }
687  ApiResult::setIndexedTagName( $data, 'library' );
688 
689  return $this->getResult()->addValue( 'query', $property, $data );
690  }
691 
692  protected function appendExtensions( $property ) {
693  $data = [];
694  $credits = SpecialVersion::getCredits(
696  $this->getConfig()
697  );
698  foreach ( $credits as $type => $extensions ) {
699  foreach ( $extensions as $ext ) {
700  $ret = [];
701  $ret['type'] = $type;
702  if ( isset( $ext['name'] ) ) {
703  $ret['name'] = $ext['name'];
704  }
705  if ( isset( $ext['namemsg'] ) ) {
706  $ret['namemsg'] = $ext['namemsg'];
707  }
708  if ( isset( $ext['description'] ) ) {
709  $ret['description'] = $ext['description'];
710  }
711  if ( isset( $ext['descriptionmsg'] ) ) {
712  // Can be a string or [ key, param1, param2, ... ]
713  if ( is_array( $ext['descriptionmsg'] ) ) {
714  $ret['descriptionmsg'] = $ext['descriptionmsg'][0];
715  $ret['descriptionmsgparams'] = array_slice( $ext['descriptionmsg'], 1 );
716  ApiResult::setIndexedTagName( $ret['descriptionmsgparams'], 'param' );
717  } else {
718  $ret['descriptionmsg'] = $ext['descriptionmsg'];
719  }
720  }
721  if ( isset( $ext['author'] ) ) {
722  $ret['author'] = is_array( $ext['author'] ) ?
723  implode( ', ', $ext['author'] ) : $ext['author'];
724  }
725  if ( isset( $ext['url'] ) ) {
726  $ret['url'] = $ext['url'];
727  }
728  if ( isset( $ext['version'] ) ) {
729  $ret['version'] = $ext['version'];
730  }
731  if ( isset( $ext['path'] ) ) {
732  $extensionPath = dirname( $ext['path'] );
733  $gitInfo = new GitInfo( $extensionPath );
734  $vcsVersion = $gitInfo->getHeadSHA1();
735  if ( $vcsVersion !== false ) {
736  $ret['vcs-system'] = 'git';
737  $ret['vcs-version'] = $vcsVersion;
738  $ret['vcs-url'] = $gitInfo->getHeadViewUrl();
739  $vcsDate = $gitInfo->getHeadCommitDate();
740  if ( $vcsDate !== false ) {
741  $ret['vcs-date'] = wfTimestamp( TS_ISO_8601, $vcsDate );
742  }
743  }
744 
745  if ( ExtensionInfo::getLicenseFileNames( $extensionPath ) ) {
746  $ret['license-name'] = $ext['license-name'] ?? '';
747  $ret['license'] = SpecialPage::getTitleFor(
748  'Version',
749  "License/{$ext['name']}"
750  )->getLinkURL();
751  }
752 
753  if ( ExtensionInfo::getAuthorsFileName( $extensionPath ) ) {
754  $ret['credits'] = SpecialPage::getTitleFor(
755  'Version',
756  "Credits/{$ext['name']}"
757  )->getLinkURL();
758  }
759  }
760  $data[] = $ret;
761  }
762  }
763 
764  ApiResult::setIndexedTagName( $data, 'ext' );
765 
766  return $this->getResult()->addValue( 'query', $property, $data );
767  }
768 
769  protected function appendRightsInfo( $property ) {
770  $config = $this->getConfig();
771  $rightsPage = $config->get( 'RightsPage' );
772  if ( is_string( $rightsPage ) ) {
773  $title = Title::newFromText( $rightsPage );
774  $url = wfExpandUrl( $title, PROTO_CURRENT );
775  } else {
776  $title = false;
777  $url = $config->get( 'RightsUrl' );
778  }
779  $text = $config->get( 'RightsText' );
780  if ( $title && !strlen( $text ) ) {
781  $text = $title->getPrefixedText();
782  }
783 
784  $data = [
785  'url' => (string)$url,
786  'text' => (string)$text,
787  ];
788 
789  return $this->getResult()->addValue( 'query', $property, $data );
790  }
791 
792  protected function appendRestrictions( $property ) {
793  $config = $this->getConfig();
794  $data = [
795  'types' => $config->get( 'RestrictionTypes' ),
796  'levels' => $config->get( 'RestrictionLevels' ),
797  'cascadinglevels' => $config->get( 'CascadingRestrictionLevels' ),
798  'semiprotectedlevels' => $config->get( 'SemiprotectedRestrictionLevels' ),
799  ];
800 
801  ApiResult::setArrayType( $data['types'], 'BCarray' );
802  ApiResult::setArrayType( $data['levels'], 'BCarray' );
803  ApiResult::setArrayType( $data['cascadinglevels'], 'BCarray' );
804  ApiResult::setArrayType( $data['semiprotectedlevels'], 'BCarray' );
805 
806  ApiResult::setIndexedTagName( $data['types'], 'type' );
807  ApiResult::setIndexedTagName( $data['levels'], 'level' );
808  ApiResult::setIndexedTagName( $data['cascadinglevels'], 'level' );
809  ApiResult::setIndexedTagName( $data['semiprotectedlevels'], 'level' );
810 
811  return $this->getResult()->addValue( 'query', $property, $data );
812  }
813 
814  public function appendLanguages( $property ) {
815  $params = $this->extractRequestParams();
816  $langCode = $params['inlanguagecode'] ?? '';
817  $langNames = $this->languageNameUtils->getLanguageNames( $langCode );
818 
819  $data = [];
820 
821  foreach ( $langNames as $code => $name ) {
822  $lang = [
823  'code' => $code,
824  'bcp47' => LanguageCode::bcp47( $code ),
825  ];
826  ApiResult::setContentValue( $lang, 'name', $name );
827  $data[] = $lang;
828  }
829  ApiResult::setIndexedTagName( $data, 'lang' );
830 
831  return $this->getResult()->addValue( 'query', $property, $data );
832  }
833 
834  // Export information about which page languages will trigger
835  // language conversion. (T153341)
836  public function appendLanguageVariants( $property ) {
838  if ( $this->languageConverterFactory->isConversionDisabled() ) {
839  // Ensure result is empty if language conversion is disabled.
840  $langNames = [];
841  }
842  sort( $langNames );
843 
844  $data = [];
845  foreach ( $langNames as $langCode ) {
846  $lang = $this->languageFactory->getLanguage( $langCode );
847  $langConverter = $this->languageConverterFactory->getLanguageConverter( $lang );
848  if ( !$langConverter->hasVariants() ) {
849  // Only languages which have variants should be listed
850  continue;
851  }
852  $data[$langCode] = [];
853  ApiResult::setIndexedTagName( $data[$langCode], 'variant' );
854  ApiResult::setArrayType( $data[$langCode], 'kvp', 'code' );
855 
856  $variants = $langConverter->getVariants();
857  sort( $variants );
858  foreach ( $variants as $v ) {
859  $fallbacks = $langConverter->getVariantFallbacks( $v );
860  if ( !is_array( $fallbacks ) ) {
861  $fallbacks = [ $fallbacks ];
862  }
863  $data[$langCode][$v] = [
864  'fallbacks' => $fallbacks,
865  ];
867  $data[$langCode][$v]['fallbacks'], 'variant'
868  );
869  }
870  }
871  ApiResult::setIndexedTagName( $data, 'lang' );
872  ApiResult::setArrayType( $data, 'kvp', 'code' );
873 
874  return $this->getResult()->addValue( 'query', $property, $data );
875  }
876 
877  public function appendSkins( $property ) {
878  $data = [];
879  $allowed = $this->skinFactory->getAllowedSkins();
880  $default = Skin::normalizeKey( 'default' );
881  $skinNames = $this->skinFactory->getInstalledSkins();
882 
883  foreach ( $skinNames as $name => $displayName ) {
884  $msg = $this->msg( "skinname-{$name}" );
885  $code = $this->getParameter( 'inlanguagecode' );
886  if ( $code && $this->languageNameUtils->isValidCode( $code ) ) {
887  $msg->inLanguage( $code );
888  } else {
889  $msg->inContentLanguage();
890  }
891  if ( $msg->exists() ) {
892  $displayName = $msg->text();
893  }
894  $skin = [ 'code' => $name ];
895  ApiResult::setContentValue( $skin, 'name', $displayName );
896  if ( !isset( $allowed[$name] ) ) {
897  $skin['unusable'] = true;
898  }
899  if ( $name === $default ) {
900  $skin['default'] = true;
901  }
902  $data[] = $skin;
903  }
904  ApiResult::setIndexedTagName( $data, 'skin' );
905 
906  return $this->getResult()->addValue( 'query', $property, $data );
907  }
908 
909  public function appendExtensionTags( $property ) {
910  $tags = array_map(
911  static function ( $item ) {
912  return "<$item>";
913  },
914  $this->parser->getTags()
915  );
916  ApiResult::setArrayType( $tags, 'BCarray' );
917  ApiResult::setIndexedTagName( $tags, 't' );
918 
919  return $this->getResult()->addValue( 'query', $property, $tags );
920  }
921 
922  public function appendFunctionHooks( $property ) {
923  $hooks = $this->parser->getFunctionHooks();
924  ApiResult::setArrayType( $hooks, 'BCarray' );
925  ApiResult::setIndexedTagName( $hooks, 'h' );
926 
927  return $this->getResult()->addValue( 'query', $property, $hooks );
928  }
929 
930  public function appendVariables( $property ) {
931  $variables = $this->magicWordFactory->getVariableIDs();
932  ApiResult::setArrayType( $variables, 'BCarray' );
933  ApiResult::setIndexedTagName( $variables, 'v' );
934 
935  return $this->getResult()->addValue( 'query', $property, $variables );
936  }
937 
938  public function appendProtocols( $property ) {
939  // Make a copy of the global so we don't try to set the _element key of it - T47130
940  $protocols = array_values( $this->getConfig()->get( 'UrlProtocols' ) );
941  ApiResult::setArrayType( $protocols, 'BCarray' );
942  ApiResult::setIndexedTagName( $protocols, 'p' );
943 
944  return $this->getResult()->addValue( 'query', $property, $protocols );
945  }
946 
947  public function appendDefaultOptions( $property ) {
948  $options = $this->userOptionsLookup->getDefaultOptions();
949  $options[ApiResult::META_BC_BOOLS] = array_keys( $options );
950  return $this->getResult()->addValue( 'query', $property, $options );
951  }
952 
953  public function appendUploadDialog( $property ) {
954  $config = $this->getConfig()->get( 'UploadDialog' );
955  return $this->getResult()->addValue( 'query', $property, $config );
956  }
957 
958  public function appendSubscribedHooks( $property ) {
959  $hooks = $this->getConfig()->get( 'Hooks' );
960  $myWgHooks = $hooks;
961  ksort( $myWgHooks );
962 
963  $data = [];
964  foreach ( $myWgHooks as $name => $subscribers ) {
965  $arr = [
966  'name' => $name,
967  'subscribers' => array_map( [ SpecialVersion::class, 'arrayToString' ], $subscribers ),
968  ];
969 
970  ApiResult::setArrayType( $arr['subscribers'], 'array' );
971  ApiResult::setIndexedTagName( $arr['subscribers'], 's' );
972  $data[] = $arr;
973  }
974 
975  ApiResult::setIndexedTagName( $data, 'hook' );
976 
977  return $this->getResult()->addValue( 'query', $property, $data );
978  }
979 
980  public function getCacheMode( $params ) {
981  // Messages for $wgExtraInterlanguageLinkPrefixes depend on user language
982  if (
983  count( $this->getConfig()->get( 'ExtraInterlanguageLinkPrefixes' ) ) &&
984  $params['prop'] !== null &&
985  in_array( 'interwikimap', $params['prop'] )
986  ) {
987  return 'anon-public-user-private';
988  }
989 
990  return 'public';
991  }
992 
993  public function getAllowedParams() {
994  return [
995  'prop' => [
996  ApiBase::PARAM_DFLT => 'general',
997  ApiBase::PARAM_ISMULTI => true,
999  'general',
1000  'namespaces',
1001  'namespacealiases',
1002  'specialpagealiases',
1003  'magicwords',
1004  'interwikimap',
1005  'dbrepllag',
1006  'statistics',
1007  'usergroups',
1008  'libraries',
1009  'extensions',
1010  'fileextensions',
1011  'rightsinfo',
1012  'restrictions',
1013  'languages',
1014  'languagevariants',
1015  'skins',
1016  'extensiontags',
1017  'functionhooks',
1018  'showhooks',
1019  'variables',
1020  'protocols',
1021  'defaultoptions',
1022  'uploaddialog',
1023  ],
1025  ],
1026  'filteriw' => [
1027  ApiBase::PARAM_TYPE => [
1028  'local',
1029  '!local',
1030  ]
1031  ],
1032  'showalldb' => false,
1033  'numberingroup' => false,
1034  'inlanguagecode' => null,
1035  ];
1036  }
1037 
1038  protected function getExamplesMessages() {
1039  return [
1040  'action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics'
1041  => 'apihelp-query+siteinfo-example-simple',
1042  'action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local'
1043  => 'apihelp-query+siteinfo-example-interwiki',
1044  'action=query&meta=siteinfo&siprop=dbrepllag&sishowalldb='
1045  => 'apihelp-query+siteinfo-example-replag',
1046  ];
1047  }
1048 
1049  public function getHelpUrls() {
1050  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Siteinfo';
1051  }
1052 }
SiteStats\articles
static articles()
Definition: SiteStats.php:103
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:72
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:383
ApiQuery
This is the main query class.
Definition: ApiQuery.php:37
ApiQuerySiteinfo\appendProtocols
appendProtocols( $property)
Definition: ApiQuerySiteinfo.php:938
ApiQuerySiteinfo\$specialPageFactory
SpecialPageFactory $specialPageFactory
Definition: ApiQuerySiteinfo.php:71
SiteStats\users
static users()
Definition: SiteStats.php:121
MagicWordFactory
A factory that stores information about MagicWords, and creates them on demand with caching.
Definition: MagicWordFactory.php:37
ApiQuerySiteinfo\$languageConverterFactory
LanguageConverterFactory $languageConverterFactory
Definition: ApiQuerySiteinfo.php:47
SiteStats\activeUsers
static activeUsers()
Definition: SiteStats.php:130
ApiQuerySiteinfo\appendInterwikiMap
appendInterwikiMap( $property, $filter)
Definition: ApiQuerySiteinfo.php:486
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:37
ApiResult\META_TYPE
const META_TYPE
Key for the 'type' metadata item.
Definition: ApiResult.php:110
ApiQuerySiteinfo\$languageFactory
LanguageFactory $languageFactory
Definition: ApiQuerySiteinfo.php:50
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1379
ApiQuerySiteinfo\appendFileExtensions
appendFileExtensions( $property)
Definition: ApiQuerySiteinfo.php:657
MediaWiki\Languages\LanguageFactory
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition: LanguageFactory.php:42
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1668
UploadBase\isEnabled
static isEnabled()
Returns true if uploads are enabled.
Definition: UploadBase.php:143
ApiBase\PARAM_TYPE
const PARAM_TYPE
Definition: ApiBase.php:72
MediaWiki\SpecialPage\SpecialPageFactory
Factory for handling the special page list and generating SpecialPage objects.
Definition: SpecialPageFactory.php:63
ReadOnlyMode
A service class for fetching the wiki's current read-only mode.
Definition: ReadOnlyMode.php:11
SiteStats\pages
static pages()
Definition: SiteStats.php:112
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:571
MW_VERSION
const MW_VERSION
The running version of MediaWiki.
Definition: Defines.php:36
SiteStats\numberingroup
static numberingroup( $group)
Find the number of users in a given user group.
Definition: SiteStats.php:150
ApiQuerySiteinfo\appendNamespaceAliases
appendNamespaceAliases( $property)
Definition: ApiQuerySiteinfo.php:431
ApiQuerySiteinfo\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: ApiQuerySiteinfo.php:135
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition: GlobalFunctions.php:1186
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Definition: SpecialPage.php:107
Title\newMainPage
static newMainPage(MessageLocalizer $localizer=null)
Create a new Title for the Main Page.
Definition: Title.php:713
ApiQuerySiteinfo\appendVariables
appendVariables( $property)
Definition: ApiQuerySiteinfo.php:930
WikiMap\getCurrentWikiId
static getCurrentWikiId()
Definition: WikiMap.php:303
ApiQuerySiteinfo\appendExtensionTags
appendExtensionTags( $property)
Definition: ApiQuerySiteinfo.php:909
MediaWiki\Languages\LanguageConverterFactory
An interface for creating language converters.
Definition: LanguageConverterFactory.php:46
ApiQuerySiteinfo\appendRightsInfo
appendRightsInfo( $property)
Definition: ApiQuerySiteinfo.php:769
MediaWiki\Languages\LanguageNameUtils
A service that provides utilities to do with language names and codes.
Definition: LanguageNameUtils.php:42
SiteStats\images
static images()
Definition: SiteStats.php:139
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
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:134
ApiQuerySiteinfo\appendDbReplLagInfo
appendDbReplLagInfo( $property, $includeAll)
Definition: ApiQuerySiteinfo.php:557
ApiQuerySiteinfo
A query action to return meta information about the wiki site.
Definition: ApiQuerySiteinfo.php:38
ApiQuerySiteinfo\appendLanguageVariants
appendLanguageVariants( $property)
Definition: ApiQuerySiteinfo.php:836
MediaWiki\User\UserGroupManager
Managers user groups.
Definition: UserGroupManager.php:52
PROTO_RELATIVE
const PROTO_RELATIVE
Definition: Defines.php:194
ApiResult\setArrayType
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
Definition: ApiResult.php:715
ApiQuerySiteinfo\__construct
__construct(ApiQuery $query, $moduleName, UserOptionsLookup $userOptionsLookup, UserGroupManager $userGroupManager, LanguageConverterFactory $languageConverterFactory, LanguageFactory $languageFactory, LanguageNameUtils $languageNameUtils, Language $contentLanguage, NamespaceInfo $namespaceInfo, InterwikiLookup $interwikiLookup, Parser $parser, MagicWordFactory $magicWordFactory, SpecialPageFactory $specialPageFactory, SkinFactory $skinFactory, ILoadBalancer $loadBalancer, ReadOnlyMode $readOnlyMode)
Definition: ApiQuerySiteinfo.php:100
Skin\normalizeKey
static normalizeKey( $key)
Normalize a skin preference value to a form that can be loaded.
Definition: Skin.php:99
ApiQuerySiteinfo\appendFunctionHooks
appendFunctionHooks( $property)
Definition: ApiQuerySiteinfo.php:922
ApiQuerySiteinfo\appendDefaultOptions
appendDefaultOptions( $property)
Definition: ApiQuerySiteinfo.php:947
ApiQueryBase
This is a base class for all Query modules.
Definition: ApiQueryBase.php:37
ApiQuerySiteinfo\$readOnlyMode
ReadOnlyMode $readOnlyMode
Definition: ApiQuerySiteinfo.php:80
ApiUpload\getMinUploadChunkSize
static getMinUploadChunkSize(Config $config)
Definition: ApiUpload.php:210
MediaWiki\Interwiki\InterwikiLookup
Service interface for looking up Interwiki records.
Definition: InterwikiLookup.php:32
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:117
ApiQuerySiteinfo\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQuerySiteinfo.php:1038
ApiResult\META_BC_BOOLS
const META_BC_BOOLS
Key for the 'BC bools' metadata item.
Definition: ApiResult.php:136
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:707
ApiQuerySiteinfo\$namespaceInfo
NamespaceInfo $namespaceInfo
Definition: ApiQuerySiteinfo.php:59
$title
$title
Definition: testCompression.php:38
ApiQuerySiteinfo\$skinFactory
SkinFactory $skinFactory
Definition: ApiQuerySiteinfo.php:74
ApiQuerySiteinfo\$userOptionsLookup
UserOptionsLookup $userOptionsLookup
Definition: ApiQuerySiteinfo.php:41
ResourceLoaderSkinModule\getAvailableLogos
static getAvailableLogos( $conf)
Return an array of all available logos that a skin may use.
Definition: ResourceLoaderSkinModule.php:563
ApiQuerySiteinfo\appendUploadDialog
appendUploadDialog( $property)
Definition: ApiQuerySiteinfo.php:953
PROTO_CURRENT
const PROTO_CURRENT
Definition: Defines.php:195
ContextSource\msg
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:197
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:603
GitInfo
@newable
Definition: GitInfo.php:34
SpecialVersion\getGitCurrentBranch
static getGitCurrentBranch( $dir)
Definition: SpecialVersion.php:1206
SpecialVersion\getCredits
static getCredits(ExtensionRegistry $reg, Config $conf)
Definition: SpecialVersion.php:68
ApiQuerySiteinfo\$parser
Parser $parser
Definition: ApiQuerySiteinfo.php:65
SkinFactory
Factory class to create Skin objects.
Definition: SkinFactory.php:31
ApiQuerySiteinfo\appendExtensions
appendExtensions( $property)
Definition: ApiQuerySiteinfo.php:692
SiteStats\jobs
static jobs()
Total number of jobs in the job queue.
Definition: SiteStats.php:179
$linkPrefixCharset
$linkPrefixCharset
Definition: MessagesAr.php:471
SpecialVersion\getGitHeadSha1
static getGitHeadSha1( $dir)
Definition: SpecialVersion.php:1196
ApiQuerySiteinfo\$magicWordFactory
MagicWordFactory $magicWordFactory
Definition: ApiQuerySiteinfo.php:68
Parser
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Definition: Parser.php:91
MediaWiki\User\UserOptionsLookup
Provides access to user options.
Definition: UserOptionsLookup.php:29
ApiQuerySiteinfo\$interwikiLookup
InterwikiLookup $interwikiLookup
Definition: ApiQuerySiteinfo.php:62
UploadBase\getMaxUploadSize
static getMaxUploadSize( $forType=null)
Get MediaWiki's maximum uploaded file size for given type of upload, based on $wgMaxUploadSize.
Definition: UploadBase.php:2206
ApiQuerySiteinfo\appendLanguages
appendLanguages( $property)
Definition: ApiQuerySiteinfo.php:814
LanguageConverter\$languagesWithVariants
static array $languagesWithVariants
languages supporting variants
Definition: LanguageConverter.php:44
ApiQuerySiteinfo\appendSkins
appendSkins( $property)
Definition: ApiQuerySiteinfo.php:877
ApiQuerySiteinfo\appendUserGroups
appendUserGroups( $property, $numberInGroup)
Definition: ApiQuerySiteinfo.php:603
ApiQuerySiteinfo\$userGroupManager
UserGroupManager $userGroupManager
Definition: ApiQuerySiteinfo.php:44
$path
$path
Definition: NoLocalSettings.php:25
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
LanguageCode\bcp47
static bcp47( $code)
Get the normalised IETF language tag See unit test for examples.
Definition: LanguageCode.php:175
ApiQuerySiteinfo\appendMagicWords
appendMagicWords( $property)
Definition: ApiQuerySiteinfo.php:469
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
Definition: ApiBase.php:71
ApiQuerySiteinfo\appendStatistics
appendStatistics( $property)
Definition: ApiQuerySiteinfo.php:587
$ext
if(!is_readable( $file)) $ext
Definition: router.php:48
ApiQuerySiteinfo\getCacheMode
getCacheMode( $params)
Get the cache mode for the data generated by this module.
Definition: ApiQuerySiteinfo.php:980
ApiQuerySiteinfo\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQuerySiteinfo.php:1049
ApiQuerySiteinfo\appendRestrictions
appendRestrictions( $property)
Definition: ApiQuerySiteinfo.php:792
ApiQuerySiteinfo\appendGeneralInfo
appendGeneralInfo( $property)
Definition: ApiQuerySiteinfo.php:227
NamespaceInfo
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Definition: NamespaceInfo.php:35
ApiQuerySiteinfo\$loadBalancer
ILoadBalancer $loadBalancer
Definition: ApiQuerySiteinfo.php:77
Title\legalChars
static legalChars()
Get a regex character class describing the legal characters in a link.
Definition: Title.php:737
ApiQueryBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Set a query-continue value.
Definition: ApiQueryBase.php:515
ApiBase\PARAM_HELP_MSG_PER_VALUE
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
Definition: ApiBase.php:138
ApiBase\getHookRunner
getHookRunner()
Get an ApiHookRunner for running core API hooks.
Definition: ApiBase.php:653
$IP
$IP
Definition: WebStart.php:49
ApiQuerySiteinfo\$languageNameUtils
LanguageNameUtils $languageNameUtils
Definition: ApiQuerySiteinfo.php:53
ApiQuerySiteinfo\$contentLanguage
Language $contentLanguage
Definition: ApiQuerySiteinfo.php:56
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:1582
MediaWiki\ExtensionInfo
Definition: ExtensionInfo.php:8
ComposerInstalled
Reads an installed.json file and provides accessors to get what is installed.
Definition: ComposerInstalled.php:9
SiteStats\edits
static edits()
Definition: SiteStats.php:94
Language
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition: Language.php:42
Wikimedia\Rdbms\ILoadBalancer
Database cluster connection, tracking, load balancing, and transaction manager interface.
Definition: ILoadBalancer.php:81
ApiQuerySiteinfo\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQuerySiteinfo.php:993
wfExpandUrl
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Definition: GlobalFunctions.php:474
ApiQuerySiteinfo\appendInstalledLibraries
appendInstalledLibraries( $property)
Definition: ApiQuerySiteinfo.php:667
ApiQuerySiteinfo\appendSubscribedHooks
appendSubscribedHooks( $property)
Definition: ApiQuerySiteinfo.php:958
ApiQuerySiteinfo\appendSpecialPageAliases
appendSpecialPageAliases( $property)
Definition: ApiQuerySiteinfo.php:454
$type
$type
Definition: testCompression.php:52
ApiQuerySiteinfo\appendNamespaces
appendNamespaces( $property)
Definition: ApiQuerySiteinfo.php:382