Manual:Hooks/FileTransformed

From Linux Web Expert

Revision as of 15:03, 3 March 2021 by imported>Baris6161TURK
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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