Add hook interfaces which were generated by a script which parses
hooks.txt and identifies caller namespaces and directories.
Hook interfaces are mostly placed in a Hook/ subdirectory
relative to the caller location. When there are callers in multiple
directories, a "primary" caller was manually selected. The exceptions to
this are:
* The source root, maintenance and tests, which use includes/Hook. Test
hooks need to be autoloadable in a non-test request so that
implementing test interfaces in a generic handler will not fail.
* resources uses includes/resourceloader/Hook
* The following third-level subdirectories had their hooks placed in
the parent ../Hook:
* includes/filerepo/file
* includes/search/searchwidgets
* includes/specials/forms
* includes/specials/helpers
* includes/specials/pagers
Parameters marked as legacy references in hooks.txt are passed
by value in the interfaces.
Bug: T240307
Change-Id: I6efe2e7dd1f0c6a3d0f4d100a4c34e41f8428720
34 lines
1.4 KiB
PHP
34 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Hook;
|
|
|
|
/**
|
|
* @stable for implementation
|
|
* @ingroup Hooks
|
|
*/
|
|
interface ImageBeforeProduceHTMLHook {
|
|
/**
|
|
* Called before producing the HTML created by a wiki
|
|
* image insertion. You can skip the default logic entirely by returning false, or
|
|
* just modify a few things using call-by-reference.
|
|
*
|
|
* @since 1.35
|
|
*
|
|
* @param ?mixed $skin Skin object
|
|
* @param ?mixed &$title Title object of the image
|
|
* @param ?mixed &$file File object, or false if it doesn't exist
|
|
* @param ?mixed &$frameParams Various parameters with special meanings; see documentation in
|
|
* includes/Linker.php for Linker::makeImageLink
|
|
* @param ?mixed &$handlerParams Various parameters with special meanings; see documentation in
|
|
* includes/Linker.php for Linker::makeImageLink
|
|
* @param ?mixed &$time Timestamp of file in 'YYYYMMDDHHIISS' string form, or false for current
|
|
* @param ?mixed &$res Final HTML output, used if you return false
|
|
* @param ?mixed $parser Parser instance
|
|
* @param ?mixed &$query Query params for desc URL
|
|
* @param ?mixed &$widthOption Used by the parser to remember the user preference thumbnailsize
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
*/
|
|
public function onImageBeforeProduceHTML( $skin, &$title, &$file,
|
|
&$frameParams, &$handlerParams, &$time, &$res, $parser, &$query, &$widthOption
|
|
);
|
|
}
|