Manual:Hooks/FileTransformed
From Linux Web Expert
FileTransformed | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate> When a file is transformed and moved into storage. | |
<translate> Define function:</translate> | public static function onFileTransformed( $file, $thumb, $tmpThumbPath, $thumbPath ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"FileTransformed": "MediaWiki\\Extension\\MyExtension\\Hooks::onFileTransformed"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> File.php |
<translate> Interface:</translate> | FileTransformedHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:FileTransformed extensions</tvar>.</translate>
Details
- $file: reference to the File object
- $thumb: the MediaTransformOutput object
- $tmpThumbPath: The temporary file system path of the transformed file
- $thumbPath: The permanent storage path of the transformed file