Skip to content
This repository
Browse code

sort the mimeTypes map alphabetically

except for html which is at the top. Easier maintainance
  • Loading branch information...
commit 90ae2df38ea85fea1a52aaeb83c917085dda5a7f 1 parent 8a09b3d
Andy Dawson authored July 03, 2012

Showing 1 changed file with 115 additions and 115 deletions. Show diff stats Hide diff stats

  1. 230  lib/Cake/Network/CakeResponse.php
230  lib/Cake/Network/CakeResponse.php
@@ -81,18 +81,31 @@ class CakeResponse {
81 81
  */
82 82
 	protected $_mimeTypes = array(
83 83
 		'html' => array('text/html', '*/*'),
84  
-		'json' => 'application/json',
85  
-		'xml' => array('application/xml', 'text/xml'),
86  
-		'rss' => 'application/rss+xml',
  84
+		'7z' => 'application/x-7z-compressed',
  85
+		'aac' => 'audio/aac',
87 86
 		'ai' => 'application/postscript',
  87
+		'aif' => 'audio/x-aiff',
  88
+		'aifc' => 'audio/x-aiff',
  89
+		'aiff' => 'audio/x-aiff',
  90
+		'amf' => 'application/x-amf',
  91
+		'appcache' => 'text/cache-manifest',
  92
+		'asc' => 'text/plain',
  93
+		'atom' => 'application/atom+xml',
  94
+		'au' => 'audio/basic',
  95
+		'avi' => 'video/x-msvideo',
88 96
 		'bcpio' => 'application/x-bcpio',
89 97
 		'bin' => 'application/octet-stream',
  98
+		'bz2' => 'application/x-bzip',
  99
+		'c' => 'text/plain',
  100
+		'cc' => 'text/plain',
90 101
 		'ccad' => 'application/clariscad',
91 102
 		'cdf' => 'application/x-netcdf',
92 103
 		'class' => 'application/octet-stream',
93 104
 		'cpio' => 'application/x-cpio',
94 105
 		'cpt' => 'application/mac-compactpro',
  106
+		'crx' => 'application/x-chrome-extension',
95 107
 		'csh' => 'application/x-csh',
  108
+		'css' => 'text/css',
96 109
 		'csv' => array('text/csv', 'application/vnd.ms-excel', 'text/plain'),
97 110
 		'dcr' => 'application/x-director',
98 111
 		'dir' => 'application/x-director',
@@ -105,44 +118,111 @@ class CakeResponse {
105 118
 		'dxr' => 'application/x-director',
106 119
 		'eot' => 'application/vnd.ms-fontobject',
107 120
 		'eps' => 'application/postscript',
  121
+		'etx' => 'text/x-setext',
108 122
 		'exe' => 'application/octet-stream',
109 123
 		'ez' => 'application/andrew-inset',
  124
+		'f' => 'text/plain',
  125
+		'f4a' => 'audio/mp4',
  126
+		'f4b' => 'audio/mp4',
  127
+		'f4p' => 'video/mp4',
  128
+		'f4v' => 'video/mp4',
  129
+		'f90' => 'text/plain',
  130
+		'file' => 'multipart/form-data',
  131
+		'fli' => 'video/x-fli',
110 132
 		'flv' => 'video/x-flv',
  133
+		'form' => 'application/x-www-form-urlencoded',
  134
+		'gif' => 'image/gif',
111 135
 		'gtar' => 'application/x-gtar',
112 136
 		'gz' => 'application/x-gzip',
113  
-		'bz2' => 'application/x-bzip',
114  
-		'7z' => 'application/x-7z-compressed',
  137
+		'h' => 'text/plain',
115 138
 		'hdf' => 'application/x-hdf',
  139
+		'hh' => 'text/plain',
116 140
 		'hqx' => 'application/mac-binhex40',
  141
+		'htc' => 'text/x-component',
  142
+		'htm' => array('text/html', '*/*'),
  143
+		'ice' => 'x-conference/x-cooltalk',
117 144
 		'ico' => 'image/x-icon',
  145
+		'ics' => 'text/calendar',
  146
+		'ief' => 'image/ief',
  147
+		'iges' => 'model/iges',
  148
+		'igs' => 'model/iges',
118 149
 		'ips' => 'application/x-ipscript',
119 150
 		'ipx' => 'application/x-ipix',
  151
+		'javascript' => 'application/javascript',
  152
+		'jpe' => 'image/jpeg',
  153
+		'jpeg' => 'image/jpeg',
  154
+		'jpg' => 'image/jpeg',
120 155
 		'js' => 'application/javascript',
  156
+		'json' => 'application/json',
  157
+		'kar' => 'audio/midi',
121 158
 		'latex' => 'application/x-latex',
122 159
 		'lha' => 'application/octet-stream',
123 160
 		'lsp' => 'application/x-lisp',
124 161
 		'lzh' => 'application/octet-stream',
  162
+		'm' => 'text/plain',
  163
+		'm4a' => 'audio/mp4',
  164
+		'm4v' => 'video/mp4',
125 165
 		'man' => 'application/x-troff-man',
  166
+		'manifest' => 'text/cache-manifest',
126 167
 		'me' => 'application/x-troff-me',
  168
+		'mesh' => 'model/mesh',
  169
+		'mid' => 'audio/midi',
  170
+		'midi' => 'audio/midi',
127 171
 		'mif' => 'application/vnd.mif',
  172
+		'mime' => 'www/mime',
  173
+		'mov' => 'video/quicktime',
  174
+		'movie' => 'video/x-sgi-movie',
  175
+		'mp2' => 'audio/mpeg',
  176
+		'mp3' => 'audio/mpeg',
  177
+		'mp4' => 'video/mp4',
  178
+		'mpe' => 'video/mpeg',
  179
+		'mpeg' => 'video/mpeg',
  180
+		'mpg' => 'video/mpeg',
  181
+		'mpga' => 'audio/mpeg',
128 182
 		'ms' => 'application/x-troff-ms',
  183
+		'msh' => 'model/mesh',
129 184
 		'nc' => 'application/x-netcdf',
130 185
 		'oda' => 'application/oda',
  186
+		'oex' => 'application/x-opera-extension',
  187
+		'oga' => 'audio/ogg',
  188
+		'ogg' => 'audio/ogg',
  189
+		'ogv' => 'video/ogg',
131 190
 		'otf' => 'font/otf',
  191
+		'pbm' => 'image/x-portable-bitmap',
  192
+		'pdb' => 'chemical/x-pdb',
132 193
 		'pdf' => 'application/pdf',
  194
+		'pgm' => 'image/x-portable-graymap',
133 195
 		'pgn' => 'application/x-chess-pgn',
  196
+		'png' => 'image/png',
  197
+		'pnm' => 'image/x-portable-anymap',
134 198
 		'pot' => 'application/mspowerpoint',
  199
+		'ppm' => 'image/x-portable-pixmap',
135 200
 		'pps' => 'application/mspowerpoint',
136 201
 		'ppt' => 'application/mspowerpoint',
137 202
 		'ppz' => 'application/mspowerpoint',
138 203
 		'pre' => 'application/x-freelance',
139 204
 		'prt' => 'application/pro_eng',
140 205
 		'ps' => 'application/postscript',
  206
+		'qt' => 'video/quicktime',
  207
+		'ra' => 'audio/x-realaudio',
  208
+		'ram' => 'audio/x-pn-realaudio',
  209
+		'ras' => 'image/cmu-raster',
  210
+		'rdf' => 'application/xml',
  211
+		'rgb' => 'image/x-rgb',
  212
+		'rm' => 'audio/x-pn-realaudio',
141 213
 		'roff' => 'application/x-troff',
  214
+		'rpm' => 'audio/x-pn-realaudio-plugin',
  215
+		'rss' => 'application/rss+xml',
  216
+		'rtf' => 'text/rtf',
  217
+		'rtx' => 'text/richtext',
  218
+		'safariextz' => 'application/octet-stream',
142 219
 		'scm' => 'application/x-lotusscreencam',
143 220
 		'set' => 'application/set',
  221
+		'sgm' => 'text/sgml',
  222
+		'sgml' => 'text/sgml',
144 223
 		'sh' => 'application/x-sh',
145 224
 		'shar' => 'application/x-shar',
  225
+		'silo' => 'model/mesh',
146 226
 		'sit' => 'application/x-stuffit',
147 227
 		'skd' => 'application/x-koan',
148 228
 		'skm' => 'application/x-koan',
@@ -150,8 +230,10 @@ class CakeResponse {
150 230
 		'skt' => 'application/x-koan',
151 231
 		'smi' => 'application/smil',
152 232
 		'smil' => 'application/smil',
  233
+		'snd' => 'audio/basic',
153 234
 		'sol' => 'application/solids',
154 235
 		'spl' => 'application/x-futuresplash',
  236
+		'spx' => 'audio/ogg',
155 237
 		'src' => 'application/x-wais-source',
156 238
 		'step' => 'application/STEP',
157 239
 		'stl' => 'application/SLA',
@@ -167,132 +249,50 @@ class CakeResponse {
167 249
 		'tex' => 'application/x-tex',
168 250
 		'texi' => 'application/x-texinfo',
169 251
 		'texinfo' => 'application/x-texinfo',
  252
+		'text' => 'text/plain',
  253
+		'tif' => 'image/tiff',
  254
+		'tiff' => 'image/tiff',
  255
+		'tpl' => 'text/template',
170 256
 		'tr' => 'application/x-troff',
  257
+		'tsi' => 'audio/TSP-audio',
171 258
 		'tsp' => 'application/dsptype',
  259
+		'tsv' => 'text/tab-separated-values',
172 260
 		'ttc' => 'font/ttf',
173 261
 		'ttf' => 'font/ttf',
  262
+		'txt' => 'text/plain',
174 263
 		'unv' => 'application/i-deas',
175 264
 		'ustar' => 'application/x-ustar',
176 265
 		'vcd' => 'application/x-cdlink',
  266
+		'vcf' => 'text/x-vcard',
177 267
 		'vda' => 'application/vda',
178  
-		'xlc' => 'application/vnd.ms-excel',
179  
-		'xll' => 'application/vnd.ms-excel',
180  
-		'xlm' => 'application/vnd.ms-excel',
181  
-		'xls' => 'application/vnd.ms-excel',
182  
-		'xlw' => 'application/vnd.ms-excel',
183  
-		'zip' => 'application/zip',
184  
-		'aif' => 'audio/x-aiff',
185  
-		'aifc' => 'audio/x-aiff',
186  
-		'aiff' => 'audio/x-aiff',
187  
-		'au' => 'audio/basic',
188  
-		'kar' => 'audio/midi',
189  
-		'mid' => 'audio/midi',
190  
-		'midi' => 'audio/midi',
191  
-		'mp2' => 'audio/mpeg',
192  
-		'mp3' => 'audio/mpeg',
193  
-		'mpga' => 'audio/mpeg',
194  
-		'ogg' => 'audio/ogg',
195  
-		'oga' => 'audio/ogg',
196  
-		'spx' => 'audio/ogg',
197  
-		'ra' => 'audio/x-realaudio',
198  
-		'ram' => 'audio/x-pn-realaudio',
199  
-		'rm' => 'audio/x-pn-realaudio',
200  
-		'rpm' => 'audio/x-pn-realaudio-plugin',
201  
-		'snd' => 'audio/basic',
202  
-		'tsi' => 'audio/TSP-audio',
203  
-		'wav' => 'audio/x-wav',
204  
-		'aac' => 'audio/aac',
205  
-		'asc' => 'text/plain',
206  
-		'c' => 'text/plain',
207  
-		'cc' => 'text/plain',
208  
-		'css' => 'text/css',
209  
-		'etx' => 'text/x-setext',
210  
-		'f' => 'text/plain',
211  
-		'f90' => 'text/plain',
212  
-		'h' => 'text/plain',
213  
-		'hh' => 'text/plain',
214  
-		'htm' => array('text/html', '*/*'),
215  
-		'ics' => 'text/calendar',
216  
-		'm' => 'text/plain',
217  
-		'rtf' => 'text/rtf',
218  
-		'rtx' => 'text/richtext',
219  
-		'sgm' => 'text/sgml',
220  
-		'sgml' => 'text/sgml',
221  
-		'tsv' => 'text/tab-separated-values',
222  
-		'tpl' => 'text/template',
223  
-		'txt' => 'text/plain',
224  
-		'text' => 'text/plain',
225  
-		'avi' => 'video/x-msvideo',
226  
-		'fli' => 'video/x-fli',
227  
-		'mov' => 'video/quicktime',
228  
-		'movie' => 'video/x-sgi-movie',
229  
-		'mpe' => 'video/mpeg',
230  
-		'mpeg' => 'video/mpeg',
231  
-		'mpg' => 'video/mpeg',
232  
-		'qt' => 'video/quicktime',
233 268
 		'viv' => 'video/vnd.vivo',
234 269
 		'vivo' => 'video/vnd.vivo',
235  
-		'ogv' => 'video/ogg',
236  
-		'webm' => 'video/webm',
237  
-		'mp4' => 'video/mp4',
238  
-		'm4v' => 'video/mp4',
239  
-		'f4v' => 'video/mp4',
240  
-		'f4p' => 'video/mp4',
241  
-		'm4a' => 'audio/mp4',
242  
-		'f4a' => 'audio/mp4',
243  
-		'f4b' => 'audio/mp4',
244  
-		'gif' => 'image/gif',
245  
-		'ief' => 'image/ief',
246  
-		'jpe' => 'image/jpeg',
247  
-		'jpeg' => 'image/jpeg',
248  
-		'jpg' => 'image/jpeg',
249  
-		'pbm' => 'image/x-portable-bitmap',
250  
-		'pgm' => 'image/x-portable-graymap',
251  
-		'png' => 'image/png',
252  
-		'pnm' => 'image/x-portable-anymap',
253  
-		'ppm' => 'image/x-portable-pixmap',
254  
-		'ras' => 'image/cmu-raster',
255  
-		'rgb' => 'image/x-rgb',
256  
-		'tif' => 'image/tiff',
257  
-		'tiff' => 'image/tiff',
258  
-		'xbm' => 'image/x-xbitmap',
259  
-		'xpm' => 'image/x-xpixmap',
260  
-		'xwd' => 'image/x-xwindowdump',
261  
-		'ice' => 'x-conference/x-cooltalk',
262  
-		'iges' => 'model/iges',
263  
-		'igs' => 'model/iges',
264  
-		'mesh' => 'model/mesh',
265  
-		'msh' => 'model/mesh',
266  
-		'silo' => 'model/mesh',
267 270
 		'vrml' => 'model/vrml',
268  
-		'wrl' => 'model/vrml',
269  
-		'mime' => 'www/mime',
270  
-		'pdb' => 'chemical/x-pdb',
271  
-		'xyz' => 'chemical/x-pdb',
272  
-		'javascript' => 'application/javascript',
273  
-		'form' => 'application/x-www-form-urlencoded',
274  
-		'file' => 'multipart/form-data',
275  
-		'xhtml'	=> array('application/xhtml+xml', 'application/xhtml', 'text/xhtml'),
276  
-		'xhtml-mobile'	=> 'application/vnd.wap.xhtml+xml',
277  
-		'atom' => 'application/atom+xml',
278  
-		'amf' => 'application/x-amf',
  271
+		'vtt' => 'text/vtt',
279 272
 		'wap' => array('text/vnd.wap.wml', 'text/vnd.wap.wmlscript', 'image/vnd.wap.wbmp'),
  273
+		'wav' => 'audio/x-wav',
  274
+		'wbmp' => 'image/vnd.wap.wbmp',
  275
+		'webapp' => 'application/x-web-app-manifest+json',
  276
+		'webm' => 'video/webm',
  277
+		'webp' => 'image/webp',
280 278
 		'wml' => 'text/vnd.wap.wml',
281 279
 		'wmlscript' => 'text/vnd.wap.wmlscript',
282  
-		'wbmp' => 'image/vnd.wap.wbmp',
283 280
 		'woff' => 'application/x-font-woff',
284  
-		'webp' => 'image/webp',
285  
-		'appcache' => 'text/cache-manifest',
286  
-		'manifest' => 'text/cache-manifest',
287  
-		'htc' => 'text/x-component',
288  
-		'rdf' => 'application/xml',
289  
-		'crx' => 'application/x-chrome-extension',
290  
-		'oex' => 'application/x-opera-extension',
  281
+		'wrl' => 'model/vrml',
  282
+		'xbm' => 'image/x-xbitmap',
  283
+		'xhtml'	=> array('application/xhtml+xml', 'application/xhtml', 'text/xhtml'),
  284
+		'xhtml-mobile'	=> 'application/vnd.wap.xhtml+xml',
  285
+		'xlc' => 'application/vnd.ms-excel',
  286
+		'xll' => 'application/vnd.ms-excel',
  287
+		'xlm' => 'application/vnd.ms-excel',
  288
+		'xls' => 'application/vnd.ms-excel',
  289
+		'xlw' => 'application/vnd.ms-excel',
  290
+		'xml' => array('application/xml', 'text/xml'),
291 291
 		'xpi' => 'application/x-xpinstall',
292  
-		'safariextz' => 'application/octet-stream',
293  
-		'webapp' => 'application/x-web-app-manifest+json',
294  
-		'vcf' => 'text/x-vcard',
295  
-		'vtt' => 'text/vtt',
  292
+		'xpm' => 'image/x-xpixmap',
  293
+		'xwd' => 'image/x-xwindowdump',
  294
+		'xyz' => 'chemical/x-pdb',
  295
+		'zip' => 'application/zip',
296 296
 	);
297 297
 
298 298
 /**

8 notes on commit 90ae2df

Mark Story
Owner
Andy Dawson
Collaborator

That's annoying - so the map is implicitly order-sensitive..

Mark Story
Owner

Looks like it.

José Lorenzo Rodríguez
Owner

It is, also it was reordered so it could fetch more common types faster

Mark Story
Owner

I'm going to revert this commit, as it broke tests and made getting at types like json a bit slower.

José Lorenzo Rodríguez
Owner

Were you going to rever this commit mark? 2.3 is still broken in CI

Mark Story
Owner

Yeah I saw that @AD7six reverted it and didn't bother.

Please sign in to comment.
Something went wrong with that request. Please try again.