Manual:Hooks/MimeMagicImproveFromExtension
MimeMagicImproveFromExtension | |
---|---|
Available from version 1.24.0 (Gerrit change 141240) Allows MW extensions to further improve the MIME type detected by considering the file extension. | |
Define function: | public static function onMimeMagicImproveFromExtension( $mimeAnalyzer, $ext, &$mime ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"MimeMagicImproveFromExtension": "MediaWiki\\Extension\\MyExtension\\Hooks::onMimeMagicImproveFromExtension"
}
}
|
Called from: | File(s): ServiceWiring.php Function(s): MimeAnalyzer::extCallback |
Interface: | MimeMagicImproveFromExtensionHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:MimeMagicImproveFromExtension extensions.
Details
edit- $mimeMagic
- Instance of MimeMagic.
- $ext
- File extension.
- &$mime
- MIME type (in/out).