| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | use MediaWiki\Output\OutputPage; |
| 6 | use MediaWiki\Request\WebRequest; |
| 7 | use MediaWiki\Title\Title; |
| 8 | |
| 9 | /** |
| 10 | * This is a hook handler interface, see docs/Hooks.md. |
| 11 | * Use the hook name "TestCanonicalRedirect" to register handlers implementing this interface. |
| 12 | * |
| 13 | * @stable to implement |
| 14 | * @ingroup Hooks |
| 15 | */ |
| 16 | interface TestCanonicalRedirectHook { |
| 17 | /** |
| 18 | * This hook is called when about to force a redirect to a canonical |
| 19 | * URL for a title when we have no other parameters on the URL. Use this |
| 20 | * hook to alter page view behavior radically to abort that redirect or |
| 21 | * handle it manually. |
| 22 | * |
| 23 | * @since 1.35 |
| 24 | * |
| 25 | * @param WebRequest $request |
| 26 | * @param Title $title Title of the currently found Title object |
| 27 | * @param OutputPage $output |
| 28 | * @return bool|void True or no return value to continue or false to abort |
| 29 | */ |
| 30 | public function onTestCanonicalRedirect( $request, $title, $output ); |
| 31 | } |