108 parent::__construct( $query, $moduleName,
'si' );
109 $this->userOptionsLookup = $userOptionsLookup;
110 $this->userGroupManager = $userGroupManager;
111 $this->languageConverterFactory = $languageConverterFactory;
112 $this->languageFactory = $languageFactory;
113 $this->languageNameUtils = $languageNameUtils;
114 $this->contentLanguage = $contentLanguage;
115 $this->namespaceInfo = $namespaceInfo;
116 $this->interwikiLookup = $interwikiLookup;
117 $this->parserFactory = $parserFactory;
118 $this->magicWordFactory = $magicWordFactory;
119 $this->specialPageFactory = $specialPageFactory;
120 $this->skinFactory = $skinFactory;
121 $this->loadBalancer = $loadBalancer;
122 $this->readOnlyMode = $readOnlyMode;
123 $this->urlUtils = $urlUtils;
129 foreach ( $params[
'prop'] as $p ) {
137 case 'namespacealiases':
140 case 'specialpagealiases':
158 case 'autocreatetempuser':
167 case 'fileextensions':
179 case 'languagevariants':
185 case 'extensiontags':
188 case 'functionhooks':
200 case 'defaultoptions':
213 array_diff( $params[
'prop'], $done ) ) );
224 $mainPage = Title::newMainPage();
225 $data[
'mainpage'] = $mainPage->getPrefixedText();
226 $data[
'base'] = (string)$this->urlUtils->expand( $mainPage->getFullURL(),
PROTO_CURRENT );
227 $data[
'sitename'] = $config->get( MainConfigNames::Sitename );
228 $data[
'mainpageisdomainroot'] = (bool)$config->get( MainConfigNames::MainPageIsDomainRoot );
232 $logo = SkinModule::getAvailableLogos( $config );
233 $data[
'logo'] = (string)$this->urlUtils->expand( $logo[
'1x'],
PROTO_RELATIVE );
235 $data[
'generator'] =
'MediaWiki ' .
MW_VERSION;
237 $data[
'phpversion'] = PHP_VERSION;
238 $data[
'phpsapi'] = PHP_SAPI;
239 $data[
'dbtype'] = $config->get( MainConfigNames::DBtype );
240 $data[
'dbversion'] = $this->
getDB()->getServerVersion();
243 $allowException =
true;
244 if ( !$config->get( MainConfigNames::AllowExternalImages ) ) {
245 $data[
'imagewhitelistenabled'] =
246 (bool)$config->get( MainConfigNames::EnableImageWhitelist );
247 $allowFrom = $config->get( MainConfigNames::AllowExternalImagesFrom );
248 $allowException = (bool)$allowFrom;
250 if ( $allowException ) {
251 $data[
'externalimages'] = (array)$allowFrom;
255 $data[
'langconversion'] = !$this->languageConverterFactory->isConversionDisabled();
256 $data[
'linkconversion'] = !$this->languageConverterFactory->isLinkConversionDisabled();
258 $data[
'titleconversion'] = $data[
'linkconversion'];
260 $contLangConverter = $this->languageConverterFactory->getLanguageConverter( $this->contentLanguage );
261 if ( $this->contentLanguage->linkPrefixExtension() ) {
265 $data[
'linkprefix'] =
"/^((?>.*[^$linkPrefixCharset]|))(.+)$/sDu";
267 $data[
'linkprefixcharset'] =
'';
268 $data[
'linkprefix'] =
'';
271 $linktrail = $this->contentLanguage->linkTrail();
272 $data[
'linktrail'] = $linktrail ?:
'';
274 $data[
'legaltitlechars'] = Title::legalChars();
275 $data[
'invalidusernamechars'] = $config->get( MainConfigNames::InvalidUsernameCharacters );
277 $data[
'allunicodefixes'] = (bool)$config->get( MainConfigNames::AllUnicodeFixes );
278 $data[
'fixarabicunicode'] =
true;
279 $data[
'fixmalayalamunicode'] =
true;
281 $baseDir = $this->
getConfig()->get( MainConfigNames::BaseDirectory );
282 $git = SpecialVersion::getGitHeadSha1( $baseDir );
284 $data[
'git-hash'] = $git;
285 $data[
'git-branch'] =
286 SpecialVersion::getGitCurrentBranch( $baseDir );
291 $config->get( MainConfigNames::CapitalLinks ) ?
'first-letter' :
'case-sensitive';
292 $data[
'lang'] = $config->get( MainConfigNames::LanguageCode );
295 foreach ( $this->contentLanguage->getFallbackLanguages() as $code ) {
296 $fallbacks[] = [
'code' => $code ];
298 $data[
'fallback'] = $fallbacks;
301 if ( $contLangConverter->hasVariants() ) {
303 foreach ( $contLangConverter->getVariants() as $code ) {
306 'name' => $this->contentLanguage->getVariantname( $code ),
309 $data[
'variants'] = $variants;
313 $data[
'rtl'] = $this->contentLanguage->isRTL();
314 $data[
'fallback8bitEncoding'] = $this->contentLanguage->fallback8bitEncoding();
316 $data[
'readonly'] = $this->readOnlyMode->isReadOnly();
317 if ( $data[
'readonly'] ) {
318 $data[
'readonlyreason'] = $this->readOnlyMode->getReason();
320 $data[
'writeapi'] =
true;
322 $data[
'maxarticlesize'] = $config->get( MainConfigNames::MaxArticleSize ) * 1024;
324 $tz = $config->get( MainConfigNames::Localtimezone );
325 $offset = $config->get( MainConfigNames::LocalTZoffset );
326 $data[
'timezone'] = $tz;
327 $data[
'timeoffset'] = (int)$offset;
328 $data[
'articlepath'] = $config->get( MainConfigNames::ArticlePath );
329 $data[
'scriptpath'] = $config->get( MainConfigNames::ScriptPath );
330 $data[
'script'] = $config->get( MainConfigNames::Script );
331 $data[
'variantarticlepath'] = $config->get( MainConfigNames::VariantArticlePath );
333 $data[
'server'] = $config->get( MainConfigNames::Server );
334 $data[
'servername'] = $config->get( MainConfigNames::ServerName );
335 $data[
'wikiid'] = WikiMap::getCurrentWikiId();
336 $data[
'time'] =
wfTimestamp( TS_ISO_8601, time() );
338 $data[
'misermode'] = (bool)$config->get( MainConfigNames::MiserMode );
344 $data[
'galleryoptions'] = $config->get( MainConfigNames::GalleryOptions );
346 $data[
'thumblimits'] = $config->get( MainConfigNames::ThumbLimits );
349 $data[
'imagelimits'] = [];
352 foreach ( $config->get( MainConfigNames::ImageLimits ) as $k => $limit ) {
353 $data[
'imagelimits'][$k] = [
'width' => $limit[0],
'height' => $limit[1] ];
356 $favicon = $config->get( MainConfigNames::Favicon );
359 $data[
'favicon'] = (string)$this->urlUtils->expand( $favicon );
362 $data[
'centralidlookupprovider'] =
363 $config->get( MainConfigNames::CentralIdLookupProvider );
364 $providerIds = array_keys( $config->get( MainConfigNames::CentralIdLookupProviders ) );
365 $data[
'allcentralidlookupproviders'] = $providerIds;
367 $data[
'interwikimagic'] = (bool)$config->get( MainConfigNames::InterwikiMagic );
368 $data[
'magiclinks'] = $config->get( MainConfigNames::EnableMagicLinks );
370 $data[
'categorycollation'] = $config->get( MainConfigNames::CategoryCollation );
372 $data[
'nofollowlinks'] = $config->get( MainConfigNames::NoFollowLinks );
373 $data[
'nofollownsexceptions'] = $config->get( MainConfigNames::NoFollowNsExceptions );
374 $data[
'nofollowdomainexceptions'] = $config->get( MainConfigNames::NoFollowDomainExceptions );
375 $data[
'externallinktarget'] = $config->get( MainConfigNames::ExternalLinkTarget );
377 $this->
getHookRunner()->onAPIQuerySiteInfoGeneralInfo( $this, $data );
379 return $this->
getResult()->addValue(
'query', $property, $data );
383 $nsProtection = $this->
getConfig()->get( MainConfigNames::NamespaceProtection );
389 $this->contentLanguage->getFormattedNamespaces()
394 'case' => $this->namespaceInfo->isCapitalized( $ns ) ?
'first-letter' :
'case-sensitive',
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;
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 ) {
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] ];
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;
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( MainConfigNames::InterwikiMagic );
500 if ( $interwikiMagic ) {
501 $langNames = $this->languageNameUtils->getLanguageNames( $langCode );
504 $getPrefixes = $this->interwikiLookup->getAllPrefixes( $local );
505 $extraLangPrefixes = $this->
getConfig()->get( MainConfigNames::ExtraInterlanguageLinkPrefixes );
506 $extraLangCodeMap = $this->
getConfig()->get( MainConfigNames::InterlanguageLinkCodeMap );
507 $localInterwikis = $this->
getConfig()->get( MainConfigNames::LocalInterwikis );
510 foreach ( $getPrefixes as $row ) {
511 $prefix = $row[
'iw_prefix'];
513 $val[
'prefix'] = $prefix;
514 if ( isset( $row[
'iw_local'] ) && $row[
'iw_local'] ==
'1' ) {
515 $val[
'local'] =
true;
517 if ( isset( $row[
'iw_trans'] ) && $row[
'iw_trans'] ==
'1' ) {
518 $val[
'trans'] =
true;
521 if ( $interwikiMagic && isset( $langNames[$prefix] ) ) {
522 $val[
'language'] = $langNames[$prefix];
524 if ( $standard !== $prefix ) {
525 # Note that even if this code is deprecated, it should
526 # only be remapped if extralanglink (set below) is false.
527 $val[
'deprecated'] = $standard;
531 if ( in_array( $prefix, $localInterwikis ) ) {
532 $val[
'localinterwiki'] =
true;
534 if ( $interwikiMagic && in_array( $prefix, $extraLangPrefixes ) ) {
535 $val[
'extralanglink'] =
true;
536 $val[
'code'] = $extraLangCodeMap[$prefix] ?? $prefix;
539 $linktext = $this->
msg(
"interlanguage-link-$prefix" );
540 if ( !$linktext->isDisabled() ) {
541 $val[
'linktext'] = $linktext->text();
544 $sitename = $this->
msg(
"interlanguage-link-sitename-$prefix" );
545 if ( !$sitename->isDisabled() ) {
546 $val[
'sitename'] = $sitename->text();
550 $val[
'url'] = (string)$this->urlUtils->expand( $row[
'iw_url'],
PROTO_CURRENT );
551 $val[
'protorel'] = str_starts_with( $row[
'iw_url'],
'//' );
552 if ( isset( $row[
'iw_wikiid'] ) && $row[
'iw_wikiid'] !==
'' ) {
553 $val[
'wikiid'] = $row[
'iw_wikiid'];
555 if ( isset( $row[
'iw_api'] ) && $row[
'iw_api'] !==
'' ) {
556 $val[
'api'] = $row[
'iw_api'];
564 return $this->
getResult()->addValue(
'query', $property, $data );
569 $showHostnames = $this->
getConfig()->get( MainConfigNames::ShowHostnames );
571 if ( !$showHostnames ) {
572 $this->
dieWithError(
'apierror-siteinfo-includealldenied',
'includeAllDenied' );
575 $lags = $this->loadBalancer->getLagTimes();
576 foreach ( $lags as $i => $lag ) {
578 'host' => $this->loadBalancer->getServerName( $i ),
583 [ , $lag, $index ] = $this->loadBalancer->getMaxLag();
585 'host' => $showHostnames
586 ? $this->loadBalancer->getServerName( $index )
594 return $this->
getResult()->addValue(
'query', $property, $data );
599 $data[
'pages'] = (int)SiteStats::pages();
600 $data[
'articles'] = (int)SiteStats::articles();
601 $data[
'edits'] = (int)SiteStats::edits();
602 $data[
'images'] = (int)SiteStats::images();
603 $data[
'users'] = (int)SiteStats::users();
604 $data[
'activeusers'] = (int)SiteStats::activeUsers();
605 $data[
'admins'] = (int)SiteStats::numberingroup(
'sysop' );
606 $data[
'jobs'] = (int)SiteStats::jobs();
608 $this->
getHookRunner()->onAPIQuerySiteInfoStatisticsInfo( $data );
610 return $this->
getResult()->addValue(
'query', $property, $data );
618 $allGroups = array_values( $this->userGroupManager->listAllGroups() );
619 foreach ( $config->get( MainConfigNames::GroupPermissions ) as $group => $permissions ) {
622 'rights' => array_keys( $permissions,
true ),
625 if ( $numberInGroup ) {
626 $autopromote = $config->get( MainConfigNames::Autopromote );
628 if ( $group ==
'user' ) {
629 $arr[
'number'] = SiteStats::users();
631 } elseif ( $group !==
'*' && !isset( $autopromote[$group] ) ) {
632 $arr[
'number'] = SiteStats::numberingroup( $group );
637 'add' => $config->get( MainConfigNames::AddGroups ),
638 'remove' => $config->get( MainConfigNames::RemoveGroups ),
639 'add-self' => $config->get( MainConfigNames::GroupsAddToSelf ),
640 'remove-self' => $config->get( MainConfigNames::GroupsRemoveFromSelf )
643 foreach ( $groupArr as $type => $rights ) {
644 if ( isset( $rights[$group] ) ) {
645 if ( $rights[$group] ===
true ) {
646 $groups = $allGroups;
648 $groups = array_intersect( $rights[$group], $allGroups );
651 $arr[$type] = $groups;
664 return $result->addValue(
'query', $property, $data );
668 $config = $this->
getConfig()->get( MainConfigNames::AutoCreateTempUser );
670 $data = [
'enabled' => false ];
671 if ( $config[
'enabled'] ??
false ) {
672 $data[
'enabled'] =
true;
673 $data[
'actions'] = $config[
'actions'];
674 $data[
'genPattern'] = $config[
'genPattern'];
675 $data[
'matchPattern'] = $config[
'matchPattern'] ?? $data[
'genPattern'];
676 $data[
'serialProvider'] = $config[
'serialProvider'];
677 $data[
'serialMapping'] = $config[
'serialMapping'];
679 if ( isset( $config[
'reservedPattern'] ) ) {
680 $data[
'reservedPattern'] = $config[
'reservedPattern'];
683 return $this->
getResult()->addValue(
'query', $property, $data );
689 array_unique( $this->
getConfig()->
get( MainConfigNames::FileExtensions ) ) as
$ext
691 $data[] = [
'ext' =>
$ext ];
695 return $this->
getResult()->addValue(
'query', $property, $data );
699 $baseDir = $this->
getConfig()->get( MainConfigNames::BaseDirectory );
700 $path =
"$baseDir/vendor/composer/installed.json";
701 if ( !file_exists(
$path ) ) {
707 foreach ( $installed->getInstalledDependencies() as $name => $info ) {
708 if ( str_starts_with( $info[
'type'],
'mediawiki-' ) ) {
715 'version' => $info[
'version'],
720 return $this->
getResult()->addValue(
'query', $property, $data );
725 $credits = SpecialVersion::getCredits(
729 foreach ( $credits as $type => $extensions ) {
730 foreach ( $extensions as
$ext ) {
732 $ret[
'type'] = $type;
733 if ( isset(
$ext[
'name'] ) ) {
734 $ret[
'name'] =
$ext[
'name'];
736 if ( isset(
$ext[
'namemsg'] ) ) {
737 $ret[
'namemsg'] =
$ext[
'namemsg'];
739 if ( isset(
$ext[
'description'] ) ) {
740 $ret[
'description'] =
$ext[
'description'];
742 if ( isset(
$ext[
'descriptionmsg'] ) ) {
744 if ( is_array(
$ext[
'descriptionmsg'] ) ) {
745 $ret[
'descriptionmsg'] =
$ext[
'descriptionmsg'][0];
746 $ret[
'descriptionmsgparams'] = array_slice(
$ext[
'descriptionmsg'], 1 );
749 $ret[
'descriptionmsg'] =
$ext[
'descriptionmsg'];
752 if ( isset(
$ext[
'author'] ) ) {
753 $ret[
'author'] = is_array(
$ext[
'author'] ) ?
754 implode(
', ',
$ext[
'author'] ) :
$ext[
'author'];
756 if ( isset(
$ext[
'url'] ) ) {
757 $ret[
'url'] =
$ext[
'url'];
759 if ( isset(
$ext[
'version'] ) ) {
760 $ret[
'version'] =
$ext[
'version'];
762 if ( isset(
$ext[
'path'] ) ) {
763 $extensionPath = dirname(
$ext[
'path'] );
764 $gitInfo =
new GitInfo( $extensionPath );
765 $vcsVersion = $gitInfo->getHeadSHA1();
766 if ( $vcsVersion !==
false ) {
767 $ret[
'vcs-system'] =
'git';
768 $ret[
'vcs-version'] = $vcsVersion;
769 $ret[
'vcs-url'] = $gitInfo->getHeadViewUrl();
770 $vcsDate = $gitInfo->getHeadCommitDate();
771 if ( $vcsDate !==
false ) {
772 $ret[
'vcs-date'] =
wfTimestamp( TS_ISO_8601, $vcsDate );
776 if ( ExtensionInfo::getLicenseFileNames( $extensionPath ) ) {
777 $ret[
'license-name'] =
$ext[
'license-name'] ??
'';
778 $ret[
'license'] = SpecialPage::getTitleFor(
780 "License/{$ext['name']}"
784 if ( ExtensionInfo::getAuthorsFileName( $extensionPath ) ) {
785 $ret[
'credits'] = SpecialPage::getTitleFor(
787 "Credits/{$ext['name']}"
797 return $this->
getResult()->addValue(
'query', $property, $data );
802 $rightsPage = $config->get( MainConfigNames::RightsPage );
804 if ( strlen( (
string)$rightsPage ) ) {
805 $title = Title::newFromText( $rightsPage );
806 $url = (string)$this->urlUtils->expand( $title->getLinkURL(),
PROTO_CURRENT );
809 $url = $config->get( MainConfigNames::RightsUrl );
811 $text = $config->get( MainConfigNames::RightsText );
812 if ( $title && !strlen( (
string)$text ) ) {
813 $text = $title->getPrefixedText();
817 'url' => (string)$url,
818 'text' => (
string)$text,
821 return $this->
getResult()->addValue(
'query', $property, $data );
827 'types' => $config->get( MainConfigNames::RestrictionTypes ),
828 'levels' => $config->get( MainConfigNames::RestrictionLevels ),
829 'cascadinglevels' => $config->get( MainConfigNames::CascadingRestrictionLevels ),
830 'semiprotectedlevels' => $config->get( MainConfigNames::SemiprotectedRestrictionLevels ),
843 return $this->
getResult()->addValue(
'query', $property, $data );
848 $langCode = $params[
'inlanguagecode'] ??
'';
849 $langNames = $this->languageNameUtils->getLanguageNames( $langCode );
853 foreach ( $langNames as $code => $name ) {
863 return $this->
getResult()->addValue(
'query', $property, $data );
870 if ( $this->languageConverterFactory->isConversionDisabled() ) {
877 foreach ( $langNames as $langCode ) {
878 $lang = $this->languageFactory->getLanguage( $langCode );
879 $langConverter = $this->languageConverterFactory->getLanguageConverter( $lang );
880 if ( !$langConverter->hasVariants() ) {
884 $data[$langCode] = [];
888 $variants = $langConverter->getVariants();
890 foreach ( $variants as $v ) {
891 $fallbacks = $langConverter->getVariantFallbacks( $v );
892 if ( !is_array( $fallbacks ) ) {
893 $fallbacks = [ $fallbacks ];
895 $data[$langCode][$v] = [
896 'fallbacks' => $fallbacks,
899 $data[$langCode][$v][
'fallbacks'],
'variant'
906 return $this->
getResult()->addValue(
'query', $property, $data );
911 $allowed = $this->skinFactory->getAllowedSkins();
913 $skinNames = $this->skinFactory->getInstalledSkins();
915 foreach ( $skinNames as $name => $displayName ) {
916 $msg = $this->
msg(
"skinname-{$name}" );
918 if ( $code && $this->languageNameUtils->isValidCode( $code ) ) {
919 $msg->inLanguage( $code );
921 $msg->inContentLanguage();
923 if ( $msg->exists() ) {
924 $displayName = $msg->text();
926 $skin = [
'code' => $name ];
928 if ( !isset( $allowed[$name] ) ) {
929 $skin[
'unusable'] =
true;
931 if ( $name === $default ) {
932 $skin[
'default'] =
true;
938 return $this->
getResult()->addValue(
'query', $property, $data );
943 static function ( $item ) {
946 $this->parserFactory->getMainInstance()->getTags()
951 return $this->
getResult()->addValue(
'query', $property, $tags );
955 $hooks = $this->parserFactory->getMainInstance()->getFunctionHooks();
959 return $this->
getResult()->addValue(
'query', $property, $hooks );
963 $variables = $this->magicWordFactory->getVariableIDs();
967 return $this->
getResult()->addValue(
'query', $property, $variables );
972 $protocols = array_values( $this->
getConfig()->
get( MainConfigNames::UrlProtocols ) );
976 return $this->
getResult()->addValue(
'query', $property, $protocols );
980 $options = $this->userOptionsLookup->getDefaultOptions();
982 return $this->
getResult()->addValue(
'query', $property, $options );
986 $config = $this->
getConfig()->get( MainConfigNames::UploadDialog );
987 return $this->
getResult()->addValue(
'query', $property, $config );
991 $hookContainer = MediaWikiServices::getInstance()->getHookContainer();
992 $hookNames = $hookContainer->getHookNames();
996 foreach ( $hookNames as $name ) {
997 $subscribers = $hookContainer->getHandlerDescriptions( $name );
1001 'subscribers' => $subscribers,
1011 return $this->
getResult()->addValue(
'query', $property, $data );
1017 count( $this->
getConfig()->
get( MainConfigNames::ExtraInterlanguageLinkPrefixes ) ) &&
1018 $params[
'prop'] !==
null &&
1019 in_array(
'interwikimap', $params[
'prop'] )
1021 return 'anon-public-user-private';
1030 ParamValidator::PARAM_DEFAULT =>
'general',
1031 ParamValidator::PARAM_ISMULTI =>
true,
1032 ParamValidator::PARAM_TYPE => [
1036 'specialpagealiases',
1042 'autocreatetempuser',
1062 ParamValidator::PARAM_TYPE => [
1067 'showalldb' =>
false,
1068 'numberingroup' =>
false,
1069 'inlanguagecode' =>
null,
1075 'action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics'
1076 =>
'apihelp-query+siteinfo-example-simple',
1077 'action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local'
1078 =>
'apihelp-query+siteinfo-example-interwiki',
1079 'action=query&meta=siteinfo&siprop=dbrepllag&sishowalldb='
1080 =>
'apihelp-query+siteinfo-example-replag',
1085 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Siteinfo';
const MW_VERSION
The running version of MediaWiki.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
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, or 'string' with PARAM_ISMULTI,...
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.
getDB()
Get the Query database connection (read-only)
A query action to return meta information about the wiki site.
appendLanguageVariants( $property)
appendLanguages( $property)
appendInterwikiMap( $property, $filter)
appendGeneralInfo( $property)
appendRightsInfo( $property)
getExamplesMessages()
Returns usage examples for this module.
appendInstalledLibraries( $property)
appendVariables( $property)
appendAutoCreateTempUser( $property)
appendUserGroups( $property, $numberInGroup)
appendFileExtensions( $property)
appendNamespaces( $property)
appendDefaultOptions( $property)
appendMagicWords( $property)
getHelpUrls()
Return links to more detailed help pages about the module.
appendExtensions( $property)
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)
__construct(ApiQuery $query, $moduleName, UserOptionsLookup $userOptionsLookup, UserGroupManager $userGroupManager, LanguageConverterFactory $languageConverterFactory, LanguageFactory $languageFactory, LanguageNameUtils $languageNameUtils, Language $contentLanguage, NamespaceInfo $namespaceInfo, InterwikiLookup $interwikiLookup, ParserFactory $parserFactory, MagicWordFactory $magicWordFactory, SpecialPageFactory $specialPageFactory, SkinFactory $skinFactory, ILoadBalancer $loadBalancer, ReadOnlyMode $readOnlyMode, UrlUtils $urlUtils)
appendExtensionTags( $property)
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...
appendSubscribedHooks( $property)
appendFunctionHooks( $property)
appendNamespaceAliases( $property)
This is the main query class.
const META_TYPE
Key for the 'type' metadata item.
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
const META_BC_BOOLS
Key for the 'BC bools' metadata item.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static setContentValue(array &$arr, $name, $value, $flags=0)
Add an output value to the array by name and mark as META_CONTENT.
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()
static replaceDeprecatedCodes( $code)
Replace deprecated language codes that were used in previous versions of MediaWiki to up-to-date,...
static bcp47( $code)
Get the normalised IANA language tag See unit test for examples.
static string[] $languagesWithVariants
languages supporting variants
Base class for language-specific code.
A class containing constants representing the names of configuration variables.
Factory for handling the special page list and generating SpecialPage objects.
Parent class for all special pages.
Factory class to create Skin objects.
static normalizeKey(string $key)
Normalize a skin preference value to a form that can be loaded.
static isEnabled()
Returns true if uploads are enabled.
static getMaxUploadSize( $forType=null)
Get MediaWiki's maximum uploaded file size for a given type of upload, based on $wgMaxUploadSize.
if(!is_readable( $file)) $ext