Merge "mediawiki.api: Remove console warning for legacy token type"
[mediawiki.git] / includes / page / Hook / OpportunisticLinksUpdateHook.php
blobb61210290419eab3e9305d5eeb2e9afa2a4dd59b
1 <?php
3 namespace MediaWiki\Page\Hook;
5 use MediaWiki\Parser\ParserOutput;
6 use MediaWiki\Title\Title;
7 use WikiPage;
9 /**
10 * This is a hook handler interface, see docs/Hooks.md.
11 * Use the hook name "OpportunisticLinksUpdate" to register handlers implementing this interface.
13 * @stable to implement
14 * @ingroup Hooks
16 interface OpportunisticLinksUpdateHook {
17 /**
18 * This hook is called by WikiPage::triggerOpportunisticLinksUpdate
19 * when a page view triggers a re-rendering of the page. This may happen
20 * particularly if the parser cache is split by user language, and no cached
21 * rendering of the page exists in the user's language. The hook is called
22 * before checking whether page_links_updated indicates that the links are up
23 * to date.
25 * @since 1.35
27 * @param WikiPage $page WikiPage that was rendered
28 * @param Title $title Title of the rendered page
29 * @param ParserOutput $parserOutput ParserOutput resulting from rendering the page
30 * @return bool|void True or no return value to continue, or false to abort
31 * triggerOpportunisticLinksUpdate() without triggering any updates
33 public function onOpportunisticLinksUpdate( $page, $title, $parserOutput );