Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
MimeMapMinimal | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * This program is free software; you can redistribute it and/or modify |
4 | * it under the terms of the GNU General Public License as published by |
5 | * the Free Software Foundation; either version 2 of the License, or |
6 | * (at your option) any later version. |
7 | * |
8 | * This program is distributed in the hope that it will be useful, |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | * GNU General Public License for more details. |
12 | * |
13 | * You should have received a copy of the GNU General Public License along |
14 | * with this program; if not, write to the Free Software Foundation, Inc., |
15 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
16 | * http://www.gnu.org/copyleft/gpl.html |
17 | * |
18 | * @file |
19 | */ |
20 | |
21 | namespace Wikimedia\Mime; |
22 | |
23 | /** |
24 | * Built-in MIME types that cannot be overridden by site configuration. |
25 | * |
26 | * This class exists for backward compatibility only. New MIME types must be |
27 | * added to MimeMap instead. |
28 | * |
29 | * @internal |
30 | * @ingroup Mime |
31 | */ |
32 | class MimeMapMinimal { |
33 | public const MIME_EXTENSIONS = [ |
34 | 'application/ogg' => [ 'ogx', 'ogg', 'ogm', 'ogv', 'oga', 'spx', 'opus' ], |
35 | 'application/pdf' => [ 'pdf' ], |
36 | 'application/vnd.oasis.opendocument.chart' => [ 'odc' ], |
37 | 'application/vnd.oasis.opendocument.chart-template' => [ 'otc' ], |
38 | 'application/vnd.oasis.opendocument.database' => [ 'odb' ], |
39 | 'application/vnd.oasis.opendocument.formula' => [ 'odf' ], |
40 | 'application/vnd.oasis.opendocument.formula-template' => [ 'otf' ], |
41 | 'application/vnd.oasis.opendocument.graphics' => [ 'odg' ], |
42 | 'application/vnd.oasis.opendocument.graphics-template' => [ 'otg' ], |
43 | 'application/vnd.oasis.opendocument.image' => [ 'odi' ], |
44 | 'application/vnd.oasis.opendocument.image-template' => [ 'oti' ], |
45 | 'application/vnd.oasis.opendocument.presentation' => [ 'odp' ], |
46 | 'application/vnd.oasis.opendocument.presentation-template' => [ 'otp' ], |
47 | 'application/vnd.oasis.opendocument.spreadsheet' => [ 'ods' ], |
48 | 'application/vnd.oasis.opendocument.spreadsheet-template' => [ 'ots' ], |
49 | 'application/vnd.oasis.opendocument.text' => [ 'odt' ], |
50 | 'application/vnd.oasis.opendocument.text-master' => [ 'otm' ], |
51 | 'application/vnd.oasis.opendocument.text-template' => [ 'ott' ], |
52 | 'application/vnd.oasis.opendocument.text-web' => [ 'oth' ], |
53 | 'application/javascript' => [ 'js' ], |
54 | 'application/x-shockwave-flash' => [ 'swf' ], |
55 | 'audio/midi' => [ 'mid', 'midi', 'kar' ], |
56 | 'audio/mpeg' => [ 'mpga', 'mpa', 'mp2', 'mp3' ], |
57 | 'audio/x-aiff' => [ 'aif', 'aiff', 'aifc' ], |
58 | 'audio/x-wav' => [ 'wav' ], |
59 | 'audio/ogg' => [ 'oga', 'spx', 'ogg', 'opus' ], |
60 | 'audio/opus' => [ 'opus', 'ogg', 'oga', 'spx' ], |
61 | 'image/x-bmp' => [ 'bmp' ], |
62 | 'image/gif' => [ 'gif' ], |
63 | 'image/jpeg' => [ 'jpeg', 'jpg', 'jpe' ], |
64 | 'image/png' => [ 'png' ], |
65 | 'image/svg+xml' => [ 'svg' ], |
66 | 'image/svg' => [ 'svg' ], |
67 | 'image/tiff' => [ 'tiff', 'tif' ], |
68 | 'image/vnd.djvu' => [ 'djvu' ], |
69 | 'image/x.djvu' => [ 'djvu' ], |
70 | 'image/x-djvu' => [ 'djvu' ], |
71 | 'image/x-portable-pixmap' => [ 'ppm' ], |
72 | 'image/x-xcf' => [ 'xcf' ], |
73 | 'text/plain' => [ 'txt' ], |
74 | 'text/html' => [ 'html', 'htm' ], |
75 | 'video/ogg' => [ 'ogv', 'ogm', 'ogg' ], |
76 | 'video/mpeg' => [ 'mpg', 'mpeg' ], |
77 | ]; |
78 | |
79 | public const MEDIA_TYPES = [ |
80 | MEDIATYPE_OFFICE => [ |
81 | 'application/pdf', |
82 | 'application/vnd.oasis.opendocument.chart', |
83 | 'application/vnd.oasis.opendocument.chart-template', |
84 | 'application/vnd.oasis.opendocument.database', |
85 | 'application/vnd.oasis.opendocument.formula', |
86 | 'application/vnd.oasis.opendocument.formula-template', |
87 | 'application/vnd.oasis.opendocument.graphics', |
88 | 'application/vnd.oasis.opendocument.graphics-template', |
89 | 'application/vnd.oasis.opendocument.image', |
90 | 'application/vnd.oasis.opendocument.image-template', |
91 | 'application/vnd.oasis.opendocument.presentation', |
92 | 'application/vnd.oasis.opendocument.presentation-template', |
93 | 'application/vnd.oasis.opendocument.spreadsheet', |
94 | 'application/vnd.oasis.opendocument.spreadsheet-template', |
95 | 'application/vnd.oasis.opendocument.text', |
96 | 'application/vnd.oasis.opendocument.text-template', |
97 | 'application/vnd.oasis.opendocument.text-master', |
98 | 'application/vnd.oasis.opendocument.text-web', |
99 | ], |
100 | MEDIATYPE_EXECUTABLE => [ |
101 | 'application/javascript', |
102 | 'text/javascript', |
103 | 'application/x-javascript', |
104 | ], |
105 | MEDIATYPE_MULTIMEDIA => [ |
106 | 'application/x-shockwave-flash', |
107 | 'application/ogg', |
108 | 'audio/ogg', |
109 | 'video/ogg', |
110 | ], |
111 | MEDIATYPE_AUDIO => [ |
112 | 'audio/midi', |
113 | 'audio/x-aiff', |
114 | 'audio/x-wav', |
115 | 'audio/mp3', |
116 | 'audio/mpeg', |
117 | ], |
118 | MEDIATYPE_BITMAP => [ |
119 | 'image/x-bmp', |
120 | 'image/x-ms-bmp', |
121 | 'image/bmp', |
122 | 'image/gif', |
123 | 'image/jpeg', |
124 | 'image/png', |
125 | 'image/tiff', |
126 | 'image/vnd.djvu', |
127 | 'image/x-xcf', |
128 | 'image/x-portable-pixmap', |
129 | ], |
130 | MEDIATYPE_DRAWING => [ |
131 | 'image/svg+xml', |
132 | ], |
133 | MEDIATYPE_TEXT => [ |
134 | 'text/plain', |
135 | 'text/html', |
136 | ], |
137 | MEDIATYPE_VIDEO => [ |
138 | 'video/ogg', |
139 | 'video/mpeg', |
140 | ], |
141 | MEDIATYPE_UNKNOWN => [ |
142 | 'unknown/unknown', |
143 | 'application/octet-stream', |
144 | 'application/x-empty', |
145 | ], |
146 | ]; |
147 | |
148 | public const MIME_TYPE_ALIASES = [ |
149 | 'text/javascript' => 'application/javascript', |
150 | 'application/x-javascript' => 'application/javascript', |
151 | 'audio/mpeg' => 'audio/mp3', |
152 | 'audio/ogg' => 'application/ogg', |
153 | 'video/ogg' => 'application/ogg', |
154 | 'image/x-ms-bmp' => 'image/x-bmp', |
155 | 'image/bmp' => 'image/x-bmp', |
156 | 'application/octet-stream' => 'unknown/unknown', |
157 | 'application/x-empty' => 'unknown/unknown', |
158 | ]; |
159 | } |