From f227fd9915ecb7ccfaa3399810f978fbb4983e69 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 28 Mar 2008 12:47:21 +0000 Subject: [PATCH] (bug 13541) Adding siprop=specialpagealiases to meta=siteinfo --- RELEASE-NOTES | 1 + includes/api/ApiQuerySiteinfo.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e24b981816..2a191f4f96 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -171,6 +171,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Added createonly parameter to action=edit * Replaced $wgAPIUCUserPrefixMinLength by the more generic $wgAPIMaxDBRows * (bug 11719) Remove trailing blanks in YAML output. +* (bug 13541) Added siprop=specialpagealiases to meta=siteinfo === Languages updated in 1.13 === diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 4ed04eba54..f8a401a144 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -56,6 +56,9 @@ class ApiQuerySiteinfo extends ApiQueryBase { case 'namespacealiases' : $this->appendNamespaceAliases($p); break; + case 'specialpagealiases' : + $this->appendSpecialPageAliases($p); + break; case 'interwikimap' : $filteriw = isset($params['filteriw']) ? $params['filteriw'] : false; $this->appendInterwikiMap($p, $filteriw); @@ -128,6 +131,20 @@ class ApiQuerySiteinfo extends ApiQueryBase { $this->getResult()->addValue('query', $property, $data); } + protected function appendSpecialPageAliases($property) + { + global $wgLang; + $data = array(); + foreach($wgLang->getSpecialPageAliases() as $specialpage => $aliases) + { + $arr = array('realname' => $specialpage, 'aliases' => $aliases); + $this->getResult()->setIndexedTagName($arr['aliases'], 'alias'); + $data[] = $arr; + } + $this->getResult()->setIndexedTagName($data, 'specialpage'); + $this->getResult()->addValue('query', $property, $data); + } + protected function appendInterwikiMap($property, $filter) { $this->resetQueryParams(); @@ -216,6 +233,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { 'general', 'namespaces', 'namespacealiases', + 'specialpagealiases', 'interwikimap', 'dbrepllag', 'statistics', @@ -238,6 +256,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { ' "general" - Overall system information', ' "namespaces" - List of registered namespaces (localized)', ' "namespacealiases" - List of registered namespace aliases', + ' "specialpagealiases" - List of special page aliases', ' "statistics" - Returns site statistics', ' "interwikimap" - Returns interwiki map (optionally filtered)', ' "dbrepllag" - Returns database server with the highest replication lag', -- 2.20.1