wiki.techinc.nl/includes/interwiki/Hook/InterwikiLoadPrefixHook.php
C. Scott Ananian 3d40c43b1f Deprecate InterwikiLoadPrefix hook
The InterwikiLoadPrefix hook isn't compatible with Parsoid, as it is
unidirectional and doesn't support enumerating all valid prefixes
(T270444).  Set/reset $wgInterwikiCache to mock the interwiki table
for parserTests and other unit tests instead.

This is a soft deprecation, as the used-in-production
Extension:Interwiki still uses InterwikiLoadPrefix, although not in a
way that would break Parsoid (since $wgInterwikiCache is set in
production).

Bug: T270444
Change-Id: If2507017c99c4ee42c104a0890bc45a84d7239d5
2020-12-21 19:28:48 +00:00

27 lines
931 B
PHP

<?php
namespace MediaWiki\Interwiki\Hook;
/**
* This is a hook handler interface, see docs/Hooks.md.
* Use the hook name "InterwikiLoadPrefix" to register handlers implementing this interface.
*
* @stable to implement
* @ingroup Hooks
*/
interface InterwikiLoadPrefixHook {
/**
* This hook is called when resolving whether a given prefix is an interwiki or not.
*
* @since 1.35
* @deprecated Does not support enumerating all valid prefixes; for testing
* purposes (re)set $wgInterwikiCache instead.
*
* @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
*/
public function onInterwikiLoadPrefix( $prefix, &$iwData );
}