| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Content\Hook; |
| 4 | |
| 5 | use DifferenceEngine; |
| 6 | use MediaWiki\Context\IContextSource; |
| 7 | |
| 8 | /** |
| 9 | * This is a hook handler interface, see docs/Hooks.md. |
| 10 | * Use the hook name "GetDifferenceEngine" to register handlers implementing this interface. |
| 11 | * |
| 12 | * @stable to implement |
| 13 | * @ingroup Hooks |
| 14 | */ |
| 15 | interface GetDifferenceEngineHook { |
| 16 | /** |
| 17 | * This hook is called when getting a new difference engine interface object. |
| 18 | * Use this hook to decorate or replace the default difference engine. |
| 19 | * |
| 20 | * @since 1.35 |
| 21 | * |
| 22 | * @param IContextSource $context IContextSource context to be used for diff |
| 23 | * @param int $old Revision ID to show and diff with |
| 24 | * @param int|string $new Either a revision ID or one of the strings 'cur', 'prev' or 'next' |
| 25 | * @param bool $refreshCache If set, refreshes the diff cache |
| 26 | * @param bool $unhide If set, allow viewing deleted revs |
| 27 | * @param DifferenceEngine &$differenceEngine Difference engine object to be used for the diff |
| 28 | * @return bool|void True or no return value to continue or false to abort |
| 29 | */ |
| 30 | public function onGetDifferenceEngine( $context, $old, $new, $refreshCache, |
| 31 | $unhide, &$differenceEngine |
| 32 | ); |
| 33 | } |