MediaWiki master
MediaWiki\Hook\FileUploadHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inherited by MediaWiki\HookContainer\HookRunner.

Public Member Functions

 onFileUpload ( $file, $reupload, $hasDescription)
 This hook is called when a file upload occurs.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "FileUpload" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 14 of file FileUploadHook.php.

Member Function Documentation

◆ onFileUpload()

MediaWiki\Hook\FileUploadHook::onFileUpload ( $file,
$reupload,
$hasDescription )

This hook is called when a file upload occurs.

Since
1.35
Parameters
File$fileImage object representing the file that was uploaded
bool$reuploadBoolean indicating if there was a previously another image there or not (since 1.17)
bool$hasDescriptionBoolean indicating that there was already a description page and a new one from the comment wasn't created (since 1.17)
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: