wiki.techinc.nl/includes/api/Hook/APIQueryRecentChangesTokensHook.php
Tim Starling f5aaf75ad1 Automatically generated hook interfaces
Add hook interfaces which were generated by a script which parses
hooks.txt and identifies caller namespaces and directories.

Hook interfaces are mostly placed in a Hook/ subdirectory
relative to the caller location. When there are callers in multiple
directories, a "primary" caller was manually selected. The exceptions to
this are:

* The source root, maintenance and tests, which use includes/Hook. Test
  hooks need to be autoloadable in a non-test request so that
  implementing test interfaces in a generic handler will not fail.
* resources uses includes/resourceloader/Hook
* The following third-level subdirectories had their hooks placed in
  the parent ../Hook:
    * includes/filerepo/file
    * includes/search/searchwidgets
    * includes/specials/forms
    * includes/specials/helpers
    * includes/specials/pagers

Parameters marked as legacy references in hooks.txt are passed
by value in the interfaces.

Bug: T240307
Change-Id: I6efe2e7dd1f0c6a3d0f4d100a4c34e41f8428720
2020-04-20 13:31:05 +10:00

29 lines
1.1 KiB
PHP

<?php
namespace MediaWiki\Api\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface APIQueryRecentChangesTokensHook {
/**
* DEPRECATED since 1.24! Use
* ApiQueryTokensRegisterTypes instead.
* Use this hook to add custom tokens to list=recentchanges. Every token has an
* action, which will be used in the rctoken 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, $rc), where $pageid is the page ID of the
* page associated to the revision the token is requested for, $title the
* associated Title object and $rc the associated RecentChange object. In the
* hook, just add your callback to the $tokenFunctions array and return true
* (returning false makes no sense).
*
* @since 1.35
*
* @param ?mixed &$tokenFunctions [ action => callback ]
* @return bool|void True or no return value to continue or false to abort
*/
public function onAPIQueryRecentChangesTokens( &$tokenFunctions );
}