< Manual:Hooks
MimeMagicInit | |
---|---|
Available from version 1.24.0 (Gerrit change 141240) Before processing the list mapping MIME types to media types and the list mapping MIME types to file extensions. As an extension author, you are encouraged to submit patches to MediaWiki's core to add new MIME types to mime.types. | |
Define function: | public static function onMimeMagicInit( $mime ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"MimeMagicInit": "MyExtensionHooks::onMimeMagicInit"
}
}
|
Called from: | File(s): ServiceWiring.php Function(s): MimeAnalyzer::initCallback |
Interface: | MimeMagicInitHook.php |
For more information about attaching hooks, see Manual:Hooks
For examples of extensions using this hook, see Category:MimeMagicInit extensions.
Details
$mime: Instance of MimeAnalyzer; $mime->addExtraTypes( 'application/xml svg' );
- Use
$mime->addExtraInfo( $stringOfInfo );
to add new MIME info to the list. - Use
$mime->addExtraTypes( $stringOfTypes );
to add new MIME types to the list.
See also
- Manual:MIME type detection, example of using this hook to add recognition of more file file extensions.
$wgFileExtensions
, control which file extensions may be used during upload.
- Built-in mime info and media types: MimeMap.php.
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.