* (bug 28238) paraminfo: output both limits for multi param
* (bug 27179) API: List of extension tags through meta=siteinfo
* Get a list of function hooks through meta=siteinfo
+* Get a list of all subscribed hooks, and those subscribers
=== Languages updated in 1.18 ===
case 'functionhooks':
$fit = $this->appendFunctionHooks( $p );
break;
+ case 'showhooks':
+ $fit = $this->appendSubscribedHooks( $p );
+ break;
default:
ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" );
}
return "<{$item}>";
}
+ public function appendSubscribedHooks( $property ) {
+ global $wgHooks;
+ $myWgHooks = $wgHooks;
+ ksort( $myWgHooks );
+
+ $data = array();
+ foreach ( $myWgHooks as $hook => $hooks ) {
+ $arr = array(
+ 'name' => $hook,
+ 'subscribers' => $hooks,
+ );
+
+ $this->getResult()->setIndexedTagName( $arr['subscribers'], 's' );
+ $data[] = $arr;
+ }
+
+ $this->getResult()->setIndexedTagName( $data, 'hook' );
+ return $this->getResult()->addValue( 'query', $property, $data );
+ }
+
public function getCacheMode( $params ) {
return 'public';
}
'skins',
'extensiontags',
'functionhooks',
+ 'showhooks',
)
),
'filteriw' => array(
' skins - Returns a list of all enabled skins',
' extensiontags - Returns a list of parser extension tags',
' functionhooks - Returns a list of parser function hooks',
+ ' showhooks - Returns a list of all subscribed hooks (contents of $wgHooks)'
),
'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
'showalldb' => 'List all database servers, not just the one lagging the most',