5 * Created on Sep 25, 2006
7 * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
28 * A query action to return meta information about the wiki site.
32 class ApiQuerySiteinfo
extends ApiQueryBase
{
34 public function __construct( $query, $moduleName ) {
35 parent
::__construct( $query, $moduleName, 'si' );
38 public function execute() {
39 $params = $this->extractRequestParams();
42 foreach ( $params['prop'] as $p ) {
45 $fit = $this->appendGeneralInfo( $p );
48 $fit = $this->appendNamespaces( $p );
50 case 'namespacealiases':
51 $fit = $this->appendNamespaceAliases( $p );
53 case 'specialpagealiases':
54 $fit = $this->appendSpecialPageAliases( $p );
57 $fit = $this->appendMagicWords( $p );
60 $filteriw = isset( $params['filteriw'] ) ?
$params['filteriw'] : false;
61 $fit = $this->appendInterwikiMap( $p, $filteriw );
64 $fit = $this->appendDbReplLagInfo( $p, $params['showalldb'] );
67 $fit = $this->appendStatistics( $p );
70 $fit = $this->appendUserGroups( $p, $params['numberingroup'] );
73 $fit = $this->appendExtensions( $p );
75 case 'fileextensions':
76 $fit = $this->appendFileExtensions( $p );
79 $fit = $this->appendRightsInfo( $p );
82 $fit = $this->appendLanguages( $p );
85 $fit = $this->appendSkins( $p );
88 $fit = $this->appendExtensionTags( $p );
91 $fit = $this->appendFunctionHooks( $p );
94 $fit = $this->appendSubscribedHooks( $p );
97 $fit = $this->appendVariables( $p );
100 $fit = $this->appendProtocols( $p );
102 case 'defaultoptions':
103 $fit = $this->appendDefaultOptions( $p );
106 ApiBase
::dieDebug( __METHOD__
, "Unknown prop=$p" );
109 // Abuse siprop as a query-continue parameter
110 // and set it to all unprocessed props
111 $this->setContinueEnumParameter( 'prop', implode( '|',
112 array_diff( $params['prop'], $done ) ) );
119 protected function appendGeneralInfo( $property ) {
120 global $wgContLang, $wgDisableLangConversion, $wgDisableTitleConversion;
123 $mainPage = Title
::newMainPage();
124 $data['mainpage'] = $mainPage->getPrefixedText();
125 $data['base'] = wfExpandUrl( $mainPage->getFullURL(), PROTO_CURRENT
);
126 $data['sitename'] = $GLOBALS['wgSitename'];
127 $data['logo'] = $GLOBALS['wgLogo'];
128 $data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}";
129 $data['phpversion'] = phpversion();
130 $data['phpsapi'] = PHP_SAPI
;
131 $data['dbtype'] = $GLOBALS['wgDBtype'];
132 $data['dbversion'] = $this->getDB()->getServerVersion();
134 $allowFrom = array( '' );
135 $allowException = true;
136 if ( !$GLOBALS['wgAllowExternalImages'] ) {
137 if ( $GLOBALS['wgEnableImageWhitelist'] ) {
138 $data['imagewhitelistenabled'] = '';
140 $allowFrom = $GLOBALS['wgAllowExternalImagesFrom'];
141 $allowException = !empty( $allowFrom );
143 if ( $allowException ) {
144 $data['externalimages'] = (array)$allowFrom;
145 $this->getResult()->setIndexedTagName( $data['externalimages'], 'prefix' );
148 if ( !$wgDisableLangConversion ) {
149 $data['langconversion'] = '';
152 if ( !$wgDisableTitleConversion ) {
153 $data['titleconversion'] = '';
156 if ( $wgContLang->linkPrefixExtension() ) {
157 $linkPrefixCharset = $wgContLang->linkPrefixCharset();
158 $data['linkprefixcharset'] = $linkPrefixCharset;
159 // For backwards compatability
160 $data['linkprefix'] = "/^((?>.*[^$linkPrefixCharset]|))(.+)$/sDu";
162 $data['linkprefixcharset'] = '';
163 $data['linkprefix'] = '';
166 $linktrail = $wgContLang->linkTrail();
168 $data['linktrail'] = $linktrail;
170 $data['linktrail'] = '';
173 $git = SpecialVersion
::getGitHeadSha1( $GLOBALS['IP'] );
175 $data['git-hash'] = $git;
177 $svn = SpecialVersion
::getSvnRevision( $GLOBALS['IP'] );
183 // 'case-insensitive' option is reserved for future
184 $data['case'] = $GLOBALS['wgCapitalLinks'] ?
'first-letter' : 'case-sensitive';
186 if ( isset( $GLOBALS['wgRightsCode'] ) ) {
187 $data['rightscode'] = $GLOBALS['wgRightsCode'];
189 $data['rights'] = $GLOBALS['wgRightsText'];
190 $data['lang'] = $GLOBALS['wgLanguageCode'];
192 $fallbacks = array();
193 foreach ( $wgContLang->getFallbackLanguages() as $code ) {
194 $fallbacks[] = array( 'code' => $code );
196 $data['fallback'] = $fallbacks;
197 $this->getResult()->setIndexedTagName( $data['fallback'], 'lang' );
199 if ( $wgContLang->hasVariants() ) {
201 foreach ( $wgContLang->getVariants() as $code ) {
204 'name' => $wgContLang->getVariantname( $code ),
207 $data['variants'] = $variants;
208 $this->getResult()->setIndexedTagName( $data['variants'], 'lang' );
211 if ( $wgContLang->isRTL() ) {
214 $data['fallback8bitEncoding'] = $wgContLang->fallback8bitEncoding();
216 if ( wfReadOnly() ) {
217 $data['readonly'] = '';
218 $data['readonlyreason'] = wfReadOnlyReason();
220 if ( $GLOBALS['wgEnableWriteAPI'] ) {
221 $data['writeapi'] = '';
224 $tz = $GLOBALS['wgLocaltimezone'];
225 $offset = $GLOBALS['wgLocalTZoffset'];
226 if ( is_null( $tz ) ) {
229 } elseif ( is_null( $offset ) ) {
232 $data['timezone'] = $tz;
233 $data['timeoffset'] = intval( $offset );
234 $data['articlepath'] = $GLOBALS['wgArticlePath'];
235 $data['scriptpath'] = $GLOBALS['wgScriptPath'];
236 $data['script'] = $GLOBALS['wgScript'];
237 $data['variantarticlepath'] = $GLOBALS['wgVariantArticlePath'];
238 $data['server'] = $GLOBALS['wgServer'];
239 $data['wikiid'] = wfWikiID();
240 $data['time'] = wfTimestamp( TS_ISO_8601
, time() );
242 if ( $GLOBALS['wgMiserMode'] ) {
243 $data['misermode'] = '';
246 $data['maxuploadsize'] = UploadBase
::getMaxUploadSize();
248 $data['thumblimits'] = $GLOBALS['wgThumbLimits'];
249 $this->getResult()->setIndexedTagName( $data['thumblimits'], 'limit' );
250 $data['imagelimits'] = array();
251 $this->getResult()->setIndexedTagName( $data['imagelimits'], 'limit' );
252 foreach ( $GLOBALS['wgImageLimits'] as $k => $limit ) {
253 $data['imagelimits'][$k] = array( 'width' => $limit[0], 'height' => $limit[1] );
256 wfRunHooks( 'APIQuerySiteInfoGeneralInfo', array( $this, &$data ) );
258 return $this->getResult()->addValue( 'query', $property, $data );
261 protected function appendNamespaces( $property ) {
264 foreach ( $wgContLang->getFormattedNamespaces() as $ns => $title ) {
266 'id' => intval( $ns ),
267 'case' => MWNamespace
::isCapitalized( $ns ) ?
'first-letter' : 'case-sensitive',
269 ApiResult
::setContent( $data[$ns], $title );
270 $canonical = MWNamespace
::getCanonicalName( $ns );
272 if ( MWNamespace
::hasSubpages( $ns ) ) {
273 $data[$ns]['subpages'] = '';
277 $data[$ns]['canonical'] = strtr( $canonical, '_', ' ' );
280 if ( MWNamespace
::isContent( $ns ) ) {
281 $data[$ns]['content'] = '';
284 if ( MWNamespace
::isNonincludable( $ns ) ) {
285 $data[$ns]['nonincludable'] = '';
288 $contentmodel = MWNamespace
::getNamespaceContentModel( $ns );
289 if ( $contentmodel ) {
290 $data[$ns]['defaultcontentmodel'] = $contentmodel;
294 $this->getResult()->setIndexedTagName( $data, 'ns' );
296 return $this->getResult()->addValue( 'query', $property, $data );
299 protected function appendNamespaceAliases( $property ) {
300 global $wgNamespaceAliases, $wgContLang;
301 $aliases = array_merge( $wgNamespaceAliases, $wgContLang->getNamespaceAliases() );
302 $namespaces = $wgContLang->getNamespaces();
304 foreach ( $aliases as $title => $ns ) {
305 if ( $namespaces[$ns] == $title ) {
306 // Don't list duplicates
310 'id' => intval( $ns )
312 ApiResult
::setContent( $item, strtr( $title, '_', ' ' ) );
318 $this->getResult()->setIndexedTagName( $data, 'ns' );
320 return $this->getResult()->addValue( 'query', $property, $data );
323 protected function appendSpecialPageAliases( $property ) {
326 $aliases = $wgContLang->getSpecialPageAliases();
327 foreach ( SpecialPageFactory
::getList() as $specialpage => $stuff ) {
328 if ( isset( $aliases[$specialpage] ) ) {
329 $arr = array( 'realname' => $specialpage, 'aliases' => $aliases[$specialpage] );
330 $this->getResult()->setIndexedTagName( $arr['aliases'], 'alias' );
334 $this->getResult()->setIndexedTagName( $data, 'specialpage' );
336 return $this->getResult()->addValue( 'query', $property, $data );
339 protected function appendMagicWords( $property ) {
342 foreach ( $wgContLang->getMagicWords() as $magicword => $aliases ) {
343 $caseSensitive = array_shift( $aliases );
344 $arr = array( 'name' => $magicword, 'aliases' => $aliases );
345 if ( $caseSensitive ) {
346 $arr['case-sensitive'] = '';
348 $this->getResult()->setIndexedTagName( $arr['aliases'], 'alias' );
351 $this->getResult()->setIndexedTagName( $data, 'magicword' );
353 return $this->getResult()->addValue( 'query', $property, $data );
356 protected function appendInterwikiMap( $property, $filter ) {
358 if ( $filter === 'local' ) {
360 } elseif ( $filter === '!local' ) {
362 } elseif ( $filter ) {
363 ApiBase
::dieDebug( __METHOD__
, "Unknown filter=$filter" );
366 $params = $this->extractRequestParams();
367 $langCode = isset( $params['inlanguagecode'] ) ?
$params['inlanguagecode'] : '';
368 $langNames = Language
::fetchLanguageNames( $langCode );
370 $getPrefixes = Interwiki
::getAllPrefixes( $local );
373 foreach ( $getPrefixes as $row ) {
374 $prefix = $row['iw_prefix'];
376 $val['prefix'] = $prefix;
377 if ( $row['iw_local'] == '1' ) {
380 if ( $row['iw_trans'] == '1' ) {
383 if ( isset( $langNames[$prefix] ) ) {
384 $val['language'] = $langNames[$prefix];
386 $val['url'] = wfExpandUrl( $row['iw_url'], PROTO_CURRENT
);
387 if ( isset( $row['iw_wikiid'] ) ) {
388 $val['wikiid'] = $row['iw_wikiid'];
390 if ( isset( $row['iw_api'] ) ) {
391 $val['api'] = $row['iw_api'];
397 $this->getResult()->setIndexedTagName( $data, 'iw' );
399 return $this->getResult()->addValue( 'query', $property, $data );
402 protected function appendDbReplLagInfo( $property, $includeAll ) {
403 global $wgShowHostnames;
407 if ( !$wgShowHostnames ) {
409 'Cannot view all servers info unless $wgShowHostnames is true',
414 $lags = $lb->getLagTimes();
415 foreach ( $lags as $i => $lag ) {
417 'host' => $lb->getServerName( $i ),
422 list( , $lag, $index ) = $lb->getMaxLag();
424 'host' => $wgShowHostnames
425 ?
$lb->getServerName( $index )
427 'lag' => intval( $lag )
431 $result = $this->getResult();
432 $result->setIndexedTagName( $data, 'db' );
434 return $this->getResult()->addValue( 'query', $property, $data );
437 protected function appendStatistics( $property ) {
438 global $wgDisableCounters;
440 $data['pages'] = intval( SiteStats
::pages() );
441 $data['articles'] = intval( SiteStats
::articles() );
442 if ( !$wgDisableCounters ) {
443 $data['views'] = intval( SiteStats
::views() );
445 $data['edits'] = intval( SiteStats
::edits() );
446 $data['images'] = intval( SiteStats
::images() );
447 $data['users'] = intval( SiteStats
::users() );
448 $data['activeusers'] = intval( SiteStats
::activeUsers() );
449 $data['admins'] = intval( SiteStats
::numberingroup( 'sysop' ) );
450 $data['jobs'] = intval( SiteStats
::jobs() );
452 wfRunHooks( 'APIQuerySiteInfoStatisticsInfo', array( &$data ) );
454 return $this->getResult()->addValue( 'query', $property, $data );
457 protected function appendUserGroups( $property, $numberInGroup ) {
458 global $wgGroupPermissions, $wgAddGroups, $wgRemoveGroups;
459 global $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
462 $result = $this->getResult();
463 foreach ( $wgGroupPermissions as $group => $permissions ) {
466 'rights' => array_keys( $permissions, true ),
469 if ( $numberInGroup ) {
470 global $wgAutopromote;
472 if ( $group == 'user' ) {
473 $arr['number'] = SiteStats
::users();
474 // '*' and autopromote groups have no size
475 } elseif ( $group !== '*' && !isset( $wgAutopromote[$group] ) ) {
476 $arr['number'] = SiteStats
::numberInGroup( $group );
481 'add' => $wgAddGroups,
482 'remove' => $wgRemoveGroups,
483 'add-self' => $wgGroupsAddToSelf,
484 'remove-self' => $wgGroupsRemoveFromSelf
487 foreach ( $groupArr as $type => $rights ) {
488 if ( isset( $rights[$group] ) ) {
489 $arr[$type] = $rights[$group];
490 $result->setIndexedTagName( $arr[$type], 'group' );
494 $result->setIndexedTagName( $arr['rights'], 'permission' );
498 $result->setIndexedTagName( $data, 'group' );
500 return $result->addValue( 'query', $property, $data );
503 protected function appendFileExtensions( $property ) {
504 global $wgFileExtensions;
507 foreach ( array_unique( $wgFileExtensions ) as $ext ) {
508 $data[] = array( 'ext' => $ext );
510 $this->getResult()->setIndexedTagName( $data, 'fe' );
512 return $this->getResult()->addValue( 'query', $property, $data );
515 protected function appendExtensions( $property ) {
516 global $wgExtensionCredits;
518 foreach ( $wgExtensionCredits as $type => $extensions ) {
519 foreach ( $extensions as $ext ) {
521 $ret['type'] = $type;
522 if ( isset( $ext['name'] ) ) {
523 $ret['name'] = $ext['name'];
525 if ( isset( $ext['description'] ) ) {
526 $ret['description'] = $ext['description'];
528 if ( isset( $ext['descriptionmsg'] ) ) {
529 // Can be a string or array( key, param1, param2, ... )
530 if ( is_array( $ext['descriptionmsg'] ) ) {
531 $ret['descriptionmsg'] = $ext['descriptionmsg'][0];
532 $ret['descriptionmsgparams'] = array_slice( $ext['descriptionmsg'], 1 );
533 $this->getResult()->setIndexedTagName( $ret['descriptionmsgparams'], 'param' );
535 $ret['descriptionmsg'] = $ext['descriptionmsg'];
538 if ( isset( $ext['author'] ) ) {
539 $ret['author'] = is_array( $ext['author'] ) ?
540 implode( ', ', $ext['author'] ) : $ext['author'];
542 if ( isset( $ext['url'] ) ) {
543 $ret['url'] = $ext['url'];
545 if ( isset( $ext['version'] ) ) {
546 $ret['version'] = $ext['version'];
547 } elseif ( isset( $ext['svn-revision'] ) &&
548 preg_match( '/\$(?:Rev|LastChangedRevision|Revision): *(\d+)/',
549 $ext['svn-revision'], $m )
551 $ret['version'] = 'r' . $m[1];
553 if ( isset( $ext['path'] ) ) {
554 $extensionPath = dirname( $ext['path'] );
555 $gitInfo = new GitInfo( $extensionPath );
556 $vcsVersion = $gitInfo->getHeadSHA1();
557 if ( $vcsVersion !== false ) {
558 $ret['vcs-system'] = 'git';
559 $ret['vcs-version'] = $vcsVersion;
560 $ret['vcs-url'] = $gitInfo->getHeadViewUrl();
561 $ret['vcs-date'] = wfTimestamp( TS_ISO_8601
, $gitInfo->getHeadCommitDate() );
563 $svnInfo = SpecialVersion
::getSvnInfo( $extensionPath );
564 if ( $svnInfo !== false ) {
565 $ret['vcs-system'] = 'svn';
566 $ret['vcs-version'] = $svnInfo['checkout-rev'];
567 $ret['vcs-url'] = isset( $svnInfo['viewvc-url'] ) ?
$svnInfo['viewvc-url'] : '';
570 if ( SpecialVersion
::getExtLicenseFileName( $extensionPath ) ) {
571 $ret['license-name'] = isset( $ext['license-name'] ) ?
$ext['license-name'] : '';
572 $ret['license'] = SpecialPage
::getTitleFor( 'Version', "License/{$ext['name']}" )->getLinkURL();
574 if ( SpecialVersion
::getExtAuthorsFileName( $extensionPath ) ) {
575 $ret['credits'] = SpecialPage
::getTitleFor( 'Version', "Credits/{$ext['name']}" )->getLinkURL();
582 $this->getResult()->setIndexedTagName( $data, 'ext' );
584 return $this->getResult()->addValue( 'query', $property, $data );
587 protected function appendRightsInfo( $property ) {
588 global $wgRightsPage, $wgRightsUrl, $wgRightsText;
589 $title = Title
::newFromText( $wgRightsPage );
590 $url = $title ?
wfExpandUrl( $title->getFullURL(), PROTO_CURRENT
) : $wgRightsUrl;
591 $text = $wgRightsText;
592 if ( !$text && $title ) {
593 $text = $title->getPrefixedText();
597 'url' => $url ?
$url : '',
598 'text' => $text ?
$text : ''
601 return $this->getResult()->addValue( 'query', $property, $data );
604 public function appendLanguages( $property ) {
605 $params = $this->extractRequestParams();
606 $langCode = isset( $params['inlanguagecode'] ) ?
$params['inlanguagecode'] : '';
607 $langNames = Language
::fetchLanguageNames( $langCode );
611 foreach ( $langNames as $code => $name ) {
612 $lang = array( 'code' => $code );
613 ApiResult
::setContent( $lang, $name );
616 $this->getResult()->setIndexedTagName( $data, 'lang' );
618 return $this->getResult()->addValue( 'query', $property, $data );
621 public function appendSkins( $property ) {
623 $usable = Skin
::getUsableSkins();
624 $default = Skin
::normalizeKey( 'default' );
625 foreach ( Skin
::getSkinNames() as $name => $displayName ) {
626 $skin = array( 'code' => $name );
627 ApiResult
::setContent( $skin, $displayName );
628 if ( !isset( $usable[$name] ) ) {
629 $skin['unusable'] = '';
631 if ( $name === $default ) {
632 $skin['default'] = '';
636 $this->getResult()->setIndexedTagName( $data, 'skin' );
638 return $this->getResult()->addValue( 'query', $property, $data );
641 public function appendExtensionTags( $property ) {
643 $wgParser->firstCallInit();
644 $tags = array_map( array( $this, 'formatParserTags' ), $wgParser->getTags() );
645 $this->getResult()->setIndexedTagName( $tags, 't' );
647 return $this->getResult()->addValue( 'query', $property, $tags );
650 public function appendFunctionHooks( $property ) {
652 $wgParser->firstCallInit();
653 $hooks = $wgParser->getFunctionHooks();
654 $this->getResult()->setIndexedTagName( $hooks, 'h' );
656 return $this->getResult()->addValue( 'query', $property, $hooks );
659 public function appendVariables( $property ) {
660 $variables = MagicWord
::getVariableIDs();
661 $this->getResult()->setIndexedTagName( $variables, 'v' );
663 return $this->getResult()->addValue( 'query', $property, $variables );
666 public function appendProtocols( $property ) {
667 global $wgUrlProtocols;
668 // Make a copy of the global so we don't try to set the _element key of it - bug 45130
669 $protocols = array_values( $wgUrlProtocols );
670 $this->getResult()->setIndexedTagName( $protocols, 'p' );
672 return $this->getResult()->addValue( 'query', $property, $protocols );
675 public function appendDefaultOptions( $property ) {
676 return $this->getResult()->addValue( 'query', $property, User
::getDefaultOptions() );
679 private function formatParserTags( $item ) {
683 public function appendSubscribedHooks( $property ) {
685 $myWgHooks = $wgHooks;
689 foreach ( $myWgHooks as $hook => $hooks ) {
692 'subscribers' => array_map( array( 'SpecialVersion', 'arrayToString' ), $hooks ),
695 $this->getResult()->setIndexedTagName( $arr['subscribers'], 's' );
699 $this->getResult()->setIndexedTagName( $data, 'hook' );
701 return $this->getResult()->addValue( 'query', $property, $data );
704 public function getCacheMode( $params ) {
708 public function getAllowedParams() {
711 ApiBase
::PARAM_DFLT
=> 'general',
712 ApiBase
::PARAM_ISMULTI
=> true,
713 ApiBase
::PARAM_TYPE
=> array(
717 'specialpagealiases',
737 ApiBase
::PARAM_TYPE
=> array(
742 'showalldb' => false,
743 'numberingroup' => false,
744 'inlanguagecode' => null,
748 public function getParamDescription() {
749 $p = $this->getModulePrefix();
753 'Which sysinfo properties to get:',
754 ' general - Overall system information',
755 ' namespaces - List of registered namespaces and their canonical names',
756 ' namespacealiases - List of registered namespace aliases',
757 ' specialpagealiases - List of special page aliases',
758 ' magicwords - List of magic words and their aliases',
759 ' statistics - Returns site statistics',
760 ' interwikimap - Returns interwiki map ' .
761 "(optionally filtered, (optionally localised by using {$p}inlanguagecode))",
762 ' dbrepllag - Returns database server with the highest replication lag',
763 ' usergroups - Returns user groups and the associated permissions',
764 ' extensions - Returns extensions installed on the wiki',
765 ' fileextensions - Returns list of file extensions allowed to be uploaded',
766 ' rightsinfo - Returns wiki rights (license) information if available',
767 ' languages - Returns a list of languages MediaWiki supports' .
768 "(optionally localised by using {$p}inlanguagecode)",
769 ' skins - Returns a list of all enabled skins',
770 ' extensiontags - Returns a list of parser extension tags',
771 ' functionhooks - Returns a list of parser function hooks',
772 ' showhooks - Returns a list of all subscribed hooks (contents of $wgHooks)',
773 ' variables - Returns a list of variable IDs',
774 ' protocols - Returns a list of protocols that are allowed in external links.',
775 ' defaultoptions - Returns the default values for user preferences.',
777 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
778 'showalldb' => 'List all database servers, not just the one lagging the most',
779 'numberingroup' => 'Lists the number of users in user groups',
780 'inlanguagecode' => 'Language code for localised language names ' .
781 '(best effort, use CLDR extension)',
785 public function getDescription() {
786 return 'Return general information about the site';
789 public function getPossibleErrors() {
790 return array_merge( parent
::getPossibleErrors(), array( array(
791 'code' => 'includeAllDenied',
792 'info' => 'Cannot view all servers info unless $wgShowHostnames is true'
796 public function getExamples() {
798 'api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics',
799 'api.php?action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local',
800 'api.php?action=query&meta=siteinfo&siprop=dbrepllag&sishowalldb=',
804 public function getHelpUrls() {
805 return 'https://www.mediawiki.org/wiki/API:Meta#siteinfo_.2F_si';