r47266 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47265‎ | r47266 | r47267 >
Date:14:56, 14 February 2009
Author:catrope
Status:ok
Tags:
Comment:
API: Make information about the main module (ApiMain) and the pageset module (ApiPageSet) available through action=paraminfo
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiParamInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParamInfo.php
@@ -41,6 +41,7 @@
4242 // Get parameters
4343 $params = $this->extractRequestParams();
4444 $result = $this->getResult();
 45+ $queryObj = new ApiQuery($this->getMain(), 'query');
4546 $r = array();
4647 if(is_array($params['modules']))
4748 {
@@ -61,7 +62,6 @@
6263 }
6364 if(is_array($params['querymodules']))
6465 {
65 - $queryObj = new ApiQuery($this->getMain(), 'query');
6666 $qmodArr = $queryObj->getModules();
6767 foreach($params['querymodules'] as $qm)
6868 {
@@ -77,6 +77,13 @@
7878 }
7979 $result->setIndexedTagName($r['querymodules'], 'module');
8080 }
 81+ if($params['mainmodule'])
 82+ $r['mainmodule'] = $this->getClassInfo($this->getMain());
 83+ if($params['pagesetmodule'])
 84+ {
 85+ $pageSet = new ApiPageSet($queryObj);
 86+ $r['pagesetmodule'] = $this->getClassInfo($pageSet);
 87+ }
8188 $result->addValue(null, $this->getModuleName(), $r);
8289 }
8390
@@ -147,7 +154,9 @@
148155 ),
149156 'querymodules' => array(
150157 ApiBase :: PARAM_ISMULTI => true
151 - )
 158+ ),
 159+ 'mainmodule' => false,
 160+ 'pagesetmodule' => false,
152161 );
153162 }
154163
@@ -155,6 +164,8 @@
156165 return array (
157166 'modules' => 'List of module names (value of the action= parameter)',
158167 'querymodules' => 'List of query module names (value of prop=, meta= or list= parameter)',
 168+ 'mainmodule' => 'Get information about the main (top-level) module as well',
 169+ 'pagesetmodule' => 'Get information about the pageset module (providing titles= and friends) as well',
159170 );
160171 }
161172
Index: trunk/phase3/RELEASE-NOTES
@@ -200,6 +200,7 @@
201201 * (bug 17357) Added movesubpages parameter to action=move
202202 * (bug 17433) Added bot flag to list=watchlist&wlprop=flags output
203203 * (bug 16740) Added list=protectedtitles
 204+* Added mainmodule and pagesetmodule parameters to action=paraminfo
204205
205206 === Languages updated in 1.15 ===
206207

Status & tagging log