| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Page\Hook; |
| 4 | |
| 5 | use MediaWiki\Parser\ParserOutput; |
| 6 | use MediaWiki\Title\Title; |
| 7 | use WikiPage; |
| 8 | |
| 9 | /** |
| 10 | * This is a hook handler interface, see docs/Hooks.md. |
| 11 | * Use the hook name "OpportunisticLinksUpdate" to register handlers implementing this interface. |
| 12 | * |
| 13 | * @stable to implement |
| 14 | * @ingroup Hooks |
| 15 | */ |
| 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. |
| 24 | * |
| 25 | * @since 1.35 |
| 26 | * |
| 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 |
| 32 | */ |
| 33 | public function onOpportunisticLinksUpdate( $page, $title, $parserOutput ); |
| 34 | } |