34 parent::__construct( $query, $moduleName,
'si' );
41 foreach ( $params[
'prop'] as $p ) {
49 case 'namespacealiases':
52 case 'specialpagealiases':
76 case 'fileextensions':
88 case 'languagevariants':
109 case 'defaultoptions':
122 array_diff( $params[
'prop'], $done ) ) );
133 $mainPage = Title::newMainPage();
134 $data[
'mainpage'] = $mainPage->getPrefixedText();
136 $data[
'sitename'] = $config->get(
'Sitename' );
137 $data[
'mainpageisdomainroot'] = (bool)$config->get(
'MainPageIsDomainRoot' );
144 $data[
'generator'] =
'MediaWiki ' .
MW_VERSION;
146 $data[
'phpversion'] = PHP_VERSION;
147 $data[
'phpsapi'] = PHP_SAPI;
148 $data[
'dbtype'] = $config->get(
'DBtype' );
149 $data[
'dbversion'] = $this->
getDB()->getServerVersion();
152 $allowException =
true;
153 if ( !$config->get(
'AllowExternalImages' ) ) {
154 $data[
'imagewhitelistenabled'] = (bool)$config->get(
'EnableImageWhitelist' );
155 $allowFrom = $config->get(
'AllowExternalImagesFrom' );
156 $allowException = !empty( $allowFrom );
158 if ( $allowException ) {
159 $data[
'externalimages'] = (array)$allowFrom;
160 ApiResult::setIndexedTagName( $data[
'externalimages'],
'prefix' );
163 $data[
'langconversion'] = !$config->get(
'DisableLangConversion' );
164 $data[
'titleconversion'] = !$config->get(
'DisableTitleConversion' );
166 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
167 $contLangConverter = MediaWikiServices::getInstance()->getLanguageConverterFactory()
168 ->getLanguageConverter( $contLang );
169 if ( $contLang->linkPrefixExtension() ) {
173 $data[
'linkprefix'] =
"/^((?>.*[^$linkPrefixCharset]|))(.+)$/sDu";
175 $data[
'linkprefixcharset'] =
'';
176 $data[
'linkprefix'] =
'';
179 $linktrail = $contLang->linkTrail();
180 $data[
'linktrail'] = $linktrail ?:
'';
182 $data[
'legaltitlechars'] = Title::legalChars();
183 $data[
'invalidusernamechars'] = $config->get(
'InvalidUsernameCharacters' );
185 $data[
'allunicodefixes'] = (bool)$config->get(
'AllUnicodeFixes' );
186 $data[
'fixarabicunicode'] =
true;
187 $data[
'fixmalayalamunicode'] =
true;
192 $data[
'git-hash'] = $git;
193 $data[
'git-branch'] =
198 $data[
'case'] = $config->get(
'CapitalLinks' ) ?
'first-letter' :
'case-sensitive';
199 $data[
'lang'] = $config->get(
'LanguageCode' );
202 foreach ( $contLang->getFallbackLanguages() as $code ) {
203 $fallbacks[] = [
'code' => $code ];
205 $data[
'fallback'] = $fallbacks;
206 ApiResult::setIndexedTagName( $data[
'fallback'],
'lang' );
208 if ( $contLangConverter->hasVariants() ) {
210 foreach ( $contLangConverter->getVariants() as $code ) {
213 'name' => $contLang->getVariantname( $code ),
216 $data[
'variants'] = $variants;
217 ApiResult::setIndexedTagName( $data[
'variants'],
'lang' );
220 $data[
'rtl'] = $contLang->isRTL();
221 $data[
'fallback8bitEncoding'] = $contLang->fallback8bitEncoding();
224 if ( $data[
'readonly'] ) {
227 $data[
'writeapi'] =
true;
229 $data[
'maxarticlesize'] = $config->get(
'MaxArticleSize' ) * 1024;
231 $tz = $config->get(
'Localtimezone' );
232 $offset = $config->get(
'LocalTZoffset' );
233 $data[
'timezone'] = $tz;
234 $data[
'timeoffset'] = (int)$offset;
235 $data[
'articlepath'] = $config->get(
'ArticlePath' );
236 $data[
'scriptpath'] = $config->get(
'ScriptPath' );
237 $data[
'script'] = $config->get(
'Script' );
238 $data[
'variantarticlepath'] = $config->get(
'VariantArticlePath' );
239 $data[ApiResult::META_BC_BOOLS][] =
'variantarticlepath';
240 $data[
'server'] = $config->get(
'Server' );
241 $data[
'servername'] = $config->get(
'ServerName' );
242 $data[
'wikiid'] = WikiMap::getCurrentWikiId();
243 $data[
'time'] =
wfTimestamp( TS_ISO_8601, time() );
245 $data[
'misermode'] = (bool)$config->get(
'MiserMode' );
247 $data[
'uploadsenabled'] = UploadBase::isEnabled();
248 $data[
'maxuploadsize'] = UploadBase::getMaxUploadSize();
251 $data[
'galleryoptions'] = $config->get(
'GalleryOptions' );
253 $data[
'thumblimits'] = $config->get(
'ThumbLimits' );
254 ApiResult::setArrayType( $data[
'thumblimits'],
'BCassoc' );
255 ApiResult::setIndexedTagName( $data[
'thumblimits'],
'limit' );
256 $data[
'imagelimits'] = [];
257 ApiResult::setArrayType( $data[
'imagelimits'],
'BCassoc' );
258 ApiResult::setIndexedTagName( $data[
'imagelimits'],
'limit' );
259 foreach ( $config->get(
'ImageLimits' ) as $k => $limit ) {
260 $data[
'imagelimits'][$k] = [
'width' => $limit[0],
'height' => $limit[1] ];
263 $favicon = $config->get(
'Favicon' );
264 if ( !empty( $favicon ) ) {
270 $data[
'centralidlookupprovider'] = $config->get(
'CentralIdLookupProvider' );
271 $providerIds = array_keys( $config->get(
'CentralIdLookupProviders' ) );
272 $data[
'allcentralidlookupproviders'] = $providerIds;
274 $data[
'interwikimagic'] = (bool)$config->get(
'InterwikiMagic' );
275 $data[
'magiclinks'] = $config->get(
'EnableMagicLinks' );
277 $data[
'categorycollation'] = $config->get(
'CategoryCollation' );
279 $this->
getHookRunner()->onAPIQuerySiteInfoGeneralInfo( $this, $data );
281 return $this->
getResult()->addValue(
'query', $property, $data );
285 $nsProtection = $this->
getConfig()->get(
'NamespaceProtection' );
288 ApiResult::META_TYPE =>
'assoc',
290 $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
292 MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNamespaces()
297 'case' => $nsInfo->isCapitalized( $ns ) ?
'first-letter' :
'case-sensitive',
299 ApiResult::setContentValue( $data[$ns],
'name',
$title );
300 $canonical = $nsInfo->getCanonicalName( $ns );
302 $data[$ns][
'subpages'] = $nsInfo->hasSubpages( $ns );
305 $data[$ns][
'canonical'] = strtr( $canonical,
'_',
' ' );
308 $data[$ns][
'content'] = $nsInfo->isContent( $ns );
309 $data[$ns][
'nonincludable'] = $nsInfo->isNonincludable( $ns );
311 if ( isset( $nsProtection[$ns] ) ) {
312 if ( is_array( $nsProtection[$ns] ) ) {
313 $specificNs = implode(
"|", array_filter( $nsProtection[$ns] ) );
314 } elseif ( $nsProtection[$ns] !==
'' ) {
315 $specificNs = $nsProtection[$ns];
317 if ( isset( $specificNs ) && $specificNs !==
'' ) {
318 $data[$ns][
'namespaceprotection'] = $specificNs;
322 $contentmodel = $nsInfo->getNamespaceContentModel( $ns );
323 if ( $contentmodel ) {
324 $data[$ns][
'defaultcontentmodel'] = $contentmodel;
328 ApiResult::setArrayType( $data,
'assoc' );
329 ApiResult::setIndexedTagName( $data,
'ns' );
331 return $this->
getResult()->addValue(
'query', $property, $data );
335 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
336 $aliases = $contLang->getNamespaceAliases();
337 $namespaces = $contLang->getNamespaces();
339 foreach ( $aliases as
$title => $ns ) {
340 if ( $namespaces[$ns] ==
$title ) {
347 ApiResult::setContentValue( $item,
'alias', strtr(
$title,
'_',
' ' ) );
353 ApiResult::setIndexedTagName( $data,
'ns' );
355 return $this->
getResult()->addValue(
'query', $property, $data );
360 $services = MediaWikiServices::getInstance();
361 $aliases = $services->getContentLanguage()->getSpecialPageAliases();
362 foreach ( $services->getSpecialPageFactory()->getNames() as $specialpage ) {
363 if ( isset( $aliases[$specialpage] ) ) {
364 $arr = [
'realname' => $specialpage,
'aliases' => $aliases[$specialpage] ];
365 ApiResult::setIndexedTagName( $arr[
'aliases'],
'alias' );
369 ApiResult::setIndexedTagName( $data,
'specialpage' );
371 return $this->
getResult()->addValue(
'query', $property, $data );
377 MediaWikiServices::getInstance()->getContentLanguage()->getMagicWords()
378 as $magicword => $aliases
380 $caseSensitive = array_shift( $aliases );
381 $arr = [
'name' => $magicword,
'aliases' => $aliases ];
382 $arr[
'case-sensitive'] = (bool)$caseSensitive;
383 ApiResult::setIndexedTagName( $arr[
'aliases'],
'alias' );
386 ApiResult::setIndexedTagName( $data,
'magicword' );
388 return $this->
getResult()->addValue(
'query', $property, $data );
392 if ( $filter ===
'local' ) {
394 } elseif ( $filter ===
'!local' ) {
402 $langCode = $params[
'inlanguagecode'] ??
'';
403 $interwikiMagic = $this->
getConfig()->get(
'InterwikiMagic' );
405 if ( $interwikiMagic ) {
406 $langNames = MediaWikiServices::getInstance()
407 ->getLanguageNameUtils()
408 ->getLanguageNames( $langCode );
411 $getPrefixes = MediaWikiServices::getInstance()->getInterwikiLookup()->getAllPrefixes( $local );
412 $extraLangPrefixes = $this->
getConfig()->get(
'ExtraInterlanguageLinkPrefixes' );
413 $localInterwikis = $this->
getConfig()->get(
'LocalInterwikis' );
416 foreach ( $getPrefixes as $row ) {
417 $prefix = $row[
'iw_prefix'];
419 $val[
'prefix'] = $prefix;
420 if ( isset( $row[
'iw_local'] ) && $row[
'iw_local'] ==
'1' ) {
421 $val[
'local'] =
true;
423 if ( isset( $row[
'iw_trans'] ) && $row[
'iw_trans'] ==
'1' ) {
424 $val[
'trans'] =
true;
427 if ( $interwikiMagic && isset( $langNames[$prefix] ) ) {
428 $val[
'language'] = $langNames[$prefix];
430 if ( in_array( $prefix, $localInterwikis ) ) {
431 $val[
'localinterwiki'] =
true;
433 if ( $interwikiMagic && in_array( $prefix, $extraLangPrefixes ) ) {
434 $val[
'extralanglink'] =
true;
436 $linktext =
wfMessage(
"interlanguage-link-$prefix" );
437 if ( !$linktext->isDisabled() ) {
438 $val[
'linktext'] = $linktext->text();
441 $sitename =
wfMessage(
"interlanguage-link-sitename-$prefix" );
442 if ( !$sitename->isDisabled() ) {
443 $val[
'sitename'] = $sitename->text();
448 $val[
'protorel'] = substr( $row[
'iw_url'], 0, 2 ) ==
'//';
449 if ( isset( $row[
'iw_wikiid'] ) && $row[
'iw_wikiid'] !==
'' ) {
450 $val[
'wikiid'] = $row[
'iw_wikiid'];
452 if ( isset( $row[
'iw_api'] ) && $row[
'iw_api'] !==
'' ) {
453 $val[
'api'] = $row[
'iw_api'];
459 ApiResult::setIndexedTagName( $data,
'iw' );
461 return $this->
getResult()->addValue(
'query', $property, $data );
466 $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
467 $showHostnames = $this->
getConfig()->get(
'ShowHostnames' );
469 if ( !$showHostnames ) {
470 $this->
dieWithError(
'apierror-siteinfo-includealldenied',
'includeAllDenied' );
473 $lags = $lb->getLagTimes();
474 foreach ( $lags as $i => $lag ) {
476 'host' => $lb->getServerName( $i ),
481 list( , $lag, $index ) = $lb->getMaxLag();
483 'host' => $showHostnames
484 ? $lb->getServerName( $index )
490 ApiResult::setIndexedTagName( $data,
'db' );
492 return $this->
getResult()->addValue(
'query', $property, $data );
506 $this->
getHookRunner()->onAPIQuerySiteInfoStatisticsInfo( $data );
508 return $this->
getResult()->addValue(
'query', $property, $data );
517 foreach ( $config->get(
'GroupPermissions' ) as $group => $permissions ) {
520 'rights' => array_keys( $permissions,
true ),
523 if ( $numberInGroup ) {
524 $autopromote = $config->get(
'Autopromote' );
526 if ( $group ==
'user' ) {
529 } elseif ( $group !==
'*' && !isset( $autopromote[$group] ) ) {
535 'add' => $config->get(
'AddGroups' ),
536 'remove' => $config->get(
'RemoveGroups' ),
537 'add-self' => $config->get(
'GroupsAddToSelf' ),
538 'remove-self' => $config->get(
'GroupsRemoveFromSelf' )
541 foreach ( $groupArr as
$type => $rights ) {
542 if ( isset( $rights[$group] ) ) {
543 if ( $rights[$group] ===
true ) {
544 $groups = $allGroups;
546 $groups = array_intersect( $rights[$group], $allGroups );
549 $arr[
$type] = $groups;
550 ApiResult::setArrayType( $arr[
$type],
'BCarray' );
551 ApiResult::setIndexedTagName( $arr[
$type],
'group' );
556 ApiResult::setIndexedTagName( $arr[
'rights'],
'permission' );
560 ApiResult::setIndexedTagName( $data,
'group' );
562 return $result->addValue(
'query', $property, $data );
567 foreach ( array_unique( $this->
getConfig()->
get(
'FileExtensions' ) ) as
$ext ) {
568 $data[] = [
'ext' =>
$ext ];
570 ApiResult::setIndexedTagName( $data,
'fe' );
572 return $this->
getResult()->addValue(
'query', $property, $data );
577 $path =
"$IP/vendor/composer/installed.json";
578 if ( !file_exists(
$path ) ) {
584 foreach ( $installed->getInstalledDependencies() as $name => $info ) {
585 if ( strpos( $info[
'type'],
'mediawiki-' ) === 0 ) {
592 'version' => $info[
'version'],
595 ApiResult::setIndexedTagName( $data,
'library' );
597 return $this->
getResult()->addValue(
'query', $property, $data );
603 ExtensionRegistry::getInstance(),
606 foreach ( $credits as
$type => $extensions ) {
607 foreach ( $extensions as
$ext ) {
609 $ret[
'type'] =
$type;
610 if ( isset(
$ext[
'name'] ) ) {
611 $ret[
'name'] =
$ext[
'name'];
613 if ( isset(
$ext[
'namemsg'] ) ) {
614 $ret[
'namemsg'] =
$ext[
'namemsg'];
616 if ( isset(
$ext[
'description'] ) ) {
617 $ret[
'description'] =
$ext[
'description'];
619 if ( isset(
$ext[
'descriptionmsg'] ) ) {
621 if ( is_array(
$ext[
'descriptionmsg'] ) ) {
622 $ret[
'descriptionmsg'] =
$ext[
'descriptionmsg'][0];
623 $ret[
'descriptionmsgparams'] = array_slice(
$ext[
'descriptionmsg'], 1 );
624 ApiResult::setIndexedTagName( $ret[
'descriptionmsgparams'],
'param' );
626 $ret[
'descriptionmsg'] =
$ext[
'descriptionmsg'];
629 if ( isset(
$ext[
'author'] ) ) {
630 $ret[
'author'] = is_array(
$ext[
'author'] ) ?
631 implode(
', ',
$ext[
'author'] ) :
$ext[
'author'];
633 if ( isset(
$ext[
'url'] ) ) {
634 $ret[
'url'] =
$ext[
'url'];
636 if ( isset(
$ext[
'version'] ) ) {
637 $ret[
'version'] =
$ext[
'version'];
639 if ( isset(
$ext[
'path'] ) ) {
640 $extensionPath = dirname(
$ext[
'path'] );
641 $gitInfo =
new GitInfo( $extensionPath );
642 $vcsVersion = $gitInfo->getHeadSHA1();
643 if ( $vcsVersion !==
false ) {
644 $ret[
'vcs-system'] =
'git';
645 $ret[
'vcs-version'] = $vcsVersion;
646 $ret[
'vcs-url'] = $gitInfo->getHeadViewUrl();
647 $vcsDate = $gitInfo->getHeadCommitDate();
648 if ( $vcsDate !==
false ) {
649 $ret[
'vcs-date'] =
wfTimestamp( TS_ISO_8601, $vcsDate );
653 if ( ExtensionInfo::getLicenseFileNames( $extensionPath ) ) {
654 $ret[
'license-name'] =
$ext[
'license-name'] ??
'';
657 "License/{$ext['name']}"
661 if ( ExtensionInfo::getAuthorsFileName( $extensionPath ) ) {
664 "Credits/{$ext['name']}"
672 ApiResult::setIndexedTagName( $data,
'ext' );
674 return $this->
getResult()->addValue(
'query', $property, $data );
679 $rightsPage = $config->get(
'RightsPage' );
681 if ( strlen( (
string)$rightsPage ) ) {
682 $title = Title::newFromText( $rightsPage );
686 $url = $config->get(
'RightsUrl' );
688 $text = $config->get(
'RightsText' );
689 if (
$title && !strlen( (
string)$text ) ) {
690 $text =
$title->getPrefixedText();
694 'url' => (string)$url,
695 'text' => (
string)$text,
698 return $this->
getResult()->addValue(
'query', $property, $data );
704 'types' => $config->get(
'RestrictionTypes' ),
705 'levels' => $config->get(
'RestrictionLevels' ),
706 'cascadinglevels' => $config->get(
'CascadingRestrictionLevels' ),
707 'semiprotectedlevels' => $config->get(
'SemiprotectedRestrictionLevels' ),
710 ApiResult::setArrayType( $data[
'types'],
'BCarray' );
711 ApiResult::setArrayType( $data[
'levels'],
'BCarray' );
712 ApiResult::setArrayType( $data[
'cascadinglevels'],
'BCarray' );
713 ApiResult::setArrayType( $data[
'semiprotectedlevels'],
'BCarray' );
715 ApiResult::setIndexedTagName( $data[
'types'],
'type' );
716 ApiResult::setIndexedTagName( $data[
'levels'],
'level' );
717 ApiResult::setIndexedTagName( $data[
'cascadinglevels'],
'level' );
718 ApiResult::setIndexedTagName( $data[
'semiprotectedlevels'],
'level' );
720 return $this->
getResult()->addValue(
'query', $property, $data );
725 $langCode = $params[
'inlanguagecode'] ??
'';
726 $langNames = MediaWikiServices::getInstance()
727 ->getLanguageNameUtils()
728 ->getLanguageNames( $langCode );
732 foreach ( $langNames as $code => $name ) {
735 'bcp47' => LanguageCode::bcp47( $code ),
737 ApiResult::setContentValue(
$lang,
'name', $name );
740 ApiResult::setIndexedTagName( $data,
'lang' );
742 return $this->
getResult()->addValue(
'query', $property, $data );
748 $langNames = LanguageConverter::$languagesWithVariants;
749 if ( $this->
getConfig()->
get(
'DisableLangConversion' ) ) {
756 foreach ( $langNames as $langCode ) {
757 $lang = MediaWikiServices::getInstance()->getLanguageFactory()
758 ->getLanguage( $langCode );
759 $langConverter = MediaWikiServices::getInstance()->getLanguageConverterFactory()
760 ->getLanguageConverter(
$lang );
761 if ( !$langConverter->hasVariants() ) {
765 $data[$langCode] = [];
766 ApiResult::setIndexedTagName( $data[$langCode],
'variant' );
767 ApiResult::setArrayType( $data[$langCode],
'kvp',
'code' );
769 $variants =
$lang->getVariants();
771 foreach ( $variants as $v ) {
772 $fallbacks = $langConverter->getVariantFallbacks( $v );
773 if ( !is_array( $fallbacks ) ) {
774 $fallbacks = [ $fallbacks ];
776 $data[$langCode][$v] = [
777 'fallbacks' => $fallbacks,
779 ApiResult::setIndexedTagName(
780 $data[$langCode][$v][
'fallbacks'],
'variant'
784 ApiResult::setIndexedTagName( $data,
'lang' );
785 ApiResult::setArrayType( $data,
'kvp',
'code' );
787 return $this->
getResult()->addValue(
'query', $property, $data );
792 $allowed = Skin::getAllowedSkins();
793 $default = Skin::normalizeKey(
'default' );
794 $languageNameUtils = MediaWikiServices::getInstance()->getLanguageNameUtils();
795 foreach ( Skin::getSkinNames() as $name => $displayName ) {
796 $msg = $this->
msg(
"skinname-{$name}" );
798 if ( $code && $languageNameUtils->isValidCode( $code ) ) {
799 $msg->inLanguage( $code );
801 $msg->inContentLanguage();
803 if ( $msg->exists() ) {
804 $displayName = $msg->text();
806 $skin = [
'code' => $name ];
807 ApiResult::setContentValue( $skin,
'name', $displayName );
808 if ( !isset( $allowed[$name] ) ) {
809 $skin[
'unusable'] =
true;
811 if ( $name === $default ) {
812 $skin[
'default'] =
true;
816 ApiResult::setIndexedTagName( $data,
'skin' );
818 return $this->
getResult()->addValue(
'query', $property, $data );
826 MediaWikiServices::getInstance()->getParser()->getTags()
828 ApiResult::setArrayType( $tags,
'BCarray' );
829 ApiResult::setIndexedTagName( $tags,
't' );
831 return $this->
getResult()->addValue(
'query', $property, $tags );
835 $hooks = MediaWikiServices::getInstance()->getParser()->getFunctionHooks();
836 ApiResult::setArrayType( $hooks,
'BCarray' );
837 ApiResult::setIndexedTagName( $hooks,
'h' );
839 return $this->
getResult()->addValue(
'query', $property, $hooks );
843 $variables = MediaWikiServices::getInstance()->getMagicWordFactory()->getVariableIDs();
844 ApiResult::setArrayType( $variables,
'BCarray' );
845 ApiResult::setIndexedTagName( $variables,
'v' );
847 return $this->
getResult()->addValue(
'query', $property, $variables );
852 $protocols = array_values( $this->
getConfig()->
get(
'UrlProtocols' ) );
853 ApiResult::setArrayType( $protocols,
'BCarray' );
854 ApiResult::setIndexedTagName( $protocols,
'p' );
856 return $this->
getResult()->addValue(
'query', $property, $protocols );
861 $options[ApiResult::META_BC_BOOLS] = array_keys( $options );
862 return $this->
getResult()->addValue(
'query', $property, $options );
866 $config = $this->
getConfig()->get(
'UploadDialog' );
867 return $this->
getResult()->addValue(
'query', $property, $config );
871 $hooks = $this->
getConfig()->get(
'Hooks' );
876 foreach ( $myWgHooks as $name => $subscribers ) {
879 'subscribers' => array_map( [ SpecialVersion::class,
'arrayToString' ], $subscribers ),
882 ApiResult::setArrayType( $arr[
'subscribers'],
'array' );
883 ApiResult::setIndexedTagName( $arr[
'subscribers'],
's' );
887 ApiResult::setIndexedTagName( $data,
'hook' );
889 return $this->
getResult()->addValue(
'query', $property, $data );
895 count( $this->
getConfig()->
get(
'ExtraInterlanguageLinkPrefixes' ) ) &&
896 $params[
'prop'] !==
null &&
897 in_array(
'interwikimap', $params[
'prop'] )
899 return 'anon-public-user-private';
914 'specialpagealiases',
944 'showalldb' =>
false,
945 'numberingroup' =>
false,
946 'inlanguagecode' =>
null,
952 'action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics'
953 =>
'apihelp-query+siteinfo-example-simple',
954 'action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local'
955 =>
'apihelp-query+siteinfo-example-interwiki',
956 'action=query&meta=siteinfo&siprop=dbrepllag&sishowalldb='
957 =>
'apihelp-query+siteinfo-example-replag',
962 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Siteinfo';
const MW_VERSION
The running version of MediaWiki.
wfReadOnly()
Check whether the wiki is in read-only mode.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
wfReadOnlyReason()
Check if the site is in read-only mode and return the message if so.
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)
__construct(ApiQuery $query, $moduleName)
appendRightsInfo( $property)
getExamplesMessages()
Returns usage examples for this module.
appendInstalledLibraries( $property)
appendVariables( $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)
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.
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 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.
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)
static getAllGroups()
Return the set of defined explicit groups.
static getDefaultOptions()
Combine the language default options with any site-specific options and add the default language vari...
if(!is_readable( $file)) $ext
if(!isset( $args[0])) $lang