2020-03-03 22:50:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Interwiki\Hook;
|
|
|
|
|
|
|
|
|
|
/**
|
2020-09-26 13:18:43 +00:00
|
|
|
* This is a hook handler interface, see docs/Hooks.md.
|
|
|
|
|
* Use the hook name "InterwikiLoadPrefix" to register handlers implementing this interface.
|
|
|
|
|
*
|
2021-05-17 19:50:12 +00:00
|
|
|
* @deprecated Does not support enumerating all valid prefixes; for testing
|
|
|
|
|
* purposes (re)set $wgInterwikiCache instead.
|
2020-07-13 09:05:49 +00:00
|
|
|
* @stable to implement
|
2020-03-03 22:50:34 +00:00
|
|
|
* @ingroup Hooks
|
|
|
|
|
*/
|
|
|
|
|
interface InterwikiLoadPrefixHook {
|
|
|
|
|
/**
|
2020-03-16 23:31:05 +00:00
|
|
|
* This hook is called when resolving whether a given prefix is an interwiki or not.
|
2020-03-03 22:50:34 +00:00
|
|
|
*
|
|
|
|
|
* @since 1.35
|
|
|
|
|
*
|
2020-03-16 23:31:05 +00:00
|
|
|
* @param string $prefix Interwiki prefix we are looking for
|
|
|
|
|
* @param array &$iwData Output array describing the interwiki with keys iw_url, iw_local,
|
|
|
|
|
* iw_trans and optionally iw_api and iw_wikiid
|
|
|
|
|
* @return bool|void True (or no return value) without providing an interwiki to continue
|
|
|
|
|
* interwiki search, or false to abort
|
2020-03-03 22:50:34 +00:00
|
|
|
*/
|
|
|
|
|
public function onInterwikiLoadPrefix( $prefix, &$iwData );
|
|
|
|
|
}
|