r32538 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32537‎ | r32538 | r32539 >
Date:12:47, 28 March 2008
Author:catrope
Status:old
Tags:
Comment:
(bug 13541) Adding siprop=specialpagealiases to meta=siteinfo
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -56,6 +56,9 @@
5757 case 'namespacealiases' :
5858 $this->appendNamespaceAliases($p);
5959 break;
 60+ case 'specialpagealiases' :
 61+ $this->appendSpecialPageAliases($p);
 62+ break;
6063 case 'interwikimap' :
6164 $filteriw = isset($params['filteriw']) ? $params['filteriw'] : false;
6265 $this->appendInterwikiMap($p, $filteriw);
@@ -128,6 +131,20 @@
129132 $this->getResult()->addValue('query', $property, $data);
130133 }
131134
 135+ protected function appendSpecialPageAliases($property)
 136+ {
 137+ global $wgLang;
 138+ $data = array();
 139+ foreach($wgLang->getSpecialPageAliases() as $specialpage => $aliases)
 140+ {
 141+ $arr = array('realname' => $specialpage, 'aliases' => $aliases);
 142+ $this->getResult()->setIndexedTagName($arr['aliases'], 'alias');
 143+ $data[] = $arr;
 144+ }
 145+ $this->getResult()->setIndexedTagName($data, 'specialpage');
 146+ $this->getResult()->addValue('query', $property, $data);
 147+ }
 148+
132149 protected function appendInterwikiMap($property, $filter) {
133150
134151 $this->resetQueryParams();
@@ -216,6 +233,7 @@
217234 'general',
218235 'namespaces',
219236 'namespacealiases',
 237+ 'specialpagealiases',
220238 'interwikimap',
221239 'dbrepllag',
222240 'statistics',
@@ -238,6 +256,7 @@
239257 ' "general" - Overall system information',
240258 ' "namespaces" - List of registered namespaces (localized)',
241259 ' "namespacealiases" - List of registered namespace aliases',
 260+ ' "specialpagealiases" - List of special page aliases',
242261 ' "statistics" - Returns site statistics',
243262 ' "interwikimap" - Returns interwiki map (optionally filtered)',
244263 ' "dbrepllag" - Returns database server with the highest replication lag',
Index: trunk/phase3/RELEASE-NOTES
@@ -171,6 +171,7 @@
172172 * Added createonly parameter to action=edit
173173 * Replaced $wgAPIUCUserPrefixMinLength by the more generic $wgAPIMaxDBRows
174174 * (bug 11719) Remove trailing blanks in YAML output.
 175+* (bug 13541) Added siprop=specialpagealiases to meta=siteinfo
175176
176177 === Languages updated in 1.13 ===
177178

Status & tagging log