Available from version 1.24.0 (Gerrit change 141240)
Allows MW extensions guess the MIME by content.
Define function:
public static function onMimeMagicGuessFromContent( $mimeAnalyzer, &$head, &$tail, $file, &$mime ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"MimeMagicGuessFromContent": "MyExtensionHooks::onMimeMagicGuessFromContent"

For MediaWiki ≤1.25:

$wgHooks['MimeMagicGuessFromContent'][] = 'MyExtensionHooks::onMimeMagicGuessFromContent';
Called from:File(s): ServiceWiring.php
Function(s): MimeAnalyzer::guessCallback

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:MimeMagicGuessFromContent extensions.


Instance of MimeMagic.
First 1024 bytes of the file in a string (in - Do not alter!).
More or equal than last 65558 bytes of the file in a string (input only - passed by reference for performance - do not alter!).
File path.
MIME type (out).