Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -73,6 +73,9 @@ |
74 | 74 | case 'usergroups': |
75 | 75 | $this->appendUserGroups( $p ); |
76 | 76 | break; |
| 77 | + case 'extensions': |
| 78 | + $this->appendExtensions( $p ); |
| 79 | + break; |
77 | 80 | default : |
78 | 81 | ApiBase :: dieDebug( __METHOD__, "Unknown prop=$p" ); |
79 | 82 | } |
— | — | @@ -183,7 +186,6 @@ |
184 | 187 | $this->getResult()->setIndexedTagName($data, 'magicword'); |
185 | 188 | $this->getResult()->addValue('query', $property, $data); |
186 | 189 | } |
187 | | - |
188 | 190 | |
189 | 191 | protected function appendInterwikiMap( $property, $filter ) { |
190 | 192 | $this->resetQueryParams(); |
— | — | @@ -278,6 +280,40 @@ |
279 | 281 | $this->getResult()->addValue( 'query', $property, $data ); |
280 | 282 | } |
281 | 283 | |
| 284 | + protected function appendExtensions( $property ) { |
| 285 | + global $wgExtensionCredits; |
| 286 | + $data = array(); |
| 287 | + foreach ( $wgExtensionCredits as $type => $extensions ) { |
| 288 | + foreach ( $extensions as $ext ) { |
| 289 | + $ret = array(); |
| 290 | + $ret['type'] = $type; |
| 291 | + if ( isset( $ext['name'] ) ) |
| 292 | + $ret['name'] = $ext['name']; |
| 293 | + if ( isset( $ext['description'] ) ) |
| 294 | + $ret['description'] = $ext['description']; |
| 295 | + if ( isset( $ext['descriptionmsg'] ) ) |
| 296 | + $ret['descriptionmsg'] = $ext['descriptionmsg']; |
| 297 | + if ( isset( $ext['author'] ) ) { |
| 298 | + $ret['author'] = is_array( $ext['author'] ) ? |
| 299 | + implode( ', ', $ext['author' ] ) : $ext['author']; |
| 300 | + } |
| 301 | + if ( isset( $ext['version'] ) ) { |
| 302 | + $ret['version'] = $ext['version']; |
| 303 | + } elseif ( isset( $ext['svn-revision'] ) && |
| 304 | + preg_match( '/\$(?:Rev|LastChangedRevision|Revision): *(\d+)/', |
| 305 | + $ext['svn-revision'], $m ) ) |
| 306 | + { |
| 307 | + $ret['version'] = 'r' . $m[1]; |
| 308 | + } |
| 309 | + $data[] = $ret; |
| 310 | + } |
| 311 | + } |
| 312 | + |
| 313 | + $this->getResult()->setIndexedTagName( $data, 'ext' ); |
| 314 | + $this->getResult()->addValue( 'query', $property, $data ); |
| 315 | + } |
| 316 | + |
| 317 | + |
282 | 318 | public function getAllowedParams() { |
283 | 319 | return array( |
284 | 320 | 'prop' => array( |
— | — | @@ -293,6 +329,7 @@ |
294 | 330 | 'dbrepllag', |
295 | 331 | 'statistics', |
296 | 332 | 'usergroups', |
| 333 | + 'extensions', |
297 | 334 | ) |
298 | 335 | ), |
299 | 336 | 'filteriw' => array( |
— | — | @@ -318,6 +355,7 @@ |
319 | 356 | ' "interwikimap" - Returns interwiki map (optionally filtered)', |
320 | 357 | ' "dbrepllag" - Returns database server with the highest replication lag', |
321 | 358 | ' "usergroups" - Returns user groups and the associated permissions', |
| 359 | + ' "extensions" - Returns extensions installed on the wiki', |
322 | 360 | ), |
323 | 361 | 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map', |
324 | 362 | 'showalldb' => 'List all database servers, not just the one lagging the most', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -520,6 +520,7 @@ |
521 | 521 | * (bug 15579) clshow considers all categories !hidden |
522 | 522 | * (bug 16647) list=allcategories, prop=categories don't return "hidden" |
523 | 523 | property for hidden categories |
| 524 | +* New siprop parameter of 'extensions' to list all installed extensions |
524 | 525 | |
525 | 526 | === Languages updated in 1.14 === |
526 | 527 | |