Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -88,6 +88,12 @@ |
89 | 89 | case 'skins': |
90 | 90 | $fit = $this->appendSkins( $p ); |
91 | 91 | break; |
| 92 | + case 'extensiontags': |
| 93 | + $fit = $this->appendExtensionTags( $p ); |
| 94 | + break; |
| 95 | + case 'functionhooks': |
| 96 | + $fit = $this->appendFunctionHooks( $p ); |
| 97 | + break; |
92 | 98 | default: |
93 | 99 | ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" ); |
94 | 100 | } |
— | — | @@ -433,7 +439,6 @@ |
434 | 440 | return $this->getResult()->addValue( 'query', $property, $data ); |
435 | 441 | } |
436 | 442 | |
437 | | - |
438 | 443 | protected function appendRightsInfo( $property ) { |
439 | 444 | global $wgRightsPage, $wgRightsUrl, $wgRightsText; |
440 | 445 | $title = Title::newFromText( $wgRightsPage ); |
— | — | @@ -473,6 +478,26 @@ |
474 | 479 | return $this->getResult()->addValue( 'query', $property, $data ); |
475 | 480 | } |
476 | 481 | |
| 482 | + public function appendExtensionTags( $property ) { |
| 483 | + global $wgParser; |
| 484 | + $wgParser->firstCallInit(); |
| 485 | + $tags = array_map( array( $this, 'formatParserTags'), $wgParser->getTags() ); |
| 486 | + $this->getResult()->setIndexedTagName( $tags, 't' ); |
| 487 | + return $this->getResult()->addValue( 'query', $property, $tags ); |
| 488 | + } |
| 489 | + |
| 490 | + public function appendFunctionHooks( $property ) { |
| 491 | + global $wgParser; |
| 492 | + $wgParser->firstCallInit(); |
| 493 | + $hooks = $wgParser->getFunctionHooks(); |
| 494 | + $this->getResult()->setIndexedTagName( $hooks, 'h' ); |
| 495 | + return $this->getResult()->addValue( 'query', $property, $hooks ); |
| 496 | + } |
| 497 | + |
| 498 | + private function formatParserTags( $item ) { |
| 499 | + return "<{$item}>"; |
| 500 | + } |
| 501 | + |
477 | 502 | public function getCacheMode( $params ) { |
478 | 503 | return 'public'; |
479 | 504 | } |
— | — | @@ -497,6 +522,8 @@ |
498 | 523 | 'rightsinfo', |
499 | 524 | 'languages', |
500 | 525 | 'skins', |
| 526 | + 'extensiontags', |
| 527 | + 'functionhooks', |
501 | 528 | ) |
502 | 529 | ), |
503 | 530 | 'filteriw' => array( |
— | — | @@ -528,6 +555,8 @@ |
529 | 556 | ' rightsinfo - Returns wiki rights (license) information if available', |
530 | 557 | ' languages - Returns a list of languages MediaWiki supports', |
531 | 558 | ' skins - Returns a list of all enabled skins', |
| 559 | + ' extensiontags - Returns a list of parser extension tags', |
| 560 | + ' functionhooks - Returns a list of parser function hooks', |
532 | 561 | ), |
533 | 562 | 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map', |
534 | 563 | 'showalldb' => 'List all database servers, not just the one lagging the most', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -364,6 +364,8 @@ |
365 | 365 | * (bug 27344) add drprefix param to list=deletedrevs. |
366 | 366 | * (bug 28560) list=deletedrevs should die, if combination of param is invalid. |
367 | 367 | * (bug 28238) paraminfo: output both limits for multi param |
| 368 | +* (bug 27179) API: List of extension tags through meta=siteinfo |
| 369 | +* Get a list of function hooks through meta=siteinfo |
368 | 370 | |
369 | 371 | === Languages updated in 1.18 === |
370 | 372 | |