118 parent::__construct( $query, $moduleName,
'si' );
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;
139 foreach ( $params[
'prop'] as $p ) {
147 case 'namespacealiases':
150 case 'specialpagealiases':
174 case 'fileextensions':
186 case 'languagevariants':
192 case 'extensiontags':
195 case 'functionhooks':
207 case 'defaultoptions':
220 array_diff( $params[
'prop'], $done ) ) );
231 $mainPage = Title::newMainPage();
232 $data[
'mainpage'] = $mainPage->getPrefixedText();
234 $data[
'sitename'] = $config->get(
'Sitename' );
235 $data[
'mainpageisdomainroot'] = (bool)$config->get(
'MainPageIsDomainRoot' );
242 $data[
'generator'] =
'MediaWiki ' .
MW_VERSION;
244 $data[
'phpversion'] = PHP_VERSION;
245 $data[
'phpsapi'] = PHP_SAPI;
246 $data[
'dbtype'] = $config->get(
'DBtype' );
247 $data[
'dbversion'] = $this->
getDB()->getServerVersion();
250 $allowException =
true;
251 if ( !$config->get(
'AllowExternalImages' ) ) {
252 $data[
'imagewhitelistenabled'] = (bool)$config->get(
'EnableImageWhitelist' );
253 $allowFrom = $config->get(
'AllowExternalImagesFrom' );
254 $allowException = !empty( $allowFrom );
256 if ( $allowException ) {
257 $data[
'externalimages'] = (array)$allowFrom;
258 ApiResult::setIndexedTagName( $data[
'externalimages'],
'prefix' );
261 $data[
'langconversion'] = !$this->languageConverterFactory->isConversionDisabled();
262 $data[
'linkconversion'] = !$this->languageConverterFactory->isLinkConversionDisabled();
264 $data[
'titleconversion'] = $data[
'linkconversion'];
266 $contLangConverter = $this->languageConverterFactory->getLanguageConverter( $this->contentLanguage );
267 if ( $this->contentLanguage->linkPrefixExtension() ) {
271 $data[
'linkprefix'] =
"/^((?>.*[^$linkPrefixCharset]|))(.+)$/sDu";
273 $data[
'linkprefixcharset'] =
'';
274 $data[
'linkprefix'] =
'';
277 $linktrail = $this->contentLanguage->linkTrail();
278 $data[
'linktrail'] = $linktrail ?:
'';
280 $data[
'legaltitlechars'] = Title::legalChars();
281 $data[
'invalidusernamechars'] = $config->get(
'InvalidUsernameCharacters' );
283 $data[
'allunicodefixes'] = (bool)$config->get(
'AllUnicodeFixes' );
284 $data[
'fixarabicunicode'] =
true;
285 $data[
'fixmalayalamunicode'] =
true;
290 $data[
'git-hash'] = $git;
291 $data[
'git-branch'] =
296 $data[
'case'] = $config->get(
'CapitalLinks' ) ?
'first-letter' :
'case-sensitive';
297 $data[
'lang'] = $config->get(
'LanguageCode' );
300 foreach ( $this->contentLanguage->getFallbackLanguages() as $code ) {
301 $fallbacks[] = [
'code' => $code ];
303 $data[
'fallback'] = $fallbacks;
304 ApiResult::setIndexedTagName( $data[
'fallback'],
'lang' );
306 if ( $contLangConverter->hasVariants() ) {
308 foreach ( $contLangConverter->getVariants() as $code ) {
311 'name' => $this->contentLanguage->getVariantname( $code ),
314 $data[
'variants'] = $variants;
315 ApiResult::setIndexedTagName( $data[
'variants'],
'lang' );
318 $data[
'rtl'] = $this->contentLanguage->isRTL();
319 $data[
'fallback8bitEncoding'] = $this->contentLanguage->fallback8bitEncoding();
321 $data[
'readonly'] = $this->readOnlyMode->isReadOnly();
322 if ( $data[
'readonly'] ) {
323 $data[
'readonlyreason'] = $this->readOnlyMode->getReason();
325 $data[
'writeapi'] =
true;
327 $data[
'maxarticlesize'] = $config->get(
'MaxArticleSize' ) * 1024;
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() );
343 $data[
'misermode'] = (bool)$config->get(
'MiserMode' );
345 $data[
'uploadsenabled'] = UploadBase::isEnabled();
346 $data[
'maxuploadsize'] = UploadBase::getMaxUploadSize();
349 $data[
'galleryoptions'] = $config->get(
'GalleryOptions' );
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] ];
361 $favicon = $config->get(
'Favicon' );
362 if ( !empty( $favicon ) ) {
368 $data[
'centralidlookupprovider'] = $config->get(
'CentralIdLookupProvider' );
369 $providerIds = array_keys( $config->get(
'CentralIdLookupProviders' ) );
370 $data[
'allcentralidlookupproviders'] = $providerIds;
372 $data[
'interwikimagic'] = (bool)$config->get(
'InterwikiMagic' );
373 $data[
'magiclinks'] = $config->get(
'EnableMagicLinks' );
375 $data[
'categorycollation'] = $config->get(
'CategoryCollation' );
377 $this->
getHookRunner()->onAPIQuerySiteInfoGeneralInfo( $this, $data );
379 return $this->
getResult()->addValue(
'query', $property, $data );
383 $nsProtection = $this->
getConfig()->get(
'NamespaceProtection' );
386 ApiResult::META_TYPE =>
'assoc',
389 $this->contentLanguage->getFormattedNamespaces()
394 'case' => $this->namespaceInfo->isCapitalized( $ns ) ?
'first-letter' :
'case-sensitive',
396 ApiResult::setContentValue( $data[$ns],
'name',
$title );
397 $canonical = $this->namespaceInfo->getCanonicalName( $ns );
399 $data[$ns][
'subpages'] = $this->namespaceInfo->hasSubpages( $ns );
402 $data[$ns][
'canonical'] = strtr( $canonical,
'_',
' ' );
405 $data[$ns][
'content'] = $this->namespaceInfo->isContent( $ns );
406 $data[$ns][
'nonincludable'] = $this->namespaceInfo->isNonincludable( $ns );
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];
414 if ( isset( $specificNs ) && $specificNs !==
'' ) {
415 $data[$ns][
'namespaceprotection'] = $specificNs;
419 $contentmodel = $this->namespaceInfo->getNamespaceContentModel( $ns );
420 if ( $contentmodel ) {
421 $data[$ns][
'defaultcontentmodel'] = $contentmodel;
425 ApiResult::setArrayType( $data,
'assoc' );
426 ApiResult::setIndexedTagName( $data,
'ns' );
428 return $this->
getResult()->addValue(
'query', $property, $data );
432 $aliases = $this->contentLanguage->getNamespaceAliases();
433 $namespaces = $this->contentLanguage->getNamespaces();
435 foreach ( $aliases as
$title => $ns ) {
436 if ( $namespaces[$ns] ==
$title ) {
443 ApiResult::setContentValue( $item,
'alias', strtr(
$title,
'_',
' ' ) );
449 ApiResult::setIndexedTagName( $data,
'ns' );
451 return $this->
getResult()->addValue(
'query', $property, $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' );
464 ApiResult::setIndexedTagName( $data,
'specialpage' );
466 return $this->
getResult()->addValue(
'query', $property, $data );
472 $this->contentLanguage->getMagicWords()
473 as $magicword => $aliases
475 $caseSensitive = array_shift( $aliases );
476 $arr = [
'name' => $magicword,
'aliases' => $aliases ];
477 $arr[
'case-sensitive'] = (bool)$caseSensitive;
478 ApiResult::setIndexedTagName( $arr[
'aliases'],
'alias' );
481 ApiResult::setIndexedTagName( $data,
'magicword' );
483 return $this->
getResult()->addValue(
'query', $property, $data );
487 if ( $filter ===
'local' ) {
489 } elseif ( $filter ===
'!local' ) {
497 $langCode = $params[
'inlanguagecode'] ??
'';
498 $interwikiMagic = $this->
getConfig()->get(
'InterwikiMagic' );
500 if ( $interwikiMagic ) {
501 $langNames = $this->languageNameUtils->getLanguageNames( $langCode );
504 $getPrefixes = $this->interwikiLookup->getAllPrefixes( $local );
505 $extraLangPrefixes = $this->
getConfig()->get(
'ExtraInterlanguageLinkPrefixes' );
506 $localInterwikis = $this->
getConfig()->get(
'LocalInterwikis' );
509 foreach ( $getPrefixes as $row ) {
510 $prefix = $row[
'iw_prefix'];
512 $val[
'prefix'] = $prefix;
513 if ( isset( $row[
'iw_local'] ) && $row[
'iw_local'] ==
'1' ) {
514 $val[
'local'] =
true;
516 if ( isset( $row[
'iw_trans'] ) && $row[
'iw_trans'] ==
'1' ) {
517 $val[
'trans'] =
true;
520 if ( $interwikiMagic && isset( $langNames[$prefix] ) ) {
521 $val[
'language'] = $langNames[$prefix];
523 if ( in_array( $prefix, $localInterwikis ) ) {
524 $val[
'localinterwiki'] =
true;
526 if ( $interwikiMagic && in_array( $prefix, $extraLangPrefixes ) ) {
527 $val[
'extralanglink'] =
true;
529 $linktext =
wfMessage(
"interlanguage-link-$prefix" );
530 if ( !$linktext->isDisabled() ) {
531 $val[
'linktext'] = $linktext->text();
534 $sitename =
wfMessage(
"interlanguage-link-sitename-$prefix" );
535 if ( !$sitename->isDisabled() ) {
536 $val[
'sitename'] = $sitename->text();
541 $val[
'protorel'] = substr( $row[
'iw_url'], 0, 2 ) ==
'//';
542 if ( isset( $row[
'iw_wikiid'] ) && $row[
'iw_wikiid'] !==
'' ) {
543 $val[
'wikiid'] = $row[
'iw_wikiid'];
545 if ( isset( $row[
'iw_api'] ) && $row[
'iw_api'] !==
'' ) {
546 $val[
'api'] = $row[
'iw_api'];
552 ApiResult::setIndexedTagName( $data,
'iw' );
554 return $this->
getResult()->addValue(
'query', $property, $data );
559 $showHostnames = $this->
getConfig()->get(
'ShowHostnames' );
561 if ( !$showHostnames ) {
562 $this->
dieWithError(
'apierror-siteinfo-includealldenied',
'includeAllDenied' );
565 $lags = $this->loadBalancer->getLagTimes();
566 foreach ( $lags as $i => $lag ) {
568 'host' => $this->loadBalancer->getServerName( $i ),
573 list( , $lag, $index ) = $this->loadBalancer->getMaxLag();
575 'host' => $showHostnames
576 ? $this->loadBalancer->getServerName( $index )
582 ApiResult::setIndexedTagName( $data,
'db' );
584 return $this->
getResult()->addValue(
'query', $property, $data );
598 $this->
getHookRunner()->onAPIQuerySiteInfoStatisticsInfo( $data );
600 return $this->
getResult()->addValue(
'query', $property, $data );
608 $allGroups = array_values( $this->userGroupManager->listAllGroups() );
609 foreach ( $config->get(
'GroupPermissions' ) as $group => $permissions ) {
612 'rights' => array_keys( $permissions,
true ),
615 if ( $numberInGroup ) {
616 $autopromote = $config->get(
'Autopromote' );
618 if ( $group ==
'user' ) {
621 } elseif ( $group !==
'*' && !isset( $autopromote[$group] ) ) {
627 'add' => $config->get(
'AddGroups' ),
628 'remove' => $config->get(
'RemoveGroups' ),
629 'add-self' => $config->get(
'GroupsAddToSelf' ),
630 'remove-self' => $config->get(
'GroupsRemoveFromSelf' )
633 foreach ( $groupArr as
$type => $rights ) {
634 if ( isset( $rights[$group] ) ) {
635 if ( $rights[$group] ===
true ) {
636 $groups = $allGroups;
638 $groups = array_intersect( $rights[$group], $allGroups );
641 $arr[
$type] = $groups;
642 ApiResult::setArrayType( $arr[
$type],
'BCarray' );
643 ApiResult::setIndexedTagName( $arr[
$type],
'group' );
648 ApiResult::setIndexedTagName( $arr[
'rights'],
'permission' );
652 ApiResult::setIndexedTagName( $data,
'group' );
654 return $result->addValue(
'query', $property, $data );
659 foreach ( array_unique( $this->
getConfig()->
get(
'FileExtensions' ) ) as
$ext ) {
660 $data[] = [
'ext' =>
$ext ];
662 ApiResult::setIndexedTagName( $data,
'fe' );
664 return $this->
getResult()->addValue(
'query', $property, $data );
669 $path =
"$IP/vendor/composer/installed.json";
670 if ( !file_exists(
$path ) ) {
676 foreach ( $installed->getInstalledDependencies() as $name => $info ) {
677 if ( strpos( $info[
'type'],
'mediawiki-' ) === 0 ) {
684 'version' => $info[
'version'],
687 ApiResult::setIndexedTagName( $data,
'library' );
689 return $this->
getResult()->addValue(
'query', $property, $data );
695 ExtensionRegistry::getInstance(),
698 foreach ( $credits as
$type => $extensions ) {
699 foreach ( $extensions as
$ext ) {
701 $ret[
'type'] =
$type;
702 if ( isset(
$ext[
'name'] ) ) {
703 $ret[
'name'] =
$ext[
'name'];
705 if ( isset(
$ext[
'namemsg'] ) ) {
706 $ret[
'namemsg'] =
$ext[
'namemsg'];
708 if ( isset(
$ext[
'description'] ) ) {
709 $ret[
'description'] =
$ext[
'description'];
711 if ( isset(
$ext[
'descriptionmsg'] ) ) {
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' );
718 $ret[
'descriptionmsg'] =
$ext[
'descriptionmsg'];
721 if ( isset(
$ext[
'author'] ) ) {
722 $ret[
'author'] = is_array(
$ext[
'author'] ) ?
723 implode(
', ',
$ext[
'author'] ) :
$ext[
'author'];
725 if ( isset(
$ext[
'url'] ) ) {
726 $ret[
'url'] =
$ext[
'url'];
728 if ( isset(
$ext[
'version'] ) ) {
729 $ret[
'version'] =
$ext[
'version'];
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 );
745 if ( ExtensionInfo::getLicenseFileNames( $extensionPath ) ) {
746 $ret[
'license-name'] =
$ext[
'license-name'] ??
'';
749 "License/{$ext['name']}"
753 if ( ExtensionInfo::getAuthorsFileName( $extensionPath ) ) {
756 "Credits/{$ext['name']}"
764 ApiResult::setIndexedTagName( $data,
'ext' );
766 return $this->
getResult()->addValue(
'query', $property, $data );
771 $rightsPage = $config->get(
'RightsPage' );
773 if ( strlen( (
string)$rightsPage ) ) {
774 $title = Title::newFromText( $rightsPage );
778 $url = $config->get(
'RightsUrl' );
780 $text = $config->get(
'RightsText' );
781 if (
$title && !strlen( (
string)$text ) ) {
782 $text =
$title->getPrefixedText();
786 'url' => (string)$url,
787 'text' => (
string)$text,
790 return $this->
getResult()->addValue(
'query', $property, $data );
796 'types' => $config->get(
'RestrictionTypes' ),
797 'levels' => $config->get(
'RestrictionLevels' ),
798 'cascadinglevels' => $config->get(
'CascadingRestrictionLevels' ),
799 'semiprotectedlevels' => $config->get(
'SemiprotectedRestrictionLevels' ),
802 ApiResult::setArrayType( $data[
'types'],
'BCarray' );
803 ApiResult::setArrayType( $data[
'levels'],
'BCarray' );
804 ApiResult::setArrayType( $data[
'cascadinglevels'],
'BCarray' );
805 ApiResult::setArrayType( $data[
'semiprotectedlevels'],
'BCarray' );
807 ApiResult::setIndexedTagName( $data[
'types'],
'type' );
808 ApiResult::setIndexedTagName( $data[
'levels'],
'level' );
809 ApiResult::setIndexedTagName( $data[
'cascadinglevels'],
'level' );
810 ApiResult::setIndexedTagName( $data[
'semiprotectedlevels'],
'level' );
812 return $this->
getResult()->addValue(
'query', $property, $data );
817 $langCode = $params[
'inlanguagecode'] ??
'';
818 $langNames = $this->languageNameUtils->getLanguageNames( $langCode );
822 foreach ( $langNames as $code => $name ) {
825 'bcp47' => LanguageCode::bcp47( $code ),
827 ApiResult::setContentValue(
$lang,
'name', $name );
830 ApiResult::setIndexedTagName( $data,
'lang' );
832 return $this->
getResult()->addValue(
'query', $property, $data );
838 $langNames = LanguageConverter::$languagesWithVariants;
839 if ( $this->languageConverterFactory->isConversionDisabled() ) {
846 foreach ( $langNames as $langCode ) {
847 $lang = $this->languageFactory->getLanguage( $langCode );
848 $langConverter = $this->languageConverterFactory->getLanguageConverter(
$lang );
849 if ( !$langConverter->hasVariants() ) {
853 $data[$langCode] = [];
854 ApiResult::setIndexedTagName( $data[$langCode],
'variant' );
855 ApiResult::setArrayType( $data[$langCode],
'kvp',
'code' );
857 $variants = $langConverter->getVariants();
859 foreach ( $variants as $v ) {
860 $fallbacks = $langConverter->getVariantFallbacks( $v );
861 if ( !is_array( $fallbacks ) ) {
862 $fallbacks = [ $fallbacks ];
864 $data[$langCode][$v] = [
865 'fallbacks' => $fallbacks,
867 ApiResult::setIndexedTagName(
868 $data[$langCode][$v][
'fallbacks'],
'variant'
872 ApiResult::setIndexedTagName( $data,
'lang' );
873 ApiResult::setArrayType( $data,
'kvp',
'code' );
875 return $this->
getResult()->addValue(
'query', $property, $data );
880 $allowed = $this->skinFactory->getAllowedSkins();
881 $default = Skin::normalizeKey(
'default' );
882 $skinNames = $this->skinFactory->getSkinNames();
884 foreach ( $skinNames as $name => $displayName ) {
885 $msg = $this->
msg(
"skinname-{$name}" );
887 if ( $code && $this->languageNameUtils->isValidCode( $code ) ) {
888 $msg->inLanguage( $code );
890 $msg->inContentLanguage();
892 if ( $msg->exists() ) {
893 $displayName = $msg->text();
895 $skin = [
'code' => $name ];
896 ApiResult::setContentValue( $skin,
'name', $displayName );
897 if ( !isset( $allowed[$name] ) ) {
898 $skin[
'unusable'] =
true;
900 if ( $name === $default ) {
901 $skin[
'default'] =
true;
905 ApiResult::setIndexedTagName( $data,
'skin' );
907 return $this->
getResult()->addValue(
'query', $property, $data );
912 static function ( $item ) {
915 $this->parser->getTags()
917 ApiResult::setArrayType( $tags,
'BCarray' );
918 ApiResult::setIndexedTagName( $tags,
't' );
920 return $this->
getResult()->addValue(
'query', $property, $tags );
924 $hooks = $this->parser->getFunctionHooks();
925 ApiResult::setArrayType( $hooks,
'BCarray' );
926 ApiResult::setIndexedTagName( $hooks,
'h' );
928 return $this->
getResult()->addValue(
'query', $property, $hooks );
932 $variables = $this->magicWordFactory->getVariableIDs();
933 ApiResult::setArrayType( $variables,
'BCarray' );
934 ApiResult::setIndexedTagName( $variables,
'v' );
936 return $this->
getResult()->addValue(
'query', $property, $variables );
941 $protocols = array_values( $this->
getConfig()->
get(
'UrlProtocols' ) );
942 ApiResult::setArrayType( $protocols,
'BCarray' );
943 ApiResult::setIndexedTagName( $protocols,
'p' );
945 return $this->
getResult()->addValue(
'query', $property, $protocols );
949 $options = $this->userOptionsLookup->getDefaultOptions();
950 $options[ApiResult::META_BC_BOOLS] = array_keys( $options );
951 return $this->
getResult()->addValue(
'query', $property, $options );
955 $config = $this->
getConfig()->get(
'UploadDialog' );
956 return $this->
getResult()->addValue(
'query', $property, $config );
960 $hooks = $this->
getConfig()->get(
'Hooks' );
965 foreach ( $myWgHooks as $name => $subscribers ) {
968 'subscribers' => array_map( [ SpecialVersion::class,
'arrayToString' ], $subscribers ),
971 ApiResult::setArrayType( $arr[
'subscribers'],
'array' );
972 ApiResult::setIndexedTagName( $arr[
'subscribers'],
's' );
976 ApiResult::setIndexedTagName( $data,
'hook' );
978 return $this->
getResult()->addValue(
'query', $property, $data );
984 count( $this->
getConfig()->
get(
'ExtraInterlanguageLinkPrefixes' ) ) &&
985 $params[
'prop'] !==
null &&
986 in_array(
'interwikimap', $params[
'prop'] )
988 return 'anon-public-user-private';
1003 'specialpagealiases',
1033 'showalldb' =>
false,
1034 'numberingroup' =>
false,
1035 'inlanguagecode' =>
null,
1041 'action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics'
1042 =>
'apihelp-query+siteinfo-example-simple',
1043 'action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local'
1044 =>
'apihelp-query+siteinfo-example-interwiki',
1045 'action=query&meta=siteinfo&siprop=dbrepllag&sishowalldb='
1046 =>
'apihelp-query+siteinfo-example-replag',
1051 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Siteinfo';
UserOptionsLookup $userOptionsLookup
const MW_VERSION
The running version of MediaWiki.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
dieWithError( $msg, $code=null, $data=null, $httpCode=0)
Abort execution with an error.
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
getResult()
Get the result object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getHookRunner()
Get an ApiHookRunner for running core API hooks.
This is a base class for all Query modules.
setContinueEnumParameter( $paramName, $paramValue)
Set a query-continue value.
A query action to return meta information about the wiki site.
appendLanguageVariants( $property)
appendLanguages( $property)
appendInterwikiMap( $property, $filter)
appendGeneralInfo( $property)
LanguageConverterFactory $languageConverterFactory
LanguageFactory $languageFactory
appendRightsInfo( $property)
NamespaceInfo $namespaceInfo
getExamplesMessages()
Returns usage examples for this module.
appendInstalledLibraries( $property)
appendVariables( $property)
__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)
MagicWordFactory $magicWordFactory
ILoadBalancer $loadBalancer
appendUserGroups( $property, $numberInGroup)
appendFileExtensions( $property)
UserOptionsLookup $userOptionsLookup
appendNamespaces( $property)
appendDefaultOptions( $property)
LanguageNameUtils $languageNameUtils
appendMagicWords( $property)
getHelpUrls()
Return links to more detailed help pages about the module.
appendExtensions( $property)
ReadOnlyMode $readOnlyMode
getCacheMode( $params)
Get the cache mode for the data generated by this module.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
appendRestrictions( $property)
appendExtensionTags( $property)
UserGroupManager $userGroupManager
appendUploadDialog( $property)
appendProtocols( $property)
appendStatistics( $property)
appendSpecialPageAliases( $property)
appendDbReplLagInfo( $property, $includeAll)
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
SpecialPageFactory $specialPageFactory
appendSubscribedHooks( $property)
appendFunctionHooks( $property)
appendNamespaceAliases( $property)
Language $contentLanguage
InterwikiLookup $interwikiLookup
This is the main query class.
static getMinUploadChunkSize(Config $config)
Reads an installed.json file and provides accessors to get what is installed.
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
A factory that stores information about MagicWords, and creates them on demand with caching.
Factory for handling the special page list and generating SpecialPage objects.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
A service class for fetching the wiki's current read-only mode.
static getAvailableLogos( $conf)
Return an array of all available logos that a skin may use.
static jobs()
Total number of jobs in the job queue.
static numberingroup( $group)
Find the number of users in a given user group.
Factory class to create Skin objects.
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,...
static getGitHeadSha1( $dir)
static getCredits(ExtensionRegistry $reg, Config $conf)
static getGitCurrentBranch( $dir)
if(!is_readable( $file)) $ext
if(!isset( $args[0])) $lang