|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types = 1); |
|
4
|
|
|
|
|
5
|
|
|
namespace DummyGenerator\Core; |
|
6
|
|
|
|
|
7
|
|
|
use DummyGenerator\Definitions\Extension\Awareness\RandomizerAwareExtensionInterface; |
|
8
|
|
|
use DummyGenerator\Definitions\Extension\Awareness\RandomizerAwareExtensionTrait; |
|
9
|
|
|
use DummyGenerator\Definitions\Extension\FileExtensionInterface; |
|
10
|
|
|
|
|
11
|
|
|
class File implements FileExtensionInterface, RandomizerAwareExtensionInterface |
|
12
|
|
|
{ |
|
13
|
|
|
use RandomizerAwareExtensionTrait; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* MIME types from the apache.org file. Some types are truncated. |
|
17
|
|
|
* |
|
18
|
|
|
* @var array<string, string|array<int, string>> Map of MIME types => file extension(s) |
|
19
|
|
|
* |
|
20
|
|
|
* @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types |
|
21
|
|
|
*/ |
|
22
|
|
|
protected array $mimeTypes = [ |
|
23
|
|
|
'application/atom+xml' => 'atom', |
|
24
|
|
|
'application/ecmascript' => 'ecma', |
|
25
|
|
|
'application/emma+xml' => 'emma', |
|
26
|
|
|
'application/epub+zip' => 'epub', |
|
27
|
|
|
'application/java-archive' => 'jar', |
|
28
|
|
|
'application/java-vm' => 'class', |
|
29
|
|
|
'application/javascript' => 'js', |
|
30
|
|
|
'application/json' => 'json', |
|
31
|
|
|
'application/jsonml+json' => 'jsonml', |
|
32
|
|
|
'application/lost+xml' => 'lostxml', |
|
33
|
|
|
'application/mathml+xml' => 'mathml', |
|
34
|
|
|
'application/mets+xml' => 'mets', |
|
35
|
|
|
'application/mods+xml' => 'mods', |
|
36
|
|
|
'application/mp4' => 'mp4s', |
|
37
|
|
|
'application/msword' => ['doc', 'dot'], |
|
38
|
|
|
'application/octet-stream' => [ |
|
39
|
|
|
'bin', |
|
40
|
|
|
'dms', |
|
41
|
|
|
'lrf', |
|
42
|
|
|
'mar', |
|
43
|
|
|
'so', |
|
44
|
|
|
'dist', |
|
45
|
|
|
'distz', |
|
46
|
|
|
'pkg', |
|
47
|
|
|
'bpk', |
|
48
|
|
|
'dump', |
|
49
|
|
|
'elc', |
|
50
|
|
|
'deploy', |
|
51
|
|
|
], |
|
52
|
|
|
'application/ogg' => 'ogx', |
|
53
|
|
|
'application/omdoc+xml' => 'omdoc', |
|
54
|
|
|
'application/pdf' => 'pdf', |
|
55
|
|
|
'application/pgp-encrypted' => 'pgp', |
|
56
|
|
|
'application/pgp-signature' => ['asc', 'sig'], |
|
57
|
|
|
'application/pkix-pkipath' => 'pkipath', |
|
58
|
|
|
'application/pkixcmp' => 'pki', |
|
59
|
|
|
'application/pls+xml' => 'pls', |
|
60
|
|
|
'application/postscript' => ['ai', 'eps', 'ps'], |
|
61
|
|
|
'application/pskc+xml' => 'pskcxml', |
|
62
|
|
|
'application/rdf+xml' => 'rdf', |
|
63
|
|
|
'application/reginfo+xml' => 'rif', |
|
64
|
|
|
'application/rss+xml' => 'rss', |
|
65
|
|
|
'application/rtf' => 'rtf', |
|
66
|
|
|
'application/sbml+xml' => 'sbml', |
|
67
|
|
|
'application/vnd.adobe.air-application-installer-package+zip' => 'air', |
|
68
|
|
|
'application/vnd.adobe.xdp+xml' => 'xdp', |
|
69
|
|
|
'application/vnd.adobe.xfdf' => 'xfdf', |
|
70
|
|
|
'application/vnd.ahead.space' => 'ahead', |
|
71
|
|
|
'application/vnd.dart' => 'dart', |
|
72
|
|
|
'application/vnd.data-vision.rdz' => 'rdz', |
|
73
|
|
|
'application/vnd.dece.data' => ['uvf', 'uvvf', 'uvd', 'uvvd'], |
|
74
|
|
|
'application/vnd.dece.ttml+xml' => ['uvt', 'uvvt'], |
|
75
|
|
|
'application/vnd.dece.unspecified' => ['uvx', 'uvvx'], |
|
76
|
|
|
'application/vnd.dece.zip' => ['uvz', 'uvvz'], |
|
77
|
|
|
'application/vnd.denovo.fcselayout-link' => 'fe_launch', |
|
78
|
|
|
'application/vnd.dna' => 'dna', |
|
79
|
|
|
'application/vnd.dolby.mlp' => 'mlp', |
|
80
|
|
|
'application/vnd.dpgraph' => 'dpg', |
|
81
|
|
|
'application/vnd.dreamfactory' => 'dfac', |
|
82
|
|
|
'application/vnd.ds-keypoint' => 'kpxx', |
|
83
|
|
|
'application/vnd.dvb.ait' => 'ait', |
|
84
|
|
|
'application/vnd.dvb.service' => 'svc', |
|
85
|
|
|
'application/vnd.dynageo' => 'geo', |
|
86
|
|
|
'application/vnd.ecowin.chart' => 'mag', |
|
87
|
|
|
'application/vnd.enliven' => 'nml', |
|
88
|
|
|
'application/vnd.epson.esf' => 'esf', |
|
89
|
|
|
'application/vnd.epson.msf' => 'msf', |
|
90
|
|
|
'application/vnd.epson.quickanime' => 'qam', |
|
91
|
|
|
'application/vnd.epson.salt' => 'slt', |
|
92
|
|
|
'application/vnd.epson.ssf' => 'ssf', |
|
93
|
|
|
'application/vnd.ezpix-album' => 'ez2', |
|
94
|
|
|
'application/vnd.ezpix-package' => 'ez3', |
|
95
|
|
|
'application/vnd.fdf' => 'fdf', |
|
96
|
|
|
'application/vnd.fdsn.mseed' => 'mseed', |
|
97
|
|
|
'application/vnd.fdsn.seed' => ['seed', 'dataless'], |
|
98
|
|
|
'application/vnd.flographit' => 'gph', |
|
99
|
|
|
'application/vnd.fluxtime.clip' => 'ftc', |
|
100
|
|
|
'application/vnd.hal+xml' => 'hal', |
|
101
|
|
|
'application/vnd.hydrostatix.sof-data' => 'sfd-hdstx', |
|
102
|
|
|
'application/vnd.ibm.minipay' => 'mpy', |
|
103
|
|
|
'application/vnd.ibm.secure-container' => 'sc', |
|
104
|
|
|
'application/vnd.iccprofile' => ['icc', 'icm'], |
|
105
|
|
|
'application/vnd.igloader' => 'igl', |
|
106
|
|
|
'application/vnd.immervision-ivp' => 'ivp', |
|
107
|
|
|
'application/vnd.kde.karbon' => 'karbon', |
|
108
|
|
|
'application/vnd.kde.kchart' => 'chrt', |
|
109
|
|
|
'application/vnd.kde.kformula' => 'kfo', |
|
110
|
|
|
'application/vnd.kde.kivio' => 'flw', |
|
111
|
|
|
'application/vnd.kde.kontour' => 'kon', |
|
112
|
|
|
'application/vnd.kde.kpresenter' => ['kpr', 'kpt'], |
|
113
|
|
|
'application/vnd.kde.kspread' => 'ksp', |
|
114
|
|
|
'application/vnd.kde.kword' => ['kwd', 'kwt'], |
|
115
|
|
|
'application/vnd.kenameaapp' => 'htke', |
|
116
|
|
|
'application/vnd.kidspiration' => 'kia', |
|
117
|
|
|
'application/vnd.kinar' => ['kne', 'knp'], |
|
118
|
|
|
'application/vnd.koan' => ['skp', 'skd', 'skt', 'skm'], |
|
119
|
|
|
'application/vnd.kodak-descriptor' => 'sse', |
|
120
|
|
|
'application/vnd.las.las+xml' => 'lasxml', |
|
121
|
|
|
'application/vnd.llamagraphics.life-balance.desktop' => 'lbd', |
|
122
|
|
|
'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe', |
|
123
|
|
|
'application/vnd.lotus-1-2-3' => '123', |
|
124
|
|
|
'application/vnd.lotus-approach' => 'apr', |
|
125
|
|
|
'application/vnd.lotus-freelance' => 'pre', |
|
126
|
|
|
'application/vnd.lotus-notes' => 'nsf', |
|
127
|
|
|
'application/vnd.lotus-organizer' => 'org', |
|
128
|
|
|
'application/vnd.lotus-screencam' => 'scm', |
|
129
|
|
|
'application/vnd.mozilla.xul+xml' => 'xul', |
|
130
|
|
|
'application/vnd.ms-artgalry' => 'cil', |
|
131
|
|
|
'application/vnd.ms-cab-compressed' => 'cab', |
|
132
|
|
|
'application/vnd.ms-excel' => [ |
|
133
|
|
|
'xls', |
|
134
|
|
|
'xlm', |
|
135
|
|
|
'xla', |
|
136
|
|
|
'xlc', |
|
137
|
|
|
'xlt', |
|
138
|
|
|
'xlw', |
|
139
|
|
|
], |
|
140
|
|
|
'application/vnd.ms-excel.addin.macroenabled.12' => 'xlam', |
|
141
|
|
|
'application/vnd.ms-excel.sheet.binary.macroenabled.12' => 'xlsb', |
|
142
|
|
|
'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm', |
|
143
|
|
|
'application/vnd.ms-excel.template.macroenabled.12' => 'xltm', |
|
144
|
|
|
'application/vnd.ms-fontobject' => 'eot', |
|
145
|
|
|
'application/vnd.ms-htmlhelp' => 'chm', |
|
146
|
|
|
'application/vnd.ms-ims' => 'ims', |
|
147
|
|
|
'application/vnd.ms-lrm' => 'lrm', |
|
148
|
|
|
'application/vnd.ms-officetheme' => 'thmx', |
|
149
|
|
|
'application/vnd.ms-pki.seccat' => 'cat', |
|
150
|
|
|
'application/vnd.ms-pki.stl' => 'stl', |
|
151
|
|
|
'application/vnd.ms-powerpoint' => ['ppt', 'pps', 'pot'], |
|
152
|
|
|
'application/vnd.ms-powerpoint.addin.macroenabled.12' => 'ppam', |
|
153
|
|
|
'application/vnd.ms-powerpoint.presentation.macroenabled.12' => 'pptm', |
|
154
|
|
|
'application/vnd.ms-powerpoint.slide.macroenabled.12' => 'sldm', |
|
155
|
|
|
'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => 'ppsm', |
|
156
|
|
|
'application/vnd.ms-powerpoint.template.macroenabled.12' => 'potm', |
|
157
|
|
|
'application/vnd.ms-project' => ['mpp', 'mpt'], |
|
158
|
|
|
'application/vnd.ms-word.document.macroenabled.12' => 'docm', |
|
159
|
|
|
'application/vnd.ms-word.template.macroenabled.12' => 'dotm', |
|
160
|
|
|
'application/vnd.ms-works' => ['wps', 'wks', 'wcm', 'wdb'], |
|
161
|
|
|
'application/vnd.ms-wpl' => 'wpl', |
|
162
|
|
|
'application/vnd.ms-xpsdocument' => 'xps', |
|
163
|
|
|
'application/vnd.mseq' => 'mseq', |
|
164
|
|
|
'application/vnd.musician' => 'mus', |
|
165
|
|
|
'application/vnd.oasis.opendocument.chart' => 'odc', |
|
166
|
|
|
'application/vnd.oasis.opendocument.chart-template' => 'otc', |
|
167
|
|
|
'application/vnd.oasis.opendocument.database' => 'odb', |
|
168
|
|
|
'application/vnd.oasis.opendocument.formula' => 'odf', |
|
169
|
|
|
'application/vnd.oasis.opendocument.formula-template' => 'odft', |
|
170
|
|
|
'application/vnd.oasis.opendocument.graphics' => 'odg', |
|
171
|
|
|
'application/vnd.oasis.opendocument.graphics-template' => 'otg', |
|
172
|
|
|
'application/vnd.oasis.opendocument.image' => 'odi', |
|
173
|
|
|
'application/vnd.oasis.opendocument.image-template' => 'oti', |
|
174
|
|
|
'application/vnd.oasis.opendocument.presentation' => 'odp', |
|
175
|
|
|
'application/vnd.oasis.opendocument.presentation-template' => 'otp', |
|
176
|
|
|
'application/vnd.oasis.opendocument.spreadsheet' => 'ods', |
|
177
|
|
|
'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots', |
|
178
|
|
|
'application/vnd.oasis.opendocument.text' => 'odt', |
|
179
|
|
|
'application/vnd.oasis.opendocument.text-master' => 'odm', |
|
180
|
|
|
'application/vnd.oasis.opendocument.text-template' => 'ott', |
|
181
|
|
|
'application/vnd.oasis.opendocument.text-web' => 'oth', |
|
182
|
|
|
'application/vnd.olpc-sugar' => 'xo', |
|
183
|
|
|
'application/vnd.oma.dd2+xml' => 'dd2', |
|
184
|
|
|
'application/vnd.openofficeorg.extension' => 'oxt', |
|
185
|
|
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx', |
|
186
|
|
|
'application/vnd.openxmlformats-officedocument.presentationml.slide' => 'sldx', |
|
187
|
|
|
'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx', |
|
188
|
|
|
'application/vnd.openxmlformats-officedocument.presentationml.template' => 'potx', |
|
189
|
|
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx', |
|
190
|
|
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'xltx', |
|
191
|
|
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', |
|
192
|
|
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx', |
|
193
|
|
|
'application/vnd.pvi.ptid1' => 'ptid', |
|
194
|
|
|
'application/vnd.quark.quarkxpress' => [ |
|
195
|
|
|
'qxd', |
|
196
|
|
|
'qxt', |
|
197
|
|
|
'qwd', |
|
198
|
|
|
'qwt', |
|
199
|
|
|
'qxl', |
|
200
|
|
|
'qxb', |
|
201
|
|
|
], |
|
202
|
|
|
'application/vnd.realvnc.bed' => 'bed', |
|
203
|
|
|
'application/vnd.recordare.musicxml' => 'mxl', |
|
204
|
|
|
'application/vnd.recordare.musicxml+xml' => 'musicxml', |
|
205
|
|
|
'application/vnd.rig.cryptonote' => 'cryptonote', |
|
206
|
|
|
'application/vnd.rim.cod' => 'cod', |
|
207
|
|
|
'application/vnd.rn-realmedia' => 'rm', |
|
208
|
|
|
'application/vnd.rn-realmedia-vbr' => 'rmvb', |
|
209
|
|
|
'application/vnd.route66.link66+xml' => 'link66', |
|
210
|
|
|
'application/vnd.sailingtracker.track' => 'st', |
|
211
|
|
|
'application/vnd.seemail' => 'see', |
|
212
|
|
|
'application/vnd.sema' => 'sema', |
|
213
|
|
|
'application/vnd.semd' => 'semd', |
|
214
|
|
|
'application/vnd.semf' => 'semf', |
|
215
|
|
|
'application/vnd.shana.informed.formdata' => 'ifm', |
|
216
|
|
|
'application/vnd.shana.informed.formtemplate' => 'itp', |
|
217
|
|
|
'application/vnd.shana.informed.interchange' => 'iif', |
|
218
|
|
|
'application/vnd.shana.informed.package' => 'ipk', |
|
219
|
|
|
'application/vnd.simtech-mindmapper' => ['twd', 'twds'], |
|
220
|
|
|
'application/vnd.smaf' => 'mmf', |
|
221
|
|
|
'application/vnd.stepmania.stepchart' => 'sm', |
|
222
|
|
|
'application/vnd.sun.xml.calc' => 'sxc', |
|
223
|
|
|
'application/vnd.sun.xml.calc.template' => 'stc', |
|
224
|
|
|
'application/vnd.sun.xml.draw' => 'sxd', |
|
225
|
|
|
'application/vnd.sun.xml.draw.template' => 'std', |
|
226
|
|
|
'application/vnd.sun.xml.impress' => 'sxi', |
|
227
|
|
|
'application/vnd.sun.xml.impress.template' => 'sti', |
|
228
|
|
|
'application/vnd.sun.xml.math' => 'sxm', |
|
229
|
|
|
'application/vnd.sun.xml.writer' => 'sxw', |
|
230
|
|
|
'application/vnd.sun.xml.writer.global' => 'sxg', |
|
231
|
|
|
'application/vnd.sun.xml.writer.template' => 'stw', |
|
232
|
|
|
'application/vnd.sus-calendar' => ['sus', 'susp'], |
|
233
|
|
|
'application/vnd.svd' => 'svd', |
|
234
|
|
|
'application/vnd.symbian.install' => ['sis', 'sisx'], |
|
235
|
|
|
'application/vnd.syncml+xml' => 'xsm', |
|
236
|
|
|
'application/vnd.syncml.dm+wbxml' => 'bdm', |
|
237
|
|
|
'application/vnd.syncml.dm+xml' => 'xdm', |
|
238
|
|
|
'application/vnd.tao.intent-module-archive' => 'tao', |
|
239
|
|
|
'application/vnd.tcpdump.pcap' => ['pcap', 'cap', 'dmp'], |
|
240
|
|
|
'application/vnd.tmobile-livetv' => 'tmo', |
|
241
|
|
|
'application/vnd.trid.tpt' => 'tpt', |
|
242
|
|
|
'application/vnd.triscape.mxs' => 'mxs', |
|
243
|
|
|
'application/vnd.trueapp' => 'tra', |
|
244
|
|
|
'application/vnd.ufdl' => ['ufd', 'ufdl'], |
|
245
|
|
|
'application/vnd.uiq.theme' => 'utz', |
|
246
|
|
|
'application/vnd.umajin' => 'umj', |
|
247
|
|
|
'application/vnd.unity' => 'unityweb', |
|
248
|
|
|
'application/vnd.uoml+xml' => 'uoml', |
|
249
|
|
|
'application/vnd.vcx' => 'vcx', |
|
250
|
|
|
'application/vnd.visio' => ['vsd', 'vst', 'vss', 'vsw'], |
|
251
|
|
|
'application/vnd.visionary' => 'vis', |
|
252
|
|
|
'application/vnd.vsf' => 'vsf', |
|
253
|
|
|
'application/vnd.wap.wbxml' => 'wbxml', |
|
254
|
|
|
'application/vnd.wap.wmlc' => 'wmlc', |
|
255
|
|
|
'application/vnd.wap.wmlscriptc' => 'wmlsc', |
|
256
|
|
|
'application/vnd.webturbo' => 'wtb', |
|
257
|
|
|
'application/vnd.wolfram.player' => 'nbp', |
|
258
|
|
|
'application/vnd.wordperfect' => 'wpd', |
|
259
|
|
|
'application/vnd.wqd' => 'wqd', |
|
260
|
|
|
'application/vnd.wt.stf' => 'stf', |
|
261
|
|
|
'application/vnd.xara' => 'xar', |
|
262
|
|
|
'application/vnd.xfdl' => 'xfdl', |
|
263
|
|
|
'application/voicexml+xml' => 'vxml', |
|
264
|
|
|
'application/widget' => 'wgt', |
|
265
|
|
|
'application/winhlp' => 'hlp', |
|
266
|
|
|
'application/wsdl+xml' => 'wsdl', |
|
267
|
|
|
'application/wspolicy+xml' => 'wspolicy', |
|
268
|
|
|
'application/x-7z-compressed' => '7z', |
|
269
|
|
|
'application/x-bittorrent' => 'torrent', |
|
270
|
|
|
'application/x-blorb' => ['blb', 'blorb'], |
|
271
|
|
|
'application/x-bzip' => 'bz', |
|
272
|
|
|
'application/x-cdlink' => 'vcd', |
|
273
|
|
|
'application/x-cfs-compressed' => 'cfs', |
|
274
|
|
|
'application/x-chat' => 'chat', |
|
275
|
|
|
'application/x-chess-pgn' => 'pgn', |
|
276
|
|
|
'application/x-conference' => 'nsc', |
|
277
|
|
|
'application/x-cpio' => 'cpio', |
|
278
|
|
|
'application/x-csh' => 'csh', |
|
279
|
|
|
'application/x-debian-package' => ['deb', 'udeb'], |
|
280
|
|
|
'application/x-dgc-compressed' => 'dgc', |
|
281
|
|
|
'application/x-director' => [ |
|
282
|
|
|
'dir', |
|
283
|
|
|
'dcr', |
|
284
|
|
|
'dxr', |
|
285
|
|
|
'cst', |
|
286
|
|
|
'cct', |
|
287
|
|
|
'cxt', |
|
288
|
|
|
'w3d', |
|
289
|
|
|
'fgd', |
|
290
|
|
|
'swa', |
|
291
|
|
|
], |
|
292
|
|
|
'application/x-font-ttf' => ['ttf', 'ttc'], |
|
293
|
|
|
'application/x-font-type1' => ['pfa', 'pfb', 'pfm', 'afm'], |
|
294
|
|
|
'application/x-font-woff' => 'woff', |
|
295
|
|
|
'application/x-freearc' => 'arc', |
|
296
|
|
|
'application/x-futuresplash' => 'spl', |
|
297
|
|
|
'application/x-gca-compressed' => 'gca', |
|
298
|
|
|
'application/x-glulx' => 'ulx', |
|
299
|
|
|
'application/x-gnumeric' => 'gnumeric', |
|
300
|
|
|
'application/x-gramps-xml' => 'gramps', |
|
301
|
|
|
'application/x-gtar' => 'gtar', |
|
302
|
|
|
'application/x-hdf' => 'hdf', |
|
303
|
|
|
'application/x-install-instructions' => 'install', |
|
304
|
|
|
'application/x-iso9660-image' => 'iso', |
|
305
|
|
|
'application/x-java-jnlp-file' => 'jnlp', |
|
306
|
|
|
'application/x-latex' => 'latex', |
|
307
|
|
|
'application/x-lzh-compressed' => ['lzh', 'lha'], |
|
308
|
|
|
'application/x-mie' => 'mie', |
|
309
|
|
|
'application/x-mobipocket-ebook' => ['prc', 'mobi'], |
|
310
|
|
|
'application/x-ms-application' => 'application', |
|
311
|
|
|
'application/x-ms-shortcut' => 'lnk', |
|
312
|
|
|
'application/x-ms-wmd' => 'wmd', |
|
313
|
|
|
'application/x-ms-wmz' => 'wmz', |
|
314
|
|
|
'application/x-ms-xbap' => 'xbap', |
|
315
|
|
|
'application/x-msaccess' => 'mdb', |
|
316
|
|
|
'application/x-msbinder' => 'obd', |
|
317
|
|
|
'application/x-mscardfile' => 'crd', |
|
318
|
|
|
'application/x-msclip' => 'clp', |
|
319
|
|
|
'application/x-msdownload' => ['exe', 'dll', 'com', 'bat', 'msi'], |
|
320
|
|
|
'application/x-msmediaview' => [ |
|
321
|
|
|
'mvb', |
|
322
|
|
|
'm13', |
|
323
|
|
|
'm14', |
|
324
|
|
|
], |
|
325
|
|
|
'application/x-msmetafile' => ['wmf', 'wmz', 'emf', 'emz'], |
|
326
|
|
|
'application/x-rar-compressed' => 'rar', |
|
327
|
|
|
'application/x-research-info-systems' => 'ris', |
|
328
|
|
|
'application/x-sh' => 'sh', |
|
329
|
|
|
'application/x-shar' => 'shar', |
|
330
|
|
|
'application/x-shockwave-flash' => 'swf', |
|
331
|
|
|
'application/x-silverlight-app' => 'xap', |
|
332
|
|
|
'application/x-sql' => 'sql', |
|
333
|
|
|
'application/x-stuffit' => 'sit', |
|
334
|
|
|
'application/x-stuffitx' => 'sitx', |
|
335
|
|
|
'application/x-subrip' => 'srt', |
|
336
|
|
|
'application/x-sv4cpio' => 'sv4cpio', |
|
337
|
|
|
'application/x-sv4crc' => 'sv4crc', |
|
338
|
|
|
'application/x-t3vm-image' => 't3', |
|
339
|
|
|
'application/x-tads' => 'gam', |
|
340
|
|
|
'application/x-tar' => 'tar', |
|
341
|
|
|
'application/x-tcl' => 'tcl', |
|
342
|
|
|
'application/x-tex' => 'tex', |
|
343
|
|
|
'application/x-tex-tfm' => 'tfm', |
|
344
|
|
|
'application/x-texinfo' => ['texinfo', 'texi'], |
|
345
|
|
|
'application/x-tgif' => 'obj', |
|
346
|
|
|
'application/x-ustar' => 'ustar', |
|
347
|
|
|
'application/x-wais-source' => 'src', |
|
348
|
|
|
'application/x-x509-ca-cert' => ['der', 'crt'], |
|
349
|
|
|
'application/x-xfig' => 'fig', |
|
350
|
|
|
'application/x-xliff+xml' => 'xlf', |
|
351
|
|
|
'application/x-xpinstall' => 'xpi', |
|
352
|
|
|
'application/x-xz' => 'xz', |
|
353
|
|
|
'application/x-zmachine' => 'z1', |
|
354
|
|
|
'application/xaml+xml' => 'xaml', |
|
355
|
|
|
'application/xcap-diff+xml' => 'xdf', |
|
356
|
|
|
'application/xenc+xml' => 'xenc', |
|
357
|
|
|
'application/xhtml+xml' => ['xhtml', 'xht'], |
|
358
|
|
|
'application/xml' => ['xml', 'xsl'], |
|
359
|
|
|
'application/xml-dtd' => 'dtd', |
|
360
|
|
|
'application/xop+xml' => 'xop', |
|
361
|
|
|
'application/xproc+xml' => 'xpl', |
|
362
|
|
|
'application/xslt+xml' => 'xslt', |
|
363
|
|
|
'application/xspf+xml' => 'xspf', |
|
364
|
|
|
'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'], |
|
365
|
|
|
'application/yang' => 'yang', |
|
366
|
|
|
'application/yin+xml' => 'yin', |
|
367
|
|
|
'application/zip' => 'zip', |
|
368
|
|
|
'audio/adpcm' => 'adp', |
|
369
|
|
|
'audio/basic' => ['au', 'snd'], |
|
370
|
|
|
'audio/midi' => ['mid', 'midi', 'kar', 'rmi'], |
|
371
|
|
|
'audio/mp4' => 'mp4a', |
|
372
|
|
|
'audio/mpeg' => [ |
|
373
|
|
|
'mpga', |
|
374
|
|
|
'mp2', |
|
375
|
|
|
'mp2a', |
|
376
|
|
|
'mp3', |
|
377
|
|
|
'm2a', |
|
378
|
|
|
'm3a', |
|
379
|
|
|
], |
|
380
|
|
|
'audio/ogg' => ['oga', 'ogg', 'spx'], |
|
381
|
|
|
'audio/vnd.dece.audio' => ['uva', 'uvva'], |
|
382
|
|
|
'audio/vnd.rip' => 'rip', |
|
383
|
|
|
'audio/webm' => 'weba', |
|
384
|
|
|
'audio/x-aac' => 'aac', |
|
385
|
|
|
'audio/x-aiff' => ['aif', 'aiff', 'aifc'], |
|
386
|
|
|
'audio/x-caf' => 'caf', |
|
387
|
|
|
'audio/x-flac' => 'flac', |
|
388
|
|
|
'audio/x-matroska' => 'mka', |
|
389
|
|
|
'audio/x-mpegurl' => 'm3u', |
|
390
|
|
|
'audio/x-ms-wax' => 'wax', |
|
391
|
|
|
'audio/x-ms-wma' => 'wma', |
|
392
|
|
|
'audio/x-pn-realaudio' => ['ram', 'ra'], |
|
393
|
|
|
'audio/x-pn-realaudio-plugin' => 'rmp', |
|
394
|
|
|
'audio/x-wav' => 'wav', |
|
395
|
|
|
'audio/xm' => 'xm', |
|
396
|
|
|
'image/bmp' => 'bmp', |
|
397
|
|
|
'image/cgm' => 'cgm', |
|
398
|
|
|
'image/g3fax' => 'g3', |
|
399
|
|
|
'image/gif' => 'gif', |
|
400
|
|
|
'image/ief' => 'ief', |
|
401
|
|
|
'image/jpeg' => ['jpeg', 'jpg', 'jpe'], |
|
402
|
|
|
'image/ktx' => 'ktx', |
|
403
|
|
|
'image/png' => 'png', |
|
404
|
|
|
'image/prs.btif' => 'btif', |
|
405
|
|
|
'image/sgi' => 'sgi', |
|
406
|
|
|
'image/svg+xml' => ['svg', 'svgz'], |
|
407
|
|
|
'image/tiff' => ['tiff', 'tif'], |
|
408
|
|
|
'image/vnd.adobe.photoshop' => 'psd', |
|
409
|
|
|
'image/vnd.dece.graphic' => ['uvi', 'uvvi', 'uvg', 'uvvg'], |
|
410
|
|
|
'image/vnd.dvb.subtitle' => 'sub', |
|
411
|
|
|
'image/vnd.djvu' => ['djvu', 'djv'], |
|
412
|
|
|
'image/vnd.dwg' => 'dwg', |
|
413
|
|
|
'image/vnd.dxf' => 'dxf', |
|
414
|
|
|
'image/vnd.fastbidsheet' => 'fbs', |
|
415
|
|
|
'image/vnd.fpx' => 'fpx', |
|
416
|
|
|
'image/vnd.fst' => 'fst', |
|
417
|
|
|
'image/vnd.fujixerox.edmics-mmr' => 'mmr', |
|
418
|
|
|
'image/vnd.fujixerox.edmics-rlc' => 'rlc', |
|
419
|
|
|
'image/vnd.ms-modi' => 'mdi', |
|
420
|
|
|
'image/vnd.ms-photo' => 'wdp', |
|
421
|
|
|
'image/vnd.net-fpx' => 'npx', |
|
422
|
|
|
'image/vnd.wap.wbmp' => 'wbmp', |
|
423
|
|
|
'image/vnd.xiff' => 'xif', |
|
424
|
|
|
'image/webp' => 'webp', |
|
425
|
|
|
'image/x-3ds' => '3ds', |
|
426
|
|
|
'image/x-cmu-raster' => 'ras', |
|
427
|
|
|
'image/x-cmx' => 'cmx', |
|
428
|
|
|
'image/x-freehand' => ['fh', 'fhc', 'fh4', 'fh5', 'fh7'], |
|
429
|
|
|
'image/x-icon' => 'ico', |
|
430
|
|
|
'image/x-mrsid-image' => 'sid', |
|
431
|
|
|
'image/x-pcx' => 'pcx', |
|
432
|
|
|
'image/x-pict' => ['pic', 'pct'], |
|
433
|
|
|
'image/x-portable-anymap' => 'pnm', |
|
434
|
|
|
'image/x-portable-bitmap' => 'pbm', |
|
435
|
|
|
'image/x-portable-graymap' => 'pgm', |
|
436
|
|
|
'image/x-portable-pixmap' => 'ppm', |
|
437
|
|
|
'image/x-rgb' => 'rgb', |
|
438
|
|
|
'image/x-tga' => 'tga', |
|
439
|
|
|
'image/x-xbitmap' => 'xbm', |
|
440
|
|
|
'image/x-xpixmap' => 'xpm', |
|
441
|
|
|
'image/x-xwindowdump' => 'xwd', |
|
442
|
|
|
'message/rfc822' => ['eml', 'mime'], |
|
443
|
|
|
'model/iges' => ['igs', 'iges'], |
|
444
|
|
|
'model/mesh' => ['msh', 'mesh', 'silo'], |
|
445
|
|
|
'model/vnd.collada+xml' => 'dae', |
|
446
|
|
|
'model/vnd.dwf' => 'dwf', |
|
447
|
|
|
'model/vnd.gdl' => 'gdl', |
|
448
|
|
|
'model/vnd.gtw' => 'gtw', |
|
449
|
|
|
'model/vnd.mts' => 'mts', |
|
450
|
|
|
'model/vnd.vtu' => 'vtu', |
|
451
|
|
|
'model/vrml' => ['wrl', 'vrml'], |
|
452
|
|
|
'model/x3d+binary' => 'x3db', |
|
453
|
|
|
'model/x3d+vrml' => 'x3dv', |
|
454
|
|
|
'model/x3d+xml' => 'x3d', |
|
455
|
|
|
'text/cache-manifest' => 'appcache', |
|
456
|
|
|
'text/calendar' => ['ics', 'ifb'], |
|
457
|
|
|
'text/css' => 'css', |
|
458
|
|
|
'text/csv' => 'csv', |
|
459
|
|
|
'text/html' => ['html', 'htm'], |
|
460
|
|
|
'text/n3' => 'n3', |
|
461
|
|
|
'text/plain' => [ |
|
462
|
|
|
'txt', |
|
463
|
|
|
'text', |
|
464
|
|
|
'conf', |
|
465
|
|
|
'def', |
|
466
|
|
|
'list', |
|
467
|
|
|
'log', |
|
468
|
|
|
'in', |
|
469
|
|
|
], |
|
470
|
|
|
'text/prs.lines.tag' => 'dsc', |
|
471
|
|
|
'text/richtext' => 'rtx', |
|
472
|
|
|
'text/sgml' => ['sgml', 'sgm'], |
|
473
|
|
|
'text/tab-separated-values' => 'tsv', |
|
474
|
|
|
'text/troff' => [ |
|
475
|
|
|
't', |
|
476
|
|
|
'tr', |
|
477
|
|
|
'roff', |
|
478
|
|
|
'man', |
|
479
|
|
|
'me', |
|
480
|
|
|
'ms', |
|
481
|
|
|
], |
|
482
|
|
|
'text/turtle' => 'ttl', |
|
483
|
|
|
'text/uri-list' => ['uri', 'uris', 'urls'], |
|
484
|
|
|
'text/vcard' => 'vcard', |
|
485
|
|
|
'text/vnd.curl' => 'curl', |
|
486
|
|
|
'text/vnd.curl.dcurl' => 'dcurl', |
|
487
|
|
|
'text/vnd.curl.scurl' => 'scurl', |
|
488
|
|
|
'text/vnd.curl.mcurl' => 'mcurl', |
|
489
|
|
|
'text/vnd.dvb.subtitle' => 'sub', |
|
490
|
|
|
'text/vnd.fly' => 'fly', |
|
491
|
|
|
'text/vnd.fmi.flexstor' => 'flx', |
|
492
|
|
|
'text/vnd.graphviz' => 'gv', |
|
493
|
|
|
'text/vnd.in3d.3dml' => '3dml', |
|
494
|
|
|
'text/vnd.in3d.spot' => 'spot', |
|
495
|
|
|
'text/vnd.sun.j2me.app-descriptor' => 'jad', |
|
496
|
|
|
'text/vnd.wap.wml' => 'wml', |
|
497
|
|
|
'text/vnd.wap.wmlscript' => 'wmls', |
|
498
|
|
|
'text/x-asm' => ['s', 'asm'], |
|
499
|
|
|
'text/x-fortran' => ['f', 'for', 'f77', 'f90'], |
|
500
|
|
|
'text/x-java-source' => 'java', |
|
501
|
|
|
'text/x-opml' => 'opml', |
|
502
|
|
|
'text/x-pascal' => ['p', 'pas'], |
|
503
|
|
|
'text/x-nfo' => 'nfo', |
|
504
|
|
|
'text/x-setext' => 'etx', |
|
505
|
|
|
'text/x-sfv' => 'sfv', |
|
506
|
|
|
'text/x-uuencode' => 'uu', |
|
507
|
|
|
'text/x-vcalendar' => 'vcs', |
|
508
|
|
|
'text/x-vcard' => 'vcf', |
|
509
|
|
|
'video/3gpp' => '3gp', |
|
510
|
|
|
'video/3gpp2' => '3g2', |
|
511
|
|
|
'video/h261' => 'h261', |
|
512
|
|
|
'video/h263' => 'h263', |
|
513
|
|
|
'video/h264' => 'h264', |
|
514
|
|
|
'video/jpeg' => 'jpgv', |
|
515
|
|
|
'video/jpm' => ['jpm', 'jpgm'], |
|
516
|
|
|
'video/mj2' => 'mj2', |
|
517
|
|
|
'video/mp4' => 'mp4', |
|
518
|
|
|
'video/mpeg' => ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v'], |
|
519
|
|
|
'video/ogg' => 'ogv', |
|
520
|
|
|
'video/quicktime' => ['qt', 'mov'], |
|
521
|
|
|
'video/vnd.dece.hd' => ['uvh', 'uvvh'], |
|
522
|
|
|
'video/vnd.dece.mobile' => ['uvm', 'uvvm'], |
|
523
|
|
|
'video/vnd.dece.pd' => ['uvp', 'uvvp'], |
|
524
|
|
|
'video/vnd.dece.sd' => ['uvs', 'uvvs'], |
|
525
|
|
|
'video/vnd.dece.video' => ['uvv', 'uvvv'], |
|
526
|
|
|
'video/vnd.dvb.file' => 'dvb', |
|
527
|
|
|
'video/vnd.fvt' => 'fvt', |
|
528
|
|
|
'video/vnd.mpegurl' => ['mxu', 'm4u'], |
|
529
|
|
|
'video/vnd.ms-playready.media.pyv' => 'pyv', |
|
530
|
|
|
'video/vnd.uvvu.mp4' => ['uvu', 'uvvu'], |
|
531
|
|
|
'video/vnd.vivo' => 'viv', |
|
532
|
|
|
'video/webm' => 'webm', |
|
533
|
|
|
'video/x-f4v' => 'f4v', |
|
534
|
|
|
'video/x-fli' => 'fli', |
|
535
|
|
|
'video/x-flv' => 'flv', |
|
536
|
|
|
'video/x-m4v' => 'm4v', |
|
537
|
|
|
'video/x-matroska' => ['mkv', 'mk3d', 'mks'], |
|
538
|
|
|
'video/x-mng' => 'mng', |
|
539
|
|
|
'video/x-ms-asf' => ['asf', 'asx'], |
|
540
|
|
|
'video/x-ms-vob' => 'vob', |
|
541
|
|
|
'video/x-ms-wm' => 'wm', |
|
542
|
|
|
'video/x-ms-wmv' => 'wmv', |
|
543
|
|
|
'video/x-ms-wmx' => 'wmx', |
|
544
|
|
|
'video/x-ms-wvx' => 'wvx', |
|
545
|
|
|
'video/x-msvideo' => 'avi', |
|
546
|
|
|
'video/x-sgi-movie' => 'movie', |
|
547
|
|
|
]; |
|
548
|
|
|
|
|
549
|
1 |
|
public function mimeType(): string |
|
550
|
|
|
{ |
|
551
|
1 |
|
return $this->randomizer->randomElement(array_keys($this->mimeTypes)); |
|
552
|
|
|
} |
|
553
|
|
|
|
|
554
|
1 |
|
public function extension(): string |
|
555
|
|
|
{ |
|
556
|
1 |
|
$extension = $this->randomizer->randomElement($this->mimeTypes); |
|
557
|
|
|
|
|
558
|
1 |
|
return is_array($extension) ? $this->randomizer->randomElement($extension) : $extension; |
|
559
|
|
|
} |
|
560
|
|
|
} |
|
561
|
|
|
|