2020-03-03 22:50:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Api\Hook;
|
|
|
|
|
|
|
|
|
|
/**
|
2020-03-16 23:31:05 +00:00
|
|
|
* @deprecated since 1.24 Use ApiQueryTokensRegisterTypes instead.
|
2020-03-03 22:50:34 +00:00
|
|
|
* @ingroup Hooks
|
|
|
|
|
*/
|
|
|
|
|
interface APIQueryInfoTokensHook {
|
|
|
|
|
/**
|
2020-03-16 23:31:05 +00:00
|
|
|
* Use this hook to add custom tokens to prop=info. Every token has an
|
2020-03-03 22:50:34 +00:00
|
|
|
* action, which will be used in the intoken parameter and in the output
|
|
|
|
|
* (actiontoken="..."), and a callback function which should return the token, or
|
|
|
|
|
* false if the user isn't allowed to obtain it. The prototype of the callback
|
|
|
|
|
* function is func($pageid, $title), where $pageid is the page ID of the page the
|
|
|
|
|
* token is requested for and $title is the associated Title object. In the hook,
|
2020-03-16 23:31:05 +00:00
|
|
|
* add your callback to the $tokenFunctions array and return true (returning
|
2020-03-03 22:50:34 +00:00
|
|
|
* false makes no sense).
|
|
|
|
|
*
|
|
|
|
|
* @since 1.35
|
|
|
|
|
*
|
2020-03-16 23:31:05 +00:00
|
|
|
* @param array &$tokenFunctions [ action => callback ]
|
|
|
|
|
* @return bool|void True or no return value
|
2020-03-03 22:50:34 +00:00
|
|
|
*/
|
|
|
|
|
public function onAPIQueryInfoTokens( &$tokenFunctions );
|
|
|
|
|
}
|