86 application/ogg ogx ogg ogm ogv oga spx
88 application/vnd.oasis.opendocument.chart odc
89 application/vnd.oasis.opendocument.chart-
template otc
90 application/vnd.oasis.opendocument.database odb
91 application/vnd.oasis.opendocument.formula odf
92 application/vnd.oasis.opendocument.formula-
template otf
93 application/vnd.oasis.opendocument.graphics odg
94 application/vnd.oasis.opendocument.graphics-
template otg
95 application/vnd.oasis.opendocument.image odi
96 application/vnd.oasis.opendocument.image-
template oti
97 application/vnd.oasis.opendocument.presentation odp
98 application/vnd.oasis.opendocument.presentation-
template otp
99 application/vnd.oasis.opendocument.spreadsheet ods
100 application/vnd.oasis.opendocument.spreadsheet-
template ots
101 application/vnd.oasis.opendocument.text odt
102 application/vnd.oasis.opendocument.text-master otm
103 application/vnd.oasis.opendocument.text-
template ott
104 application/vnd.oasis.opendocument.text-web oth
105 application/javascript js
106 application/x-shockwave-flash swf
107 audio/midi mid midi kar
108 audio/mpeg mpga mpa mp2 mp3
109 audio/x-aiff aif aiff aifc
111 audio/ogg oga spx ogg
114 image/jpeg jpeg jpg jpe
122 image/x-portable-pixmap ppm
126 video/ogg ogv ogm ogg
137 application/pdf [OFFICE]
138 application/vnd.oasis.opendocument.chart [OFFICE]
139 application/vnd.oasis.opendocument.chart-
template [OFFICE]
140 application/vnd.oasis.opendocument.database [OFFICE]
141 application/vnd.oasis.opendocument.formula [OFFICE]
142 application/vnd.oasis.opendocument.formula-
template [OFFICE]
143 application/vnd.oasis.opendocument.graphics [OFFICE]
144 application/vnd.oasis.opendocument.graphics-
template [OFFICE]
145 application/vnd.oasis.opendocument.image [OFFICE]
146 application/vnd.oasis.opendocument.image-
template [OFFICE]
147 application/vnd.oasis.opendocument.presentation [OFFICE]
148 application/vnd.oasis.opendocument.presentation-
template [OFFICE]
149 application/vnd.oasis.opendocument.spreadsheet [OFFICE]
150 application/vnd.oasis.opendocument.spreadsheet-
template [OFFICE]
151 application/vnd.oasis.opendocument.text [OFFICE]
152 application/vnd.oasis.opendocument.text-
template [OFFICE]
153 application/vnd.oasis.opendocument.text-master [OFFICE]
154 application/vnd.oasis.opendocument.text-web [OFFICE]
155 application/javascript
text/javascript application/x-javascript [EXECUTABLE]
156 application/x-shockwave-flash [MULTIMEDIA]
160 audio/mp3 audio/mpeg [AUDIO]
161 application/ogg audio/ogg video/ogg [MULTIMEDIA]
162 image/x-bmp image/x-ms-bmp image/bmp [BITMAP]
166 image/svg+xml [DRAWING]
168 image/vnd.djvu [BITMAP]
170 image/x-portable-pixmap [BITMAP]
175 unknown/unknown application/octet-stream application/x-empty [UNKNOWN]
194 $this->typeFile = $params[
'typeFile'];
195 $this->infoFile = $params[
'infoFile'];
196 $this->xmlTypes = $params[
'xmlTypes'];
197 $this->initCallback = isset( $params[
'initCallback'] )
198 ? $params[
'initCallback']
200 $this->detectCallback = isset( $params[
'detectCallback'] )
201 ? $params[
'detectCallback']
203 $this->guessCallback = isset( $params[
'guessCallback'] )
204 ? $params[
'guessCallback']
206 $this->extCallback = isset( $params[
'extCallback'] )
207 ? $params[
'extCallback']
209 $this->logger = isset( $params[
'logger'] )
211 : new \Psr\Log\NullLogger();
221 # Allow media handling extensions adding MIME-types and MIME-info
222 if ( $this->initCallback ) {
223 call_user_func( $this->initCallback, $this );
226 $types = self::$wellKnownTypes;
229 if ( $mimeTypeFile ) {
230 if ( is_file( $mimeTypeFile ) && is_readable( $mimeTypeFile ) ) {
231 $this->logger->info( __METHOD__ .
": loading mime types from $mimeTypeFile\n" );
233 $types .= file_get_contents( $mimeTypeFile );
235 $this->logger->info( __METHOD__ .
": can't load mime types from $mimeTypeFile\n" );
238 $this->logger->info( __METHOD__ .
239 ": no mime types file defined, using built-ins only.\n" );
244 $types = str_replace( [
"\r\n",
"\n\r",
"\n\n",
"\r\r",
"\r" ],
"\n", $types );
245 $types = str_replace(
"\t",
" ", $types );
247 $this->mimetoExt = [];
248 $this->mExtToMime = [];
250 $lines = explode(
"\n", $types );
256 if ( strpos( $s,
'#' ) === 0 ) {
260 $s = strtolower( $s );
261 $i = strpos( $s,
' ' );
263 if ( $i ===
false ) {
267 $mime = substr( $s, 0, $i );
268 $ext = trim( substr( $s, $i + 1 ) );
270 if ( empty(
$ext ) ) {
274 if ( !empty( $this->mimetoExt[
$mime] ) ) {
288 if ( !empty( $this->mExtToMime[$e] ) ) {
289 $this->mExtToMime[
$e] .=
' ' .
$mime;
302 $info = self::$wellKnownInfo;
304 if ( $mimeInfoFile ) {
305 if ( is_file( $mimeInfoFile ) && is_readable( $mimeInfoFile ) ) {
306 $this->logger->info( __METHOD__ .
": loading mime info from $mimeInfoFile\n" );
308 $info .= file_get_contents( $mimeInfoFile );
310 $this->logger->info( __METHOD__ .
": can't load mime info from $mimeInfoFile\n" );
313 $this->logger->info( __METHOD__ .
314 ": no mime info file defined, using built-ins only.\n" );
319 $info = str_replace( [
"\r\n",
"\n\r",
"\n\n",
"\r\r",
"\r" ],
"\n", $info );
320 $info = str_replace(
"\t",
" ", $info );
322 $this->mimeTypeAliases = [];
323 $this->mediaTypes = [];
325 $lines = explode(
"\n", $info );
331 if ( strpos( $s,
'#' ) === 0 ) {
335 $s = strtolower( $s );
336 $i = strpos( $s,
' ' );
338 if ( $i ===
false ) {
342 # print "processing MIME INFO line $s<br>";
345 if ( preg_match(
'!\[\s*(\w+)\s*\]!', $s, $match ) ) {
346 $s = preg_replace(
'!\[\s*(\w+)\s*\]!',
'', $s );
347 $mtype = trim( strtoupper( $match[1] ) );
352 $m = explode(
' ', $s );
354 if ( !isset( $this->mediaTypes[$mtype] ) ) {
355 $this->mediaTypes[$mtype] = [];
359 $mime = trim( $mime );
360 if ( empty( $mime ) ) {
364 $this->mediaTypes[$mtype][] =
$mime;
367 if ( count( $m ) > 1 ) {
369 $mCount = count( $m );
370 for ( $i = 1; $i < $mCount; $i += 1 ) {
372 $this->mimeTypeAliases[
$mime] = $main;
389 $this->extraTypes .=
"\n" . $types;
399 $this->extraInfo .=
"\n" . $info;
414 if ( isset( $this->mimetoExt[
$mime] ) ) {
415 return $this->mimetoExt[
$mime];
419 if ( isset( $this->mimeTypeAliases[$mime] ) ) {
420 $mime = $this->mimeTypeAliases[
$mime];
421 if ( isset( $this->mimetoExt[$mime] ) ) {
422 return $this->mimetoExt[
$mime];
439 $r = isset( $this->mExtToMime[
$ext] ) ? $this->mExtToMime[
$ext] : null;
452 if ( is_null( $m ) ) {
458 $m = preg_replace(
'/\s.*$/',
'', $m );
481 $extension = strtolower( $extension );
482 return in_array( $extension,
$ext );
496 'image/gif',
'image/jpeg',
'image/png',
497 'image/x-bmp',
'image/xbm',
'image/tiff',
498 'image/jp2',
'image/jpeg2000',
'image/iff',
499 'image/xbm',
'image/x-xbitmap',
500 'image/vnd.wap.wbmp',
'image/vnd.xiff',
502 'application/x-shockwave-flash',
505 return in_array(
$mime, $types );
523 'gif',
'jpeg',
'jpg',
'png',
'swf',
'psd',
524 'bmp',
'tiff',
'tif',
'jpc',
'jp2',
525 'jpx',
'jb2',
'swc',
'iff',
'wbmp',
529 'djvu',
'ogx',
'ogg',
'ogv',
'oga',
'spx',
530 'mid',
'pdf',
'wmf',
'xcf',
'webm',
'mkv',
'mka',
536 return in_array( strtolower( $extension ), $types );
551 if (
$mime ===
'unknown/unknown' ) {
553 $this->logger->info( __METHOD__ .
': refusing to guess mime type for .' .
554 "$ext file, we should have recognized it\n" );
560 } elseif (
$mime ===
'application/x-opc+zip' ) {
566 $this->logger->info( __METHOD__ .
567 ": refusing to guess better type for $mime file, " .
568 ".$ext is not a known OPC extension.\n" );
569 $mime =
'application/zip';
579 # Media handling extensions can improve the MIME detected
585 if ( isset( $this->mimeTypeAliases[
$mime] ) ) {
586 $mime = $this->mimeTypeAliases[
$mime];
589 $this->logger->info( __METHOD__ .
": improved mime type for .$ext: $mime\n" );
609 $this->logger->info( __METHOD__ .
610 ": WARNING: use of the \$ext parameter is deprecated. " .
611 "Use improveTypeFromExtension(\$mime, \$ext) instead.\n" );
617 $this->logger->info( __METHOD__ .
618 ": internal type detection failed for $file (.$ext)...\n" );
622 if ( isset( $this->mimeTypeAliases[
$mime] ) ) {
623 $mime = $this->mimeTypeAliases[
$mime];
626 $this->logger->info( __METHOD__ .
": guessed mime type of $file: $mime\n" );
642 MediaWiki\suppressWarnings();
643 $f = fopen( $file,
'rb' );
644 MediaWiki\restoreWarnings();
647 return 'unknown/unknown';
650 $fsize = filesize( $file );
651 if ( $fsize ===
false ) {
652 return 'unknown/unknown';
655 $head = fread( $f, 1024 );
656 $tailLength = min( 65558, $fsize );
657 if ( fseek( $f, -1 * $tailLength, SEEK_END ) === -1 ) {
659 "Seeking $tailLength bytes from EOF failed in " . __METHOD__ );
661 $tail = $tailLength ? fread( $f, $tailLength ) :
'';
664 $this->logger->info( __METHOD__ .
665 ": analyzing head and tail of $file for magic numbers.\n" );
670 'MThd' =>
'audio/midi',
671 'OggS' =>
'application/ogg',
675 "\x01\x00\x09\x00" =>
'application/x-msmetafile',
676 "\xd7\xcd\xc6\x9a" =>
'application/x-msmetafile',
677 '%PDF' =>
'application/pdf',
678 'gimp xcf' =>
'image/x-xcf',
681 'MZ' =>
'application/octet-stream',
682 "\xca\xfe\xba\xbe" =>
'application/octet-stream',
683 "\x7fELF" =>
'application/octet-stream',
686 foreach ( $headers
as $magic => $candidate ) {
687 if ( strncmp( $head, $magic, strlen( $magic ) ) == 0 ) {
688 $this->logger->info( __METHOD__ .
689 ": magic header in $file recognized as $candidate\n" );
695 if ( strncmp( $head, pack(
"C4", 0x1a, 0x45, 0xdf, 0xa3 ), 4 ) == 0 ) {
696 $doctype = strpos( $head,
"\x42\x82" );
699 $data = substr( $head, $doctype + 3, 8 );
700 if ( strncmp( $data,
"matroska", 8 ) == 0 ) {
701 $this->logger->info( __METHOD__ .
": recognized file as video/x-matroska\n" );
702 return "video/x-matroska";
703 } elseif ( strncmp( $data,
"webm", 4 ) == 0 ) {
704 $this->logger->info( __METHOD__ .
": recognized file as video/webm\n" );
708 $this->logger->info( __METHOD__ .
": unknown EBML file\n" );
709 return "unknown/unknown";
713 if ( strncmp( $head,
"RIFF", 4 ) == 0 &&
714 strncmp( substr( $head, 8, 7 ),
"WEBPVP8", 7 ) == 0
716 $this->logger->info( __METHOD__ .
": recognized file as image/webp\n" );
732 if ( ( strpos( $head,
'<?php' ) !==
false ) ||
733 ( strpos( $head,
"<\x00?\x00p\x00h\x00p" ) !==
false ) ||
734 ( strpos( $head,
"<\x00?\x00 " ) !==
false ) ||
735 ( strpos( $head,
"<\x00?\x00\n" ) !==
false ) ||
736 ( strpos( $head,
"<\x00?\x00\t" ) !==
false ) ||
737 ( strpos( $head,
"<\x00?\x00=" ) !==
false ) ) {
739 $this->logger->info( __METHOD__ .
": recognized $file as application/x-php\n" );
740 return 'application/x-php';
747 if ( $xml->wellFormed ) {
749 if ( isset(
$xmlTypes[$xml->getRootElement()] ) ) {
750 return $xmlTypes[$xml->getRootElement()];
752 return 'application/xml';
762 if ( substr( $head, 0, 2 ) ==
"#!" ) {
763 $script_type =
"ASCII";
764 } elseif ( substr( $head, 0, 5 ) ==
"\xef\xbb\xbf#!" ) {
765 $script_type =
"UTF-8";
766 } elseif ( substr( $head, 0, 7 ) ==
"\xfe\xff\x00#\x00!" ) {
767 $script_type =
"UTF-16BE";
768 } elseif ( substr( $head, 0, 7 ) ==
"\xff\xfe#\x00!" ) {
769 $script_type =
"UTF-16LE";
772 if ( $script_type ) {
773 if ( $script_type !==
"UTF-8" && $script_type !==
"ASCII" ) {
775 $pack = [
'UTF-16BE' =>
'n*',
'UTF-16LE' =>
'v*' ];
776 $chars = unpack( $pack[$script_type], substr( $head, 2 ) );
778 foreach ( $chars
as $codepoint ) {
779 if ( $codepoint < 128 ) {
780 $head .= chr( $codepoint );
789 if ( preg_match(
'%/?([^\s]+/)(\w+)%', $head, $match ) ) {
790 $mime =
"application/x-{$match[2]}";
791 $this->logger->info( __METHOD__ .
": shell script recognized as $mime\n" );
797 if ( strpos( $tail,
"PK\x05\x06" ) !==
false ) {
798 $this->logger->info( __METHOD__ .
": ZIP header present in $file\n" );
802 MediaWiki\suppressWarnings();
803 $gis = getimagesize( $file );
804 MediaWiki\restoreWarnings();
806 if ( $gis && isset( $gis[
'mime'] ) ) {
807 $mime = $gis[
'mime'];
808 $this->logger->info( __METHOD__ .
": getimagesize detected $file as $mime\n" );
812 # Media handling extensions can guess the MIME by content
813 # It's intentionally here so that if core is wrong about a type (false positive),
814 # people will hopefully nag and submit patches :)
816 # Some strings by reference for performance - assuming well-behaved hooks
819 $callback( $this, $head, $tail, $file,
$mime );
839 if (
$ext ) { # TODO:
remove $ext param
840 $this->logger->info( __METHOD__ .
841 ": WARNING: use of the \$ext parameter is deprecated. " .
842 "Use improveTypeFromExtension(\$mime, \$ext) instead.\n" );
845 $mime =
'application/zip';
855 'presentation-template',
857 'spreadsheet-template',
865 $types =
'(?:' . implode(
'|', $opendocTypes ) .
')';
866 $opendocRegex =
"/^mimetype(application\/vnd\.oasis\.opendocument\.$types)/";
868 $openxmlRegex =
"/^\[Content_Types\].xml/";
872 $this->logger->info( __METHOD__ .
": detected $mime from ZIP archive\n" );
873 } elseif ( preg_match( $openxmlRegex, substr(
$header, 30 ) ) ) {
874 $mime =
"application/x-opc+zip";
875 # TODO: remove the block below, as soon as improveTypeFromExtension is used everywhere
876 if (
$ext !==
true &&
$ext !==
false ) {
887 $mime =
"application/zip";
890 $this->logger->info( __METHOD__ .
891 ": detected an Open Packaging Conventions archive: $mime\n" );
892 } elseif ( substr(
$header, 0, 8 ) ==
"\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1" &&
893 ( $headerpos = strpos( $tail,
"PK\x03\x04" ) ) !==
false &&
894 preg_match( $openxmlRegex, substr( $tail, $headerpos + 30 ) ) ) {
895 if ( substr(
$header, 512, 4 ) ==
"\xEC\xA5\xC1\x00" ) {
896 $mime =
"application/msword";
898 switch ( substr(
$header, 512, 6 ) ) {
899 case "\xEC\xA5\xC1\x00\x0E\x00":
900 case "\xEC\xA5\xC1\x00\x1C\x00":
901 case "\xEC\xA5\xC1\x00\x43\x00":
902 $mime =
"application/vnd.ms-powerpoint";
904 case "\xFD\xFF\xFF\xFF\x10\x00":
905 case "\xFD\xFF\xFF\xFF\x1F\x00":
906 case "\xFD\xFF\xFF\xFF\x22\x00":
907 case "\xFD\xFF\xFF\xFF\x23\x00":
908 case "\xFD\xFF\xFF\xFF\x28\x00":
909 case "\xFD\xFF\xFF\xFF\x29\x00":
910 case "\xFD\xFF\xFF\xFF\x10\x02":
911 case "\xFD\xFF\xFF\xFF\x1F\x02":
912 case "\xFD\xFF\xFF\xFF\x22\x02":
913 case "\xFD\xFF\xFF\xFF\x23\x02":
914 case "\xFD\xFF\xFF\xFF\x28\x02":
915 case "\xFD\xFF\xFF\xFF\x29\x02":
916 $mime =
"application/vnd.msexcel";
920 $this->logger->info( __METHOD__ .
921 ": detected a MS Office document with OPC trailer\n" );
923 $this->logger->info( __METHOD__ .
": unable to identify type of ZIP archive\n" );
948 $this->logger->info( __METHOD__ .
949 ": WARNING: use of the \$ext parameter is deprecated. "
950 .
"Use improveTypeFromExtension(\$mime, \$ext) instead.\n" );
956 $m = $callback( $file );
957 } elseif ( function_exists(
"finfo_open" ) && function_exists(
"finfo_file" ) ) {
958 $mime_magic_resource = finfo_open( FILEINFO_MIME );
960 if ( $mime_magic_resource ) {
961 $m = finfo_file( $mime_magic_resource, $file );
962 finfo_close( $mime_magic_resource );
964 $this->logger->info( __METHOD__ .
965 ": finfo_open failed on " . FILEINFO_MIME .
"!\n" );
968 $this->logger->info( __METHOD__ .
": no magic mime detector found!\n" );
973 $m = preg_replace(
'![;, ].*$!',
'', $m ); # strip charset,
etc
975 $m = strtolower( $m );
977 if ( strpos( $m,
'unknown' ) !==
false ) {
980 $this->logger->info( __METHOD__ .
": magic mime type of $file: $m\n" );
986 if (
$ext ===
true ) {
987 $i = strrpos( $file,
'.' );
988 $ext = strtolower( $i ? substr( $file, $i + 1 ) :
'' );
992 $this->logger->info( __METHOD__ .
": refusing to guess mime type for .$ext file, "
993 .
"we should have recognized it\n" );
997 $this->logger->info( __METHOD__ .
": extension mime type of $file: $m\n" );
1004 $this->logger->info( __METHOD__ .
": failed to guess mime type for $file!\n" );
1005 return 'unknown/unknown';
1036 if (
$mime ==
'application/ogg' && file_exists(
$path ) ) {
1039 $f = fopen(
$path,
"rt" );
1043 $head = fread( $f, 256 );
1046 $head = str_replace(
'ffmpeg2theora',
'', strtolower( $head ) );
1049 if ( strpos( $head,
'theora' ) !==
false ) {
1051 } elseif ( strpos( $head,
'vorbis' ) !==
false ) {
1053 } elseif ( strpos( $head,
'flac' ) !==
false ) {
1055 } elseif ( strpos( $head,
'speex' ) !==
false ) {
1073 $i = strrpos(
$path,
'.' );
1074 $e = strtolower( $i ? substr(
$path, $i + 1 ) :
'' );
1085 $i = strpos(
$mime,
'/' );
1086 if ( $i !==
false ) {
1087 $major = substr(
$mime, 0, $i );
1113 if ( strpos( $extMime,
'.' ) === 0 ) {
1120 $m = explode(
' ', $m );
1123 if ( isset( $this->mimeTypeAliases[$extMime] ) ) {
1124 $extMime = $this->mimeTypeAliases[$extMime];
1131 foreach ( $this->mediaTypes
as $type => $codes ) {
1132 if ( in_array( $mime, $codes,
true ) ) {
1152 return $ca->getRealMimesFromData( $fileName, $chunk, $proposed );
1161 if ( is_null( $this->IEAnalyzer ) ) {
getTypesForExtension($ext)
Returns a list of MIME types for a given file extension as a space separated string or null if the ex...
improveTypeFromExtension($mime, $ext)
Improves a MIME type using the file extension.
setLogger(LoggerInterface $logger)
the array() calling protocol came about after MediaWiki 1.4rc1.
doGuessMimeType($file, $ext)
Guess the MIME type from the file contents.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging $e
const MEDIATYPE_MULTIMEDIA
if($ext== 'php'||$ext== 'php5') $mime
getExtensionsForType($mime)
Returns a list of file extensions for a given MIME type as a space separated string or null if the MI...
guessMimeType($file, $ext=true)
MIME type detection.
IEContentAnalyzer $IEAnalyzer
__construct(array $params)
guessTypesForExtension($ext)
Returns a single MIME type for a given file extension or null if unknown.
detectMimeType($file, $ext=true)
Internal MIME type detection.
findMediaType($extMime)
Returns a media code matching the given MIME type or file extension.
array $mediaTypes
Mapping of media types to arrays of MIME types.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add etc
getMediaType($path=null, $mime=null)
Determine the media type code for a file, using its MIME type, name and possibly its contents...
This class simulates Microsoft Internet Explorer's terribly broken and insecure MIME type detection a...
static $wellKnownInfo
Defines a set of well known MIME info entries This is used as a fallback to mime.info files...
string $extraTypes
Extra MIME types, set for example by media handling extensions.
isPHPImageType($mime)
Returns true if the MIME type is known to represent an image format supported by the PHP GD library...
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
detectZipType($header, $tail=null, $ext=false)
Detect application-specific file type of a given ZIP file from its header data.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
getIEMimeTypes($fileName, $chunk, $proposed)
Get the MIME types that various versions of Internet Explorer would detect from a chunk of the conten...
array $mExtToMime
Map of file extensions types to MIME types (as a space separated list)
array $mimeTypeAliases
Map of MIME type aliases.
array $mimetoExt
Map of MIME types to file extensions (as a space separated list)
getIEContentAnalyzer()
Get a cached instance of IEContentAnalyzer.
isMatchingExtension($extension, $mime)
Tests if the extension matches the given MIME type.
isRecognizableExtension($extension)
Returns true if the extension represents a type which can be reliably detected from its content...
static $wellKnownTypes
Defines a set of well known MIME types This is used as a fallback to mime.types files.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
addExtraTypes($types)
Adds to the list mapping MIME to file extensions.
string $extraInfo
Extra MIME info, set for example by media handling extensions.
addExtraInfo($info)
Adds to the list mapping MIME to media type.