/includes/api/ApiQuerySiteinfo.php

https://github.com/spenser-roark/OOUG-Wiki · PHP · 645 lines · 538 code · 71 blank · 36 comment · 44 complexity · bae5d219f2414899d9fc429a0d19a1bb MD5 · raw file

  1. <?php
  2. /**
  3. *
  4. *
  5. * Created on Sep 25, 2006
  6. *
  7. * Copyright Š 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
  8. *
  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.
  13. *
  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.
  18. *
  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
  23. *
  24. * @file
  25. */
  26. /**
  27. * A query action to return meta information about the wiki site.
  28. *
  29. * @ingroup API
  30. */
  31. class ApiQuerySiteinfo extends ApiQueryBase {
  32. public function __construct( $query, $moduleName ) {
  33. parent::__construct( $query, $moduleName, 'si' );
  34. }
  35. public function execute() {
  36. $params = $this->extractRequestParams();
  37. $done = array();
  38. $fit = false;
  39. foreach ( $params['prop'] as $p ) {
  40. switch ( $p ) {
  41. case 'general':
  42. $fit = $this->appendGeneralInfo( $p );
  43. break;
  44. case 'namespaces':
  45. $fit = $this->appendNamespaces( $p );
  46. break;
  47. case 'namespacealiases':
  48. $fit = $this->appendNamespaceAliases( $p );
  49. break;
  50. case 'specialpagealiases':
  51. $fit = $this->appendSpecialPageAliases( $p );
  52. break;
  53. case 'magicwords':
  54. $fit = $this->appendMagicWords( $p );
  55. break;
  56. case 'interwikimap':
  57. $filteriw = isset( $params['filteriw'] ) ? $params['filteriw'] : false;
  58. $fit = $this->appendInterwikiMap( $p, $filteriw );
  59. break;
  60. case 'dbrepllag':
  61. $fit = $this->appendDbReplLagInfo( $p, $params['showalldb'] );
  62. break;
  63. case 'statistics':
  64. $fit = $this->appendStatistics( $p );
  65. break;
  66. case 'usergroups':
  67. $fit = $this->appendUserGroups( $p, $params['numberingroup'] );
  68. break;
  69. case 'extensions':
  70. $fit = $this->appendExtensions( $p );
  71. break;
  72. case 'fileextensions':
  73. $fit = $this->appendFileExtensions( $p );
  74. break;
  75. case 'rightsinfo':
  76. $fit = $this->appendRightsInfo( $p );
  77. break;
  78. case 'languages':
  79. $fit = $this->appendLanguages( $p );
  80. break;
  81. case 'skins':
  82. $fit = $this->appendSkins( $p );
  83. break;
  84. case 'extensiontags':
  85. $fit = $this->appendExtensionTags( $p );
  86. break;
  87. case 'functionhooks':
  88. $fit = $this->appendFunctionHooks( $p );
  89. break;
  90. case 'showhooks':
  91. $fit = $this->appendSubscribedHooks( $p );
  92. break;
  93. default:
  94. ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" );
  95. }
  96. if ( !$fit ) {
  97. // Abuse siprop as a query-continue parameter
  98. // and set it to all unprocessed props
  99. $this->setContinueEnumParameter( 'prop', implode( '|',
  100. array_diff( $params['prop'], $done ) ) );
  101. break;
  102. }
  103. $done[] = $p;
  104. }
  105. }
  106. protected function appendGeneralInfo( $property ) {
  107. global $wgContLang;
  108. $data = array();
  109. $mainPage = Title::newMainPage();
  110. $data['mainpage'] = $mainPage->getPrefixedText();
  111. $data['base'] = wfExpandUrl( $mainPage->getFullUrl(), PROTO_CURRENT );
  112. $data['sitename'] = $GLOBALS['wgSitename'];
  113. $data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}";
  114. $data['phpversion'] = phpversion();
  115. $data['phpsapi'] = php_sapi_name();
  116. $data['dbtype'] = $GLOBALS['wgDBtype'];
  117. $data['dbversion'] = $this->getDB()->getServerVersion();
  118. $svn = SpecialVersion::getSvnRevision( $GLOBALS['IP'] );
  119. if ( $svn ) {
  120. $data['rev'] = $svn;
  121. }
  122. // 'case-insensitive' option is reserved for future
  123. $data['case'] = $GLOBALS['wgCapitalLinks'] ? 'first-letter' : 'case-sensitive';
  124. if ( isset( $GLOBALS['wgRightsCode'] ) ) {
  125. $data['rightscode'] = $GLOBALS['wgRightsCode'];
  126. }
  127. $data['rights'] = $GLOBALS['wgRightsText'];
  128. $data['lang'] = $GLOBALS['wgLanguageCode'];
  129. $fallbacks = array();
  130. foreach( $wgContLang->getFallbackLanguages() as $code ) {
  131. $fallbacks[] = array( 'code' => $code );
  132. }
  133. $data['fallback'] = $fallbacks;
  134. $this->getResult()->setIndexedTagName( $data['fallback'], 'lang' );
  135. if ( $wgContLang->isRTL() ) {
  136. $data['rtl'] = '';
  137. }
  138. $data['fallback8bitEncoding'] = $wgContLang->fallback8bitEncoding();
  139. if ( wfReadOnly() ) {
  140. $data['readonly'] = '';
  141. $data['readonlyreason'] = wfReadOnlyReason();
  142. }
  143. if ( $GLOBALS['wgEnableWriteAPI'] ) {
  144. $data['writeapi'] = '';
  145. }
  146. $tz = $GLOBALS['wgLocaltimezone'];
  147. $offset = $GLOBALS['wgLocalTZoffset'];
  148. if ( is_null( $tz ) ) {
  149. $tz = 'UTC';
  150. $offset = 0;
  151. } elseif ( is_null( $offset ) ) {
  152. $offset = 0;
  153. }
  154. $data['timezone'] = $tz;
  155. $data['timeoffset'] = intval( $offset );
  156. $data['articlepath'] = $GLOBALS['wgArticlePath'];
  157. $data['scriptpath'] = $GLOBALS['wgScriptPath'];
  158. $data['script'] = $GLOBALS['wgScript'];
  159. $data['variantarticlepath'] = $GLOBALS['wgVariantArticlePath'];
  160. $data['server'] = $GLOBALS['wgServer'];
  161. $data['wikiid'] = wfWikiID();
  162. $data['time'] = wfTimestamp( TS_ISO_8601, time() );
  163. if ( $GLOBALS['wgMiserMode'] ) {
  164. $data['misermode'] = '';
  165. }
  166. wfRunHooks( 'APIQuerySiteInfoGeneralInfo', array( $this, &$data ) );
  167. return $this->getResult()->addValue( 'query', $property, $data );
  168. }
  169. protected function appendNamespaces( $property ) {
  170. global $wgContLang;
  171. $data = array();
  172. foreach ( $wgContLang->getFormattedNamespaces() as $ns => $title ) {
  173. $data[$ns] = array(
  174. 'id' => intval( $ns ),
  175. 'case' => MWNamespace::isCapitalized( $ns ) ? 'first-letter' : 'case-sensitive',
  176. );
  177. ApiResult::setContent( $data[$ns], $title );
  178. $canonical = MWNamespace::getCanonicalName( $ns );
  179. if ( MWNamespace::hasSubpages( $ns ) ) {
  180. $data[$ns]['subpages'] = '';
  181. }
  182. if ( $canonical ) {
  183. $data[$ns]['canonical'] = strtr( $canonical, '_', ' ' );
  184. }
  185. if ( MWNamespace::isContent( $ns ) ) {
  186. $data[$ns]['content'] = '';
  187. }
  188. }
  189. $this->getResult()->setIndexedTagName( $data, 'ns' );
  190. return $this->getResult()->addValue( 'query', $property, $data );
  191. }
  192. protected function appendNamespaceAliases( $property ) {
  193. global $wgNamespaceAliases, $wgContLang;
  194. $aliases = array_merge( $wgNamespaceAliases, $wgContLang->getNamespaceAliases() );
  195. $namespaces = $wgContLang->getNamespaces();
  196. $data = array();
  197. foreach ( $aliases as $title => $ns ) {
  198. if ( $namespaces[$ns] == $title ) {
  199. // Don't list duplicates
  200. continue;
  201. }
  202. $item = array(
  203. 'id' => intval( $ns )
  204. );
  205. ApiResult::setContent( $item, strtr( $title, '_', ' ' ) );
  206. $data[] = $item;
  207. }
  208. $this->getResult()->setIndexedTagName( $data, 'ns' );
  209. return $this->getResult()->addValue( 'query', $property, $data );
  210. }
  211. protected function appendSpecialPageAliases( $property ) {
  212. global $wgContLang;
  213. $data = array();
  214. foreach ( $wgContLang->getSpecialPageAliases() as $specialpage => $aliases ) {
  215. $arr = array( 'realname' => $specialpage, 'aliases' => $aliases );
  216. $this->getResult()->setIndexedTagName( $arr['aliases'], 'alias' );
  217. $data[] = $arr;
  218. }
  219. $this->getResult()->setIndexedTagName( $data, 'specialpage' );
  220. return $this->getResult()->addValue( 'query', $property, $data );
  221. }
  222. protected function appendMagicWords( $property ) {
  223. global $wgContLang;
  224. $data = array();
  225. foreach ( $wgContLang->getMagicWords() as $magicword => $aliases ) {
  226. $caseSensitive = array_shift( $aliases );
  227. $arr = array( 'name' => $magicword, 'aliases' => $aliases );
  228. if ( $caseSensitive ) {
  229. $arr['case-sensitive'] = '';
  230. }
  231. $this->getResult()->setIndexedTagName( $arr['aliases'], 'alias' );
  232. $data[] = $arr;
  233. }
  234. $this->getResult()->setIndexedTagName( $data, 'magicword' );
  235. return $this->getResult()->addValue( 'query', $property, $data );
  236. }
  237. protected function appendInterwikiMap( $property, $filter ) {
  238. $local = null;
  239. if ( $filter === 'local' ) {
  240. $local = 1;
  241. } elseif ( $filter === '!local' ) {
  242. $local = 0;
  243. } elseif ( $filter ) {
  244. ApiBase::dieDebug( __METHOD__, "Unknown filter=$filter" );
  245. }
  246. $params = $this->extractRequestParams();
  247. $langCode = isset( $params['inlanguagecode'] ) ? $params['inlanguagecode'] : '';
  248. if( $langCode ) {
  249. $langNames = Language::getTranslatedLanguageNames( $langCode );
  250. } else {
  251. $langNames = Language::getLanguageNames();
  252. }
  253. $getPrefixes = Interwiki::getAllPrefixes( $local );
  254. $data = array();
  255. foreach ( $getPrefixes as $row ) {
  256. $prefix = $row['iw_prefix'];
  257. $val = array();
  258. $val['prefix'] = $prefix;
  259. if ( $row['iw_local'] == '1' ) {
  260. $val['local'] = '';
  261. }
  262. // $val['trans'] = intval( $row['iw_trans'] ); // should this be exposed?
  263. if ( isset( $langNames[$prefix] ) ) {
  264. $val['language'] = $langNames[$prefix];
  265. }
  266. $val['url'] = wfExpandUrl( $row['iw_url'], PROTO_CURRENT );
  267. if( isset( $row['iw_wikiid'] ) ) {
  268. $val['wikiid'] = $row['iw_wikiid'];
  269. }
  270. if( isset( $row['iw_api'] ) ) {
  271. $val['api'] = $row['iw_api'];
  272. }
  273. $data[] = $val;
  274. }
  275. $this->getResult()->setIndexedTagName( $data, 'iw' );
  276. return $this->getResult()->addValue( 'query', $property, $data );
  277. }
  278. protected function appendDbReplLagInfo( $property, $includeAll ) {
  279. global $wgShowHostnames;
  280. $data = array();
  281. $lb = wfGetLB();
  282. if ( $includeAll ) {
  283. if ( !$wgShowHostnames ) {
  284. $this->dieUsage( 'Cannot view all servers info unless $wgShowHostnames is true', 'includeAllDenied' );
  285. }
  286. $lags = $lb->getLagTimes();
  287. foreach ( $lags as $i => $lag ) {
  288. $data[] = array(
  289. 'host' => $lb->getServerName( $i ),
  290. 'lag' => $lag
  291. );
  292. }
  293. } else {
  294. list( $host, $lag, $index ) = $lb->getMaxLag();
  295. $data[] = array(
  296. 'host' => $wgShowHostnames
  297. ? $lb->getServerName( $index )
  298. : '',
  299. 'lag' => intval( $lag )
  300. );
  301. }
  302. $result = $this->getResult();
  303. $result->setIndexedTagName( $data, 'db' );
  304. return $this->getResult()->addValue( 'query', $property, $data );
  305. }
  306. protected function appendStatistics( $property ) {
  307. global $wgDisableCounters;
  308. $data = array();
  309. $data['pages'] = intval( SiteStats::pages() );
  310. $data['articles'] = intval( SiteStats::articles() );
  311. if ( !$wgDisableCounters ) {
  312. $data['views'] = intval( SiteStats::views() );
  313. }
  314. $data['edits'] = intval( SiteStats::edits() );
  315. $data['images'] = intval( SiteStats::images() );
  316. $data['users'] = intval( SiteStats::users() );
  317. $data['activeusers'] = intval( SiteStats::activeUsers() );
  318. $data['admins'] = intval( SiteStats::numberingroup( 'sysop' ) );
  319. $data['jobs'] = intval( SiteStats::jobs() );
  320. return $this->getResult()->addValue( 'query', $property, $data );
  321. }
  322. protected function appendUserGroups( $property, $numberInGroup ) {
  323. global $wgGroupPermissions, $wgAddGroups, $wgRemoveGroups, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
  324. $data = array();
  325. $result = $this->getResult();
  326. foreach ( $wgGroupPermissions as $group => $permissions ) {
  327. $arr = array(
  328. 'name' => $group,
  329. 'rights' => array_keys( $permissions, true ),
  330. );
  331. if ( $numberInGroup ) {
  332. global $wgAutopromote;
  333. if ( $group == 'user' ) {
  334. $arr['number'] = SiteStats::users();
  335. // '*' and autopromote groups have no size
  336. } elseif ( $group !== '*' && !isset( $wgAutopromote[$group] ) ) {
  337. $arr['number'] = SiteStats::numberInGroup( $group );
  338. }
  339. }
  340. $groupArr = array(
  341. 'add' => $wgAddGroups,
  342. 'remove' => $wgRemoveGroups,
  343. 'add-self' => $wgGroupsAddToSelf,
  344. 'remove-self' => $wgGroupsRemoveFromSelf
  345. );
  346. foreach ( $groupArr as $type => $rights ) {
  347. if ( isset( $rights[$group] ) ) {
  348. $arr[$type] = $rights[$group];
  349. $result->setIndexedTagName( $arr[$type], 'group' );
  350. }
  351. }
  352. $result->setIndexedTagName( $arr['rights'], 'permission' );
  353. $data[] = $arr;
  354. }
  355. $result->setIndexedTagName( $data, 'group' );
  356. return $result->addValue( 'query', $property, $data );
  357. }
  358. protected function appendFileExtensions( $property ) {
  359. global $wgFileExtensions;
  360. $data = array();
  361. foreach ( $wgFileExtensions as $ext ) {
  362. $data[] = array( 'ext' => $ext );
  363. }
  364. $this->getResult()->setIndexedTagName( $data, 'fe' );
  365. return $this->getResult()->addValue( 'query', $property, $data );
  366. }
  367. protected function appendExtensions( $property ) {
  368. global $wgExtensionCredits;
  369. $data = array();
  370. foreach ( $wgExtensionCredits as $type => $extensions ) {
  371. foreach ( $extensions as $ext ) {
  372. $ret = array();
  373. $ret['type'] = $type;
  374. if ( isset( $ext['name'] ) ) {
  375. $ret['name'] = $ext['name'];
  376. }
  377. if ( isset( $ext['description'] ) ) {
  378. $ret['description'] = $ext['description'];
  379. }
  380. if ( isset( $ext['descriptionmsg'] ) ) {
  381. // Can be a string or array( key, param1, param2, ... )
  382. if ( is_array( $ext['descriptionmsg'] ) ) {
  383. $ret['descriptionmsg'] = $ext['descriptionmsg'][0];
  384. $ret['descriptionmsgparams'] = array_slice( $ext['descriptionmsg'], 1 );
  385. $this->getResult()->setIndexedTagName( $ret['descriptionmsgparams'], 'param' );
  386. } else {
  387. $ret['descriptionmsg'] = $ext['descriptionmsg'];
  388. }
  389. }
  390. if ( isset( $ext['author'] ) ) {
  391. $ret['author'] = is_array( $ext['author'] ) ?
  392. implode( ', ', $ext['author' ] ) : $ext['author'];
  393. }
  394. if ( isset( $ext['url'] ) ) {
  395. $ret['url'] = $ext['url'];
  396. }
  397. if ( isset( $ext['version'] ) ) {
  398. $ret['version'] = $ext['version'];
  399. } elseif ( isset( $ext['svn-revision'] ) &&
  400. preg_match( '/\$(?:Rev|LastChangedRevision|Revision): *(\d+)/',
  401. $ext['svn-revision'], $m ) )
  402. {
  403. $ret['version'] = 'r' . $m[1];
  404. }
  405. $data[] = $ret;
  406. }
  407. }
  408. $this->getResult()->setIndexedTagName( $data, 'ext' );
  409. return $this->getResult()->addValue( 'query', $property, $data );
  410. }
  411. protected function appendRightsInfo( $property ) {
  412. global $wgRightsPage, $wgRightsUrl, $wgRightsText;
  413. $title = Title::newFromText( $wgRightsPage );
  414. $url = $title ? wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ) : $wgRightsUrl;
  415. $text = $wgRightsText;
  416. if ( !$text && $title ) {
  417. $text = $title->getPrefixedText();
  418. }
  419. $data = array(
  420. 'url' => $url ? $url : '',
  421. 'text' => $text ? $text : ''
  422. );
  423. return $this->getResult()->addValue( 'query', $property, $data );
  424. }
  425. public function appendLanguages( $property ) {
  426. $params = $this->extractRequestParams();
  427. $langCode = isset( $params['inlanguagecode'] ) ? $params['inlanguagecode'] : '';
  428. if( $langCode ) {
  429. $langNames = Language::getTranslatedLanguageNames( $langCode );
  430. } else {
  431. $langNames = Language::getLanguageNames();
  432. }
  433. $data = array();
  434. foreach ( $langNames as $code => $name ) {
  435. $lang = array( 'code' => $code );
  436. ApiResult::setContent( $lang, $name );
  437. $data[] = $lang;
  438. }
  439. $this->getResult()->setIndexedTagName( $data, 'lang' );
  440. return $this->getResult()->addValue( 'query', $property, $data );
  441. }
  442. public function appendSkins( $property ) {
  443. $data = array();
  444. foreach ( Skin::getSkinNames() as $name => $displayName ) {
  445. $skin = array( 'code' => $name );
  446. ApiResult::setContent( $skin, $displayName );
  447. $data[] = $skin;
  448. }
  449. $this->getResult()->setIndexedTagName( $data, 'skin' );
  450. return $this->getResult()->addValue( 'query', $property, $data );
  451. }
  452. public function appendExtensionTags( $property ) {
  453. global $wgParser;
  454. $wgParser->firstCallInit();
  455. $tags = array_map( array( $this, 'formatParserTags'), $wgParser->getTags() );
  456. $this->getResult()->setIndexedTagName( $tags, 't' );
  457. return $this->getResult()->addValue( 'query', $property, $tags );
  458. }
  459. public function appendFunctionHooks( $property ) {
  460. global $wgParser;
  461. $wgParser->firstCallInit();
  462. $hooks = $wgParser->getFunctionHooks();
  463. $this->getResult()->setIndexedTagName( $hooks, 'h' );
  464. return $this->getResult()->addValue( 'query', $property, $hooks );
  465. }
  466. private function formatParserTags( $item ) {
  467. return "<{$item}>";
  468. }
  469. public function appendSubscribedHooks( $property ) {
  470. global $wgHooks;
  471. $myWgHooks = $wgHooks;
  472. ksort( $myWgHooks );
  473. $data = array();
  474. foreach ( $myWgHooks as $hook => $hooks ) {
  475. $arr = array(
  476. 'name' => $hook,
  477. 'subscribers' => array_map( array( 'SpecialVersion', 'arrayToString' ), $hooks ),
  478. );
  479. $this->getResult()->setIndexedTagName( $arr['subscribers'], 's' );
  480. $data[] = $arr;
  481. }
  482. $this->getResult()->setIndexedTagName( $data, 'hook' );
  483. return $this->getResult()->addValue( 'query', $property, $data );
  484. }
  485. public function getCacheMode( $params ) {
  486. return 'public';
  487. }
  488. public function getAllowedParams() {
  489. return array(
  490. 'prop' => array(
  491. ApiBase::PARAM_DFLT => 'general',
  492. ApiBase::PARAM_ISMULTI => true,
  493. ApiBase::PARAM_TYPE => array(
  494. 'general',
  495. 'namespaces',
  496. 'namespacealiases',
  497. 'specialpagealiases',
  498. 'magicwords',
  499. 'interwikimap',
  500. 'dbrepllag',
  501. 'statistics',
  502. 'usergroups',
  503. 'extensions',
  504. 'fileextensions',
  505. 'rightsinfo',
  506. 'languages',
  507. 'skins',
  508. 'extensiontags',
  509. 'functionhooks',
  510. 'showhooks',
  511. )
  512. ),
  513. 'filteriw' => array(
  514. ApiBase::PARAM_TYPE => array(
  515. 'local',
  516. '!local',
  517. )
  518. ),
  519. 'showalldb' => false,
  520. 'numberingroup' => false,
  521. 'inlanguagecode' => null,
  522. );
  523. }
  524. public function getParamDescription() {
  525. $p = $this->getModulePrefix();
  526. return array(
  527. 'prop' => array(
  528. 'Which sysinfo properties to get:',
  529. ' general - Overall system information',
  530. ' namespaces - List of registered namespaces and their canonical names',
  531. ' namespacealiases - List of registered namespace aliases',
  532. ' specialpagealiases - List of special page aliases',
  533. ' magicwords - List of magic words and their aliases',
  534. ' statistics - Returns site statistics',
  535. " interwikimap - Returns interwiki map (optionally filtered, (optionally localised by using {$p}inlanguagecode))",
  536. ' dbrepllag - Returns database server with the highest replication lag',
  537. ' usergroups - Returns user groups and the associated permissions',
  538. ' extensions - Returns extensions installed on the wiki',
  539. ' fileextensions - Returns list of file extensions allowed to be uploaded',
  540. ' rightsinfo - Returns wiki rights (license) information if available',
  541. " languages - Returns a list of languages MediaWiki supports (optionally localised by using {$p}inlanguagecode)",
  542. ' skins - Returns a list of all enabled skins',
  543. ' extensiontags - Returns a list of parser extension tags',
  544. ' functionhooks - Returns a list of parser function hooks',
  545. ' showhooks - Returns a list of all subscribed hooks (contents of $wgHooks)'
  546. ),
  547. 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
  548. 'showalldb' => 'List all database servers, not just the one lagging the most',
  549. 'numberingroup' => 'Lists the number of users in user groups',
  550. 'inlanguagecode' => 'Language code for localised language names (best effort, use CLDR extension)',
  551. );
  552. }
  553. public function getDescription() {
  554. return 'Return general information about the site';
  555. }
  556. public function getPossibleErrors() {
  557. return array_merge( parent::getPossibleErrors(), array(
  558. array( 'code' => 'includeAllDenied', 'info' => 'Cannot view all servers info unless $wgShowHostnames is true' ),
  559. ) );
  560. }
  561. public function getExamples() {
  562. return array(
  563. 'api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics',
  564. 'api.php?action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local',
  565. 'api.php?action=query&meta=siteinfo&siprop=dbrepllag&sishowalldb=',
  566. );
  567. }
  568. public function getHelpUrls() {
  569. return 'https://www.mediawiki.org/wiki/API:Meta#siteinfo_.2F_si';
  570. }
  571. public function getVersion() {
  572. return __CLASS__ . ': $Id$';
  573. }
  574. }