MediaWiki fundraising/REL1_35
MimeMap.php
Go to the documentation of this file.
1<?php
22
29class MimeMap {
31 public const MIME_EXTENSIONS = [
32 'application/ogg' => [ 'ogx', 'ogg', 'ogm', 'ogv', 'oga', 'spx', 'opus' ],
33 'application/pdf' => [ 'pdf' ],
34 'application/vnd.ms-opentype' => [ 'otf' ],
35 'application/vnd.oasis.opendocument.chart' => [ 'odc' ],
36 'application/vnd.oasis.opendocument.chart-template' => [ 'otc' ],
37 'application/vnd.oasis.opendocument.database' => [ 'odb' ],
38 'application/vnd.oasis.opendocument.formula' => [ 'odf' ],
39 'application/vnd.oasis.opendocument.formula-template' => [ 'otf' ],
40 'application/vnd.oasis.opendocument.graphics' => [ 'odg' ],
41 'application/vnd.oasis.opendocument.graphics-template' => [ 'otg' ],
42 'application/vnd.oasis.opendocument.image' => [ 'odi' ],
43 'application/vnd.oasis.opendocument.image-template' => [ 'oti' ],
44 'application/vnd.oasis.opendocument.presentation' => [ 'odp' ],
45 'application/vnd.oasis.opendocument.presentation-template' => [ 'otp' ],
46 'application/vnd.oasis.opendocument.spreadsheet' => [ 'ods' ],
47 'application/vnd.oasis.opendocument.spreadsheet-template' => [ 'ots' ],
48 'application/vnd.oasis.opendocument.text' => [ 'odt' ],
49 'application/vnd.oasis.opendocument.text-master' => [ 'otm', 'odm' ],
50 'application/vnd.oasis.opendocument.text-template' => [ 'ott' ],
51 'application/vnd.oasis.opendocument.text-web' => [ 'oth' ],
52 'application/javascript' => [ 'js' ],
53 'application/x-shockwave-flash' => [ 'swf' ],
54 'audio/midi' => [ 'mid', 'midi', 'kar' ],
55 'audio/mpeg' => [ 'mpga', 'mpa', 'mp2', 'mp3' ],
56 'audio/x-aiff' => [ 'aif', 'aiff', 'aifc' ],
57 'audio/x-wav' => [ 'wav' ],
58 'audio/ogg' => [ 'oga', 'spx', 'ogg', 'opus' ],
59 'audio/opus' => [ 'opus', 'ogg', 'oga', 'spx' ],
60 'image/x-bmp' => [ 'bmp' ],
61 'image/gif' => [ 'gif' ],
62 'image/jpeg' => [ 'jpeg', 'jpg', 'jpe' ],
63 'image/png' => [ 'png', 'apng' ],
64 'image/svg+xml' => [ 'svg' ],
65 'image/svg' => [ 'svg' ],
66 'image/tiff' => [ 'tiff', 'tif' ],
67 'image/vnd.djvu' => [ 'djvu', 'djv' ],
68 'image/x.djvu' => [ 'djvu' ],
69 'image/x-djvu' => [ 'djvu' ],
70 'image/x-portable-pixmap' => [ 'ppm' ],
71 'image/x-xcf' => [ 'xcf' ],
72 'text/plain' => [ 'txt' ],
73 'text/html' => [ 'html', 'htm' ],
74 'video/ogg' => [ 'ogv', 'ogm', 'ogg' ],
75 'video/mpeg' => [ 'mpg', 'mpeg', 'mpe' ],
76 'application/acad' => [ 'dwg' ],
77 'application/andrew-inset' => [ 'ez' ],
78 'application/mac-binhex40' => [ 'hqx' ],
79 'application/mac-compactpro' => [ 'cpt' ],
80 'application/mathml+xml' => [ 'mathml' ],
81 'application/msword' => [ 'doc', 'dot' ],
82 'application/octet-stream' => [ 'bin', 'dms', 'lha', 'lzh', 'exe', 'class', 'so', 'dll' ],
83 'application/oda' => [ 'oda' ],
84 'application/postscript' => [ 'ai', 'eps', 'ps' ],
85 'application/rdf+xml' => [ 'rdf' ],
86 'application/smil' => [ 'smi', 'smil' ],
87 'application/srgs' => [ 'gram' ],
88 'application/srgs+xml' => [ 'grxml' ],
89 'application/vnd.mif' => [ 'mif' ],
90 'application/vnd.ms-excel' => [ 'xls', 'xlt', 'xla' ],
91 'application/vnd.ms-powerpoint' => [ 'ppt', 'pot', 'pps', 'ppa' ],
92 'application/vnd.wap.wbxml' => [ 'wbxml' ],
93 'application/vnd.wap.wmlc' => [ 'wmlc' ],
94 'application/vnd.wap.wmlscriptc' => [ 'wmlsc' ],
95 'application/voicexml+xml' => [ 'vxml' ],
96 'application/x-7z-compressed' => [ '7z' ],
97 'application/x-bcpio' => [ 'bcpio' ],
98 'application/x-bzip' => [ 'bz' ],
99 'application/x-bzip2' => [ 'bz2' ],
100 'application/x-cdlink' => [ 'vcd' ],
101 'application/x-chess-pgn' => [ 'pgn' ],
102 'application/x-cpio' => [ 'cpio' ],
103 'application/x-csh' => [ 'csh' ],
104 'application/x-dia-diagram' => [ 'dia' ],
105 'application/x-director' => [ 'dcr', 'dir', 'dxr' ],
106 'application/x-dvi' => [ 'dvi' ],
107 'application/x-futuresplash' => [ 'spl' ],
108 'application/x-gtar' => [ 'gtar', 'tar' ],
109 'application/x-gzip' => [ 'gz' ],
110 'application/x-hdf' => [ 'hdf' ],
111 'application/x-jar' => [ 'jar' ],
112 'application/json' => [ 'json' ],
113 'application/x-koan' => [ 'skp', 'skd', 'skt', 'skm' ],
114 'application/x-latex' => [ 'latex' ],
115 'application/x-netcdf' => [ 'nc', 'cdf' ],
116 'application/x-sh' => [ 'sh' ],
117 'application/x-shar' => [ 'shar' ],
118 'application/x-stuffit' => [ 'sit' ],
119 'application/x-sv4cpio' => [ 'sv4cpio' ],
120 'application/x-sv4crc' => [ 'sv4crc' ],
121 'application/x-tar' => [ 'tar' ],
122 'application/x-tcl' => [ 'tcl' ],
123 'application/x-tex' => [ 'tex' ],
124 'application/x-texinfo' => [ 'texinfo', 'texi' ],
125 'application/x-troff' => [ 't', 'tr', 'roff' ],
126 'application/x-troff-man' => [ 'man' ],
127 'application/x-troff-me' => [ 'me' ],
128 'application/x-troff-ms' => [ 'ms' ],
129 'application/x-ustar' => [ 'ustar' ],
130 'application/x-wais-source' => [ 'src' ],
131 'application/x-xpinstall' => [ 'xpi' ],
132 'application/xhtml+xml' => [ 'xhtml', 'xht' ],
133 'application/xslt+xml' => [ 'xslt' ],
134 'application/xml' => [ 'xml', 'xsl', 'xsd', 'kml' ],
135 'application/xml-dtd' => [ 'dtd' ],
136 'application/zip' =>
137 [ 'zip', 'jar', 'xpi', 'sxc', 'stc', 'sxd', 'std', 'sxi', 'sti', 'sxm', 'stm', 'sxw', 'stw' ],
138 'application/x-rar' => [ 'rar' ],
139 'application/font-sfnt' => [ 'ttf' ],
140 'application/font-woff' => [ 'woff' ],
141 'application/font-woff2' => [ 'woff2' ],
142 'application/vnd.ms-fontobject' => [ 'eot' ],
143 'application/x-font-ttf' => [ 'ttf' ],
144 'audio/basic' => [ 'au', 'snd' ],
145 'video/webm' => [ 'webm' ],
146 'audio/webm' => [ 'webm' ],
147 'audio/x-matroska' => [ 'mka', 'mkv' ],
148 'audio/x-mpegurl' => [ 'm3u' ],
149 'audio/x-ogg' => [ 'oga', 'ogg', 'spx', 'opus' ],
150 'audio/x-pn-realaudio' => [ 'ram', 'rm' ],
151 'audio/x-pn-realaudio-plugin' => [ 'rpm' ],
152 'audio/x-realaudio' => [ 'ra' ],
153 'audio/wav' => [ 'wav' ],
154 'audio/x-flac' => [ 'flac' ],
155 'audio/flac' => [ 'flac' ],
156 'chemical/x-pdb' => [ 'pdb' ],
157 'chemical/x-xyz' => [ 'xyz' ],
158 'image/bmp' => [ 'bmp' ],
159 'image/cgm' => [ 'cgm' ],
160 'image/ief' => [ 'ief' ],
161 'image/jp2' => [ 'j2k', 'jp2', 'jpg2' ],
162 'image/vnd.microsoft.icon' => [ 'ico' ],
163 'image/vnd.wap.wbmp' => [ 'wbmp' ],
164 'image/webp' => [ 'webp' ],
165 'image/x-cmu-raster' => [ 'ras' ],
166 'image/x-icon' => [ 'ico' ],
167 'image/x-ms-bmp' => [ 'bmp' ],
168 'image/x-portable-anymap' => [ 'pnm' ],
169 'image/x-portable-bitmap' => [ 'pbm' ],
170 'image/x-portable-graymap' => [ 'pgm' ],
171 'image/x-rgb' => [ 'rgb' ],
172 'image/x-photoshop' => [ 'psd' ],
173 'image/x-xbitmap' => [ 'xbm' ],
174 'image/x-xpixmap' => [ 'xpm' ],
175 'image/x-xwindowdump' => [ 'xwd' ],
176 'model/iges' => [ 'igs', 'iges' ],
177 'model/mesh' => [ 'msh', 'mesh', 'silo' ],
178 'model/vrml' => [ 'wrl', 'vrml' ],
179 'text/calendar' => [ 'ics', 'ifb' ],
180 'text/css' => [ 'css' ],
181 'text/csv' => [ 'csv' ],
182 'text/richtext' => [ 'rtx' ],
183 'text/rtf' => [ 'rtf' ],
184 'text/sgml' => [ 'sgml', 'sgm' ],
185 'text/tab-separated-values' => [ 'tsv' ],
186 'text/vnd.wap.wml' => [ 'wml' ],
187 'text/vnd.wap.wmlscript' => [ 'wmls' ],
188 'text/xml' => [ 'xml', 'xsl', 'xslt', 'rss', 'rdf' ],
189 'text/x-component' => [ 'htc' ],
190 'text/x-setext' => [ 'etx' ],
191 'text/x-sawfish' => [ 'jl' ],
192 'video/mp4' => [ 'mp4', 'm4a', 'm4p', 'm4b', 'm4r', 'm4v' ],
193 'audio/mp4' => [ 'm4a' ],
194 'video/quicktime' => [ 'qt', 'mov' ],
195 'video/vnd.mpegurl' => [ 'mxu' ],
196 'video/x-flv' => [ 'flv' ],
197 'video/x-matroska' => [ 'mkv', 'mka' ],
198 'video/x-msvideo' => [ 'avi' ],
199 'video/x-ogg' => [ 'ogv', 'ogm', 'ogg' ],
200 'video/x-sgi-movie' => [ 'movie' ],
201 'x-conference/x-cooltalk' => [ 'ice' ],
202 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => [ 'docx' ],
203 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => [ 'dotx' ],
204 'application/vnd.ms-word.document.macroenabled.12' => [ 'docm' ],
205 'application/vnd.ms-word.template.macroenabled.12' => [ 'dotm' ],
206 'application/vnd.openxmlformats-officedocument.presentationml.template' => [ 'potx' ],
207 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => [ 'ppsx' ],
208 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => [ 'pptx' ],
209 'application/vnd.ms-powerpoint.addin.macroenabled.12' => [ 'ppam' ],
210 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => [ 'pptm', 'potm' ],
211 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => [ 'ppsm' ],
212 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => [ 'xlsx' ],
213 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => [ 'xltx' ],
214 'application/vnd.ms-excel.sheet.macroenabled.12' => [ 'xlsm' ],
215 'application/vnd.ms-excel.template.macroenabled.12' => [ 'xltm' ],
216 'application/vnd.ms-excel.addin.macroenabled.12' => [ 'xlam' ],
217 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => [ 'xlsb' ],
218 'model/vnd.dwfx+xps' => [ 'dwfx' ],
219 'application/vnd.ms-xpsdocument' => [ 'xps' ],
220 'application/x-opc+zip' => [
221 'docx', 'dotx', 'docm', 'dotm', 'potx', 'ppsx', 'pptx', 'ppam', 'pptm', 'potm', 'ppsm',
222 'xlsx', 'xltx', 'xlsm', 'xltm', 'xlam', 'xlsb', 'dwfx', 'xps' ],
223 'chemical/x-mdl-molfile' => [ 'mol' ],
224 'chemical/x-mdl-sdfile' => [ 'sdf' ],
225 'chemical/x-mdl-rxnfile' => [ 'rxn' ],
226 'chemical/x-mdl-rdfile' => [ 'rd' ],
227 'chemical/x-mdl-rgfile' => [ 'rg' ],
228 'application/x-amf' => [ 'amf' ],
229 'application/sla' => [ 'stl' ],
230 'application/wasm' => [ 'wasm' ],
231 ];
232
234 public const MEDIA_TYPES = [
236 'application/pdf',
237 'application/vnd.oasis.opendocument.chart',
238 'application/vnd.oasis.opendocument.chart-template',
239 'application/vnd.oasis.opendocument.database',
240 'application/vnd.oasis.opendocument.formula',
241 'application/vnd.oasis.opendocument.formula-template',
242 'application/vnd.oasis.opendocument.graphics',
243 'application/vnd.oasis.opendocument.graphics-template',
244 'application/vnd.oasis.opendocument.image',
245 'application/vnd.oasis.opendocument.image-template',
246 'application/vnd.oasis.opendocument.presentation',
247 'application/vnd.oasis.opendocument.presentation-template',
248 'application/vnd.oasis.opendocument.spreadsheet',
249 'application/vnd.oasis.opendocument.spreadsheet-template',
250 'application/vnd.oasis.opendocument.text',
251 'application/vnd.oasis.opendocument.text-template',
252 'application/vnd.oasis.opendocument.text-master',
253 'application/vnd.oasis.opendocument.text-web',
254 'application/pdf',
255 'application/acrobat',
256 'application/msword',
257 'application/vnd.ms-excel',
258 'application/vnd.ms-powerpoint',
259 'application/x-director',
260 'image/vnd.djvu',
261 'image/x.djvu',
262 'image/x-djvu',
263 'text/rtf',
264 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
265 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
266 'application/vnd.ms-word.document.macroenabled.12',
267 'application/vnd.ms-word.template.macroenabled.12',
268 'application/vnd.openxmlformats-officedocument.presentationml.template',
269 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
270 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
271 'application/vnd.ms-powerpoint.addin.macroenabled.12',
272 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
273 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
274 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
275 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
276 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
277 'application/vnd.ms-excel.sheet.macroenabled.12',
278 'application/vnd.ms-excel.template.macroenabled.12',
279 'application/vnd.ms-excel.addin.macroenabled.12',
280 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
281 ],
283 'application/javascript',
284 'text/javascript',
285 'application/x-javascript',
286 'application/javascript',
287 'text/javascript',
288 'application/x-javascript',
289 'application/x-ecmascript',
290 'text/ecmascript',
291 'application/x-bash',
292 'application/x-sh',
293 'application/x-csh',
294 'application/x-tcsh',
295 'application/x-tcl',
296 'application/x-perl',
297 'application/x-python',
298 'application/wasm',
299 ],
301 'application/x-shockwave-flash',
302 'application/ogg',
303 'audio/ogg',
304 'video/ogg',
305 'application/ogg',
306 'application/x-ogg',
307 'audio/ogg',
308 'audio/x-ogg',
309 'video/ogg',
310 'video/x-ogg',
311 'application/x-shockwave-flash',
312 'audio/x-pn-realaudio-plugin',
313 'model/iges',
314 'model/mesh',
315 'model/vrml',
316 'video/quicktime',
317 'video/x-msvideo',
318 ],
319 MEDIATYPE_AUDIO => [
320 'audio/midi',
321 'audio/x-aiff',
322 'audio/x-wav',
323 'audio/mp3',
324 'audio/mpeg',
325 'audio/mpeg',
326 'audio/mp3',
327 'audio/mpeg3',
328 'audio/mp4',
329 'audio/wav',
330 'audio/x-wav',
331 'audio/wave',
332 'audio/midi',
333 'audio/mid',
334 'audio/basic',
335 'audio/ogg',
336 'audio/opus',
337 'audio/x-aiff',
338 'audio/x-pn-realaudio',
339 'audio/x-realaudio',
340 'audio/webm',
341 'audio/x-matroska',
342 'audio/x-flac',
343 'audio/flac',
344 ],
346 'image/x-bmp',
347 'image/x-ms-bmp',
348 'image/bmp',
349 'image/gif',
350 'image/jpeg',
351 'image/png',
352 'image/tiff',
353 'image/vnd.djvu',
354 'image/x-xcf',
355 'image/x-portable-pixmap',
356 'image/gif',
357 'image/png',
358 'image/x-png',
359 'image/ief',
360 'image/jpeg',
361 'image/pjpeg',
362 'image/jp2',
363 'image/xbm',
364 'image/tiff',
365 'image/x-icon',
366 'image/x-ico',
367 'image/vnd.microsoft.icon',
368 'image/x-rgb',
369 'image/x-portable-pixmap',
370 'image/x-portable-graymap',
371 'image/x-portable-greymap',
372 'image/x-bmp',
373 'image/x-ms-bmp',
374 'image/bmp',
375 'application/x-bmp',
376 'application/bmp',
377 'image/x-photoshop',
378 'image/psd',
379 'image/x-psd',
380 'image/photoshop',
381 'image/vnd.adobe.photoshop',
382 'image/webp',
383 ],
385 'image/svg+xml',
386 'image/svg+xml',
387 'application/svg+xml',
388 'application/svg',
389 'image/svg',
390 'application/postscript',
391 'application/x-latex',
392 'application/x-tex',
393 'application/x-dia-diagram',
394 'application/acad',
395 'application/x-acad',
396 'application/autocad_dwg',
397 'image/x-dwg',
398 'application/dwg',
399 'application/x-dwg',
400 'application/x-autocad',
401 'image/vnd.dwg',
402 'drawing/dwg',
403 'chemical/x-mdl-molfile',
404 'chemical/x-mdl-sdfile',
405 'chemical/x-mdl-rxnfile',
406 'chemical/x-mdl-rdfile',
407 'chemical/x-mdl-rgfile',
408 ],
409 MEDIATYPE_TEXT => [
410 'text/plain',
411 'text/html',
412 'text/plain',
413 'text/html',
414 'application/xhtml+xml',
415 'application/xml',
416 'text/xml',
417 'text',
418 'application/json',
419 'text/csv',
420 'text/tab-separated-values',
421 ],
422 MEDIATYPE_VIDEO => [
423 'video/ogg',
424 'video/mpeg',
425 'video/mpeg',
426 'application/mpeg',
427 'video/ogg',
428 'video/x-sgi-video',
429 'video/x-flv',
430 'video/webm',
431 'video/x-matroska',
432 'video/mp4',
433 ],
435 'unknown/unknown',
436 'application/octet-stream',
437 'application/x-empty',
438 ],
440 'application/zip',
441 'application/x-zip',
442 'application/x-gzip',
443 'application/x-bzip',
444 'application/x-bzip2',
445 'application/x-tar',
446 'application/x-stuffit',
447 'application/x-opc+zip',
448 'application/x-7z-compressed',
449 ],
450 MEDIATYPE_3D => [
451 'application/sla',
452 ],
453 ];
454
456 public const MIME_TYPE_ALIASES = [
457 'text/javascript' => 'application/javascript',
458 'application/x-javascript' => 'application/javascript',
459 'audio/mpeg' => 'audio/mp3',
460 'audio/ogg' => 'application/ogg',
461 'video/ogg' => 'application/ogg',
462 'image/x-ms-bmp' => 'image/x-bmp',
463 'image/bmp' => 'image/x-bmp',
464 'application/octet-stream' => 'unknown/unknown',
465 'application/x-empty' => 'unknown/unknown',
466 'image/x-png' => 'image/png',
467 'image/pjpeg' => 'image/jpeg',
468 'image/x-ico' => 'image/x-icon',
469 'image/vnd.microsoft.icon' => 'image/x-icon',
470 'image/x-portable-greymap' => 'image/x-portable-graymap',
471 'application/x-bmp' => 'image/x-bmp',
472 'application/bmp' => 'image/x-bmp',
473 'image/psd' => 'image/x-photoshop',
474 'image/x-psd' => 'image/x-photoshop',
475 'image/photoshop' => 'image/x-photoshop',
476 'image/vnd.adobe.photoshop' => 'image/x-photoshop',
477 'application/svg+xml' => 'image/svg+xml',
478 'application/svg' => 'image/svg+xml',
479 'image/svg' => 'image/svg+xml',
480 'audio/mp3' => 'audio/mpeg',
481 'audio/mpeg3' => 'audio/mpeg',
482 'audio/x-wav' => 'audio/wav',
483 'audio/wave' => 'audio/wav',
484 'audio/mid' => 'audio/midi',
485 'application/mpeg' => 'video/mpeg',
486 'application/x-ogg' => 'application/ogg',
487 'audio/x-ogg' => 'application/ogg',
488 'video/x-ogg' => 'application/ogg',
489 'application/xhtml+xml' => 'text/html',
490 'text/xml' => 'application/xml',
491 'application/x-zip' => 'application/zip',
492 'application/x-ecmascript' => 'application/javascript',
493 'text/ecmascript' => 'application/javascript',
494 'application/acrobat' => 'application/pdf',
495 'image/x.djvu' => 'image/vnd.djvu',
496 'image/x-djvu' => 'image/vnd.djvu',
497 'application/x-acad' => 'application/acad',
498 'application/autocad_dwg' => 'application/acad',
499 'image/x-dwg' => 'application/acad',
500 'application/dwg' => 'application/acad',
501 'application/x-dwg' => 'application/acad',
502 'application/x-autocad' => 'application/acad',
503 'image/vnd.dwg' => 'application/acad',
504 'drawing/dwg' => 'application/acad',
505 ];
506}
MimeMap defines the mapping of MIME types to file extensions and media types.
Definition MimeMap.php:29
const MEDIATYPE_DRAWING
Definition defines.php:30
const MEDIATYPE_VIDEO
Definition defines.php:35
const MEDIATYPE_OFFICE
Definition defines.php:39
const MEDIATYPE_UNKNOWN
Definition defines.php:26
const MEDIATYPE_AUDIO
Definition defines.php:32
const MEDIATYPE_TEXT
Definition defines.php:41
const MEDIATYPE_BITMAP
Definition defines.php:28
const MEDIATYPE_MULTIMEDIA
Definition defines.php:37
const MEDIATYPE_EXECUTABLE
Definition defines.php:43
const MEDIATYPE_3D
Definition defines.php:47
const MEDIATYPE_ARCHIVE
Definition defines.php:45