Completed
Push — master ( f06e6b...d540a7 )
by Florin
02:24
created
migrations/m3_ucp_friends_module.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 					array(
21 21
 						'module_basename'   => '\florinp\messenger\ucp\ucp_friends_module',
22 22
 						'module_class' => 'ucp_friends_module',
23
-						'modes' => array('friends','requests'),
23
+						'modes' => array('friends', 'requests'),
24 24
 					),
25 25
 				)
26 26
 			),
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 					array(
37 37
 						'module_basename'   => '\florinp\messenger\ucp\ucp_friends_module',
38 38
 						'module_class' => 'ucp_friends_module',
39
-						'modes' => array('friends','requests'),
39
+						'modes' => array('friends', 'requests'),
40 40
 					)
41 41
 				)
42 42
 			),
Please login to merge, or discard this patch.
models/main_model.php 2 patches
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -114,10 +114,11 @@  discard block
 block discarded – undo
114 114
 			'sentAt' => time()
115 115
 		);
116 116
 
117
-		if ($this->db->insert('messages', $insert))
118
-			return $this->db->lastInsertId();
119
-		else
120
-			return false;
117
+		if ($this->db->insert('messages', $insert)) {
118
+					return $this->db->lastInsertId();
119
+		} else {
120
+					return false;
121
+		}
121 122
 	}
122 123
 
123 124
 	public function sendFile($data)
@@ -131,10 +132,11 @@  discard block
 block discarded – undo
131 132
 			'sentAt' => time()
132 133
 		);
133 134
 
134
-		if ($this->db->insert('files', $insert))
135
-			return $this->db->lastInsertId();
136
-		else
137
-			return false;
135
+		if ($this->db->insert('files', $insert)) {
136
+					return $this->db->lastInsertId();
137
+		} else {
138
+					return false;
139
+		}
138 140
 	}
139 141
 
140 142
 	public function getMessageById($id)
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
 		foreach ($sentFiles as $file) {
293 293
 			$item = array();
294
-			$item['id'] = 'f_' . $file['id'];
294
+			$item['id'] = 'f_'.$file['id'];
295 295
 			$item['sender_id'] = $file['sender_id'];
296 296
 			$item['receiver_id'] = $file['receiver_id'];
297 297
 			$item['fileName'] = $file['fileName'];
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 
305 305
 		foreach ($getFiles as $file) {
306 306
 			$item = array();
307
-			$item['id'] = 'f_' . $file['id'];
307
+			$item['id'] = 'f_'.$file['id'];
308 308
 			$item['sender_id'] = $file['sender_id'];
309 309
 			$item['receiver_id'] = $file['receiver_id'];
310 310
 			$item['fileName'] = $file['fileName'];
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 
318 318
 		$unsorted_messages = array_merge($sent, $inbox);
319 319
 
320
-		uasort($unsorted_messages, function ($a, $b) {
320
+		uasort($unsorted_messages, function($a, $b) {
321 321
 			return ($a['sentAt'] > $b['sentAt']) ? -1 : 1;
322 322
 		});
323 323
 
Please login to merge, or discard this patch.
notification/type/friend_request.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,12 +63,12 @@
 block discarded – undo
63 63
   public function get_title()
64 64
   {
65 65
 	$user_id = $this->user_loader->load_user_by_username($this->get_data('sender_username'));
66
-	return $this->user->lang('FRIEND_REQUEST_FROM') .$this->user_loader->get_username($user_id, 'no_profile');
66
+	return $this->user->lang('FRIEND_REQUEST_FROM').$this->user_loader->get_username($user_id, 'no_profile');
67 67
   }
68 68
 
69 69
   public function get_url()
70 70
   {
71
-	return append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, "i=-florinp-messenger-ucp-ucp_friends_module&mode=requests");
71
+	return append_sid($this->phpbb_root_path.'ucp.'.$this->php_ext, "i=-florinp-messenger-ucp-ucp_friends_module&mode=requests");
72 72
   }
73 73
 
74 74
   public function get_avatar()
Please login to merge, or discard this patch.
ucp/ucp_friends_module.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,22 +17,22 @@  discard block
 block discarded – undo
17 17
 
18 18
 	$this->tpl_name = 'friends';
19 19
 
20
-	switch($mode)
20
+	switch ($mode)
21 21
 	{
22 22
 	  case 'friends':
23 23
 		
24 24
 		$action = $request->variable('action', '');
25
-		switch($action)
25
+		switch ($action)
26 26
 		{
27 27
 			case 'add_friend':
28 28
 				$user_id = $request->variable('user_id', 0);
29
-				if($user_id > 0)
29
+				if ($user_id > 0)
30 30
 				{
31
-				  if(confirm_box(true))
31
+				  if (confirm_box(true))
32 32
 				  {
33 33
 					$user_id = $request->variable('user_id', 0);
34 34
 					$redirect_url = $request->variable('redirect_url', '');
35
-					if($friends_controller->send_request($user_id))
35
+					if ($friends_controller->send_request($user_id))
36 36
 					{
37 37
 					  redirect($redirect_url);
38 38
 					}
@@ -71,17 +71,17 @@  discard block
 block discarded – undo
71 71
 			}
72 72
 		  break;
73 73
 			default:
74
-				if($request->is_set_post('action'))
74
+				if ($request->is_set_post('action'))
75 75
 				{
76 76
 					$action = $request->variable('action', '');
77
-					switch($action) 
77
+					switch ($action) 
78 78
 					{
79 79
 						case 'remove':
80
-							if(confirm_box(true))
80
+							if (confirm_box(true))
81 81
 							{
82 82
 								$user_id = $request->variable('user_id', array(0));
83 83
 								$redirect_url = $request->variable('redirect_url', '');
84
-								if($friends_controller->remove_friend($user_id))
84
+								if ($friends_controller->remove_friend($user_id))
85 85
 								{
86 86
 								  redirect($redirect_url);
87 87
 								}
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
 
107 107
 	  case 'requests':
108 108
 
109
-		if($request->is_set_post('action'))
109
+		if ($request->is_set_post('action'))
110 110
 		{
111 111
 		  $action = $request->variable('action', '');
112 112
 
113
-		  switch($action)
113
+		  switch ($action)
114 114
 		  {
115 115
 			case 'delete':
116 116
 
117
-			  if(confirm_box(true))
117
+			  if (confirm_box(true))
118 118
 			  {
119 119
 				$requests_id = $request->variable('requests_id', array(0));
120 120
 				$friends_controller->delete_request($requests_id);
@@ -138,14 +138,14 @@  discard block
 block discarded – undo
138 138
 		}
139 139
         
140 140
 		$action = $request->variable('action', '');
141
-		switch($action)
141
+		switch ($action)
142 142
 		{
143 143
 			case 'cancel_request':
144
-				if(confirm_box(true))
144
+				if (confirm_box(true))
145 145
 			  {
146 146
 				$request_id = $request->variable('request_id', 0);
147 147
 				$redirect_url = $request->variable('redirect_url', '');
148
-				if($friends_controller->delete_request($request_id))
148
+				if ($friends_controller->delete_request($request_id))
149 149
 				{
150 150
 					redirect($redirect_url);
151 151
 				}
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@  discard block
 block discarded – undo
85 85
 								{
86 86
 								  redirect($redirect_url);
87 87
 								}
88
-							}
89
-							else
88
+							} else
90 89
 							{
91 90
 								$user_id = $request->variable('user_id', array(0));
92 91
 								$redirect_url = $request->server('HTTP_REFERER');
@@ -118,8 +117,7 @@  discard block
 block discarded – undo
118 117
 			  {
119 118
 				$requests_id = $request->variable('requests_id', array(0));
120 119
 				$friends_controller->delete_request($requests_id);
121
-			  }
122
-			  else
120
+			  } else
123 121
 			  {
124 122
 				$requests_id = $request->variable('requests_id', array(0));
125 123
 				confirm_box(false, $user->lang('CONFIRM_REMOVE_REQUESTS'), build_hidden_fields(array(
@@ -149,8 +147,7 @@  discard block
 block discarded – undo
149 147
 				{
150 148
 					redirect($redirect_url);
151 149
 				}
152
-			  }
153
-			  else
150
+			  } else
154 151
 			  {
155 152
 				$request_id = $request->variable('request_id', 0);
156 153
 				$redirect_url = $request->server('HTTP_REFERER');
Please login to merge, or discard this patch.
libs/upload.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     /**
366 366
      * Set allowed mime types
367 367
      *
368
-     * @param array $mimes
368
+     * @param string[] $mimes
369 369
      */
370 370
     public function set_allowed_mime_types($mimes)
371 371
     {
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
      * Convert bytes to mb.
516 516
      *
517 517
      * @param int $bytes
518
-     * @return int
518
+     * @return double
519 519
      */
520 520
     protected function bytes_to_mb($bytes)
521 521
     {
Please login to merge, or discard this patch.
Indentation   +508 added lines, -508 removed lines patch added patch discarded remove patch
@@ -13,514 +13,514 @@
 block discarded – undo
13 13
 class upload
14 14
 {
15 15
 
16
-    /**
17
-     * Default directory persmissions (destination dir)
18
-     */
19
-    protected $default_permissions = 750;
20
-
21
-
22
-    /**
23
-     * File post array
24
-     *
25
-     * @var array
26
-     */
27
-    protected $files_post = array();
28
-
29
-
30
-    /**
31
-     * Destination directory
32
-     *
33
-     * @var string
34
-     */
35
-    protected $destination;
36
-
37
-
38
-    /**
39
-     * Fileinfo
40
-     *
41
-     * @var object
42
-     */
43
-    protected $finfo;
44
-
45
-
46
-    /**
47
-     * Data about file
48
-     *
49
-     * @var array
50
-     */
51
-    public $file = array();
52
-
53
-
54
-    /**
55
-     * Max. file size
56
-     *
57
-     * @var int
58
-     */
59
-    protected $max_file_size;
60
-
61
-
62
-    /**
63
-     * Allowed mime types
64
-     *
65
-     * @var array
66
-     */
67
-    protected $mimes = array();
68
-
69
-
70
-    /**
71
-     * External callback object
72
-     *
73
-     * @var obejct
74
-     */
75
-    protected $external_callback_object;
76
-
77
-
78
-    /**
79
-     * External callback methods
80
-     *
81
-     * @var array
82
-     */
83
-    protected $external_callback_methods = array();
84
-
85
-
86
-    /**
87
-     * Temp path
88
-     *
89
-     * @var string
90
-     */
91
-    protected $tmp_name;
92
-
93
-
94
-    /**
95
-     * Validation errors
96
-     *
97
-     * @var array
98
-     */
99
-    protected $validation_errors = array();
100
-
101
-
102
-    /**
103
-     * Filename (new)
104
-     *
105
-     * @var string
106
-     */
107
-    protected $filename;
108
-
109
-    /**
110
-     * File extension
111
-     * @var string
112
-     */
113
-    protected $extension;
114
-
115
-    /**
116
-     * Internal callbacks (filesize check, mime, etc)
117
-     *
118
-     * @var array
119
-     */
120
-    private $callbacks = array();
121
-
122
-    /**
123
-     * Root dir
124
-     *
125
-     * @var string
126
-     */
127
-    protected $root;
128
-
129
-    /**
130
-     * Return upload object
131
-     *
132
-     * $destination = 'path/to/your/file/destination/folder';
133
-     *
134
-     * @param string $phpbb_root_path
135
-     * @return Upload
136
-     */
137
-    public static function factory($phpbb_root_path)
138
-    {
139
-        return new Upload($phpbb_root_path);
140
-    }
141
-
142
-    /**
143
-     *  Define ROOT constant and set & create destination path
144
-     *
145
-     * @param string $phpbb_root_path
146
-     * @throws Exception
147
-     */
148
-    public function __construct($phpbb_root_path)
149
-    {
150
-            $phpbb_root_path = $phpbb_root_path . 'store/messenger/files';
151
-        // set & create destination path
152
-        if (!$this->set_destination($phpbb_root_path)) {
153
-            throw new Exception('Upload: Can\'t create destination. ' . $this->root . $this->destination);
154
-        }
155
-
156
-        //create finfo object
157
-        $this->finfo = new finfo();
158
-    }
159
-
160
-    /**
161
-     * Set target filename
162
-     *
163
-     * @param string $filename
164
-     */
165
-    public function set_filename($filename)
166
-    {
167
-        $this->filename = $filename;
168
-    }
169
-
170
-    /**
171
-     * Check & Save file
172
-     *
173
-     * Return data about current upload
174
-     *
175
-     * @return array
176
-     */
177
-    public function upload($filename = '')
178
-    {
179
-        if ($this->check()) {
180
-            $this->save();
181
-        }
182
-        // return state data
183
-        return $this->get_state();
184
-    }
185
-
186
-
187
-    /**
188
-     * Save file on server
189
-     *
190
-     * Return state data
191
-     *
192
-     * @return array
193
-     */
194
-    public function save()
195
-    {
196
-        $this->save_file();
197
-        return $this->get_state();
198
-    }
199
-
200
-
201
-    /**
202
-     * Validate file (execute callbacks)
203
-     *
204
-     * Returns TRUE if validation successful
205
-     *
206
-     * @return bool
207
-     */
208
-    public function check()
209
-    {
210
-        //execute callbacks (check filesize, mime, also external callbacks
211
-        $this->validate();
212
-
213
-        //add error messages
214
-        $this->file['errors'] = $this->get_errors();
215
-
216
-        //change file validation status
217
-        $this->file['status'] = empty($this->validation_errors);
218
-
219
-        return $this->file['status'];
220
-    }
221
-
222
-    /**
223
-     * Get current state data
224
-     *
225
-     * @return array
226
-     */
227
-    public function get_state()
228
-    {
229
-        return $this->file;
230
-    }
231
-
232
-
233
-    /**
234
-     * Save file on server
235
-     */
236
-    protected function save_file()
237
-    {
238
-        //create & set new filename
239
-        if (empty($this->filename)) {
240
-            $this->create_new_filename();
241
-        }
242
-
243
-        //set filename
244
-        $this->file['filename'] = $this->filename;
245
-
246
-        //set full path
247
-        $this->file['full_path'] = $this->root . $this->destination . $this->filename;
248
-        $this->file['path'] = $this->destination . $this->filename;
249
-
250
-        $status = move_uploaded_file($this->tmp_name, $this->file['full_path']);
251
-
252
-        //checks whether upload successful
253
-        if (!$status) {
254
-            throw new Exception('Upload: Can\'t upload file.');
255
-        }
256
-
257
-        //done
258
-        $this->file['status'] = true;
259
-    }
260
-
261
-    /**
262
-     * Set data about file
263
-     */
264
-    protected function set_file_data()
265
-    {
266
-        $file_size = $this->get_file_size();
267
-
268
-        $this->file = array(
269
-            'status' => false,
270
-            'destination' => $this->destination,
271
-            'size_in_bytes' => $file_size,
272
-            'size_in_mb' => $this->bytes_to_mb($file_size),
273
-            'mime' => $this->get_file_mime(),
274
-            'original_filename' => $this->file_post['name'],
275
-            'tmp_name' => $this->file_post['tmp_name'],
276
-            'post_data' => $this->file_post,
277
-        );
278
-    }
279
-
280
-    /**
281
-     * Set validation error
282
-     *
283
-     * @param string $message
284
-     */
285
-    public function set_error($message)
286
-    {
287
-        $this->validation_errors[] = $message;
288
-    }
289
-
290
-    /**
291
-     * Return validation errors
292
-     *
293
-     * @return array
294
-     */
295
-    public function get_errors()
296
-    {
297
-        return $this->validation_errors;
298
-    }
299
-
300
-    /**
301
-     * Set external callback methods
302
-     *
303
-     * @param object $instance_of_callback_object
304
-     * @param array $callback_methods
305
-     * @throws Exception
306
-     */
307
-    public function callbacks($instance_of_callback_object, $callback_methods)
308
-    {
309
-        if (empty($instance_of_callback_object)) {
310
-            throw new Exception('Upload: $instance_of_callback_object can\'t be empty.');
311
-        }
312
-
313
-        if (!is_array($callback_methods)) {
314
-            throw new Exception('Upload: $callback_methods data type need to be array.');
315
-        }
316
-
317
-        $this->external_callback_object = $instance_of_callback_object;
318
-        $this->external_callback_methods = $callback_methods;
319
-    }
320
-
321
-    /**
322
-     * Execute callbacks
323
-     */
324
-    protected function validate()
325
-    {
326
-        //get curent errors
327
-        $errors = $this->get_errors();
328
-
329
-        if (empty($errors)) {
330
-            //set data about current file
331
-            $this->set_file_data();
332
-
333
-            //execute internal callbacks
334
-            $this->execute_callbacks($this->callbacks, $this);
335
-
336
-            //execute external callbacks
337
-            $this->execute_callbacks($this->external_callback_methods, $this->external_callback_object);
338
-        }
339
-    }
340
-
341
-    /**
342
-     * Execute callbacks
343
-     */
344
-    protected function execute_callbacks($callbacks, $object)
345
-    {
346
-        foreach ($callbacks as $method) {
347
-            $object->$method($this);
348
-        }
349
-    }
350
-
351
-    /**
352
-     * File mime type validation callback
353
-     *
354
-     * @param mixed $object
355
-     */
356
-    protected function check_mime_type($object)
357
-    {
358
-        if (!empty($object->mimes)) {
359
-            if (!in_array($object->file['mime'], $object->mimes)) {
360
-                $object->set_error('Mime type not allowed.');
361
-            }
362
-        }
363
-    }
364
-
365
-    /**
366
-     * Set allowed mime types
367
-     *
368
-     * @param array $mimes
369
-     */
370
-    public function set_allowed_mime_types($mimes)
371
-    {
372
-        $this->mimes = $mimes;
373
-        //if mime types is set -> set callback
374
-        $this->callbacks[] = 'check_mime_type';
375
-    }
376
-
377
-    /**
378
-     * File size validation callback
379
-     *
380
-     * @param object $object
381
-     */
382
-    protected function check_file_size($object)
383
-    {
384
-        if (!empty($object->max_file_size)) {
385
-            $file_size_in_mb = $this->bytes_to_mb($object->file['size_in_bytes']);
386
-            if ($object->max_file_size <= $file_size_in_mb) {
387
-                $object->set_error('File is too big.');
388
-            }
389
-        }
390
-    }
391
-
392
-    /**
393
-     * Set max. file size
394
-     *
395
-     * @param int $size
396
-     */
397
-    public function set_max_file_size($size)
398
-    {
399
-        $this->max_file_size = $size;
400
-        //if max file size is set -> set callback
401
-        $this->callbacks[] = 'check_file_size';
402
-    }
403
-
404
-    /**
405
-     * Set File array to object
406
-     *
407
-     * @param array $file
408
-     */
409
-    public function file($file)
410
-    {
411
-        $this->set_file_array($file);
412
-    }
413
-
414
-    /**
415
-     * Set file array
416
-     *
417
-     * @param array $file
418
-     */
419
-    protected function set_file_array($file)
420
-    {
421
-        //checks whether file array is valid
422
-        if (!$this->check_file_array($file)) {
423
-            //file not selected or some bigger problems (broken files array)
424
-            $this->set_error('Please select file.');
425
-        }
426
-
427
-        //set file data
428
-        $this->file_post = $file;
429
-
430
-        //set tmp path
431
-        $this->tmp_name = $file['tmp_name'];
432
-
433
-        // set file extension
434
-        $this->extension = pathinfo($file['name'], PATHINFO_EXTENSION);
435
-    }
436
-
437
-    /**
438
-     * Checks whether Files post array is valid
439
-     *
440
-     * @return bool
441
-     */
442
-    protected function check_file_array($file)
443
-    {
444
-        return isset($file['error'])
445
-        && !empty($file['name'])
446
-        && !empty($file['type'])
447
-        && !empty($file['tmp_name'])
448
-        && !empty($file['size']);
449
-    }
450
-
451
-    /**
452
-     * Get file mime type
453
-     *
454
-     * @return string
455
-     */
456
-    protected function get_file_mime()
457
-    {
458
-        return $this->finfo->file($this->tmp_name, FILEINFO_MIME_TYPE);
459
-    }
460
-
461
-    /**
462
-     * Get file size
463
-     *
464
-     * @return int
465
-     */
466
-    protected function get_file_size()
467
-    {
468
-        return filesize($this->tmp_name);
469
-    }
470
-
471
-    /**
472
-     * Set destination path (return TRUE on success)
473
-     *
474
-     * @param string $destination
475
-     * @return bool
476
-     */
477
-    protected function set_destination($destination)
478
-    {
479
-        $this->destination = $destination . DIRECTORY_SEPARATOR;
480
-        return $this->destination_exist() ? TRUE : $this->create_destination();
481
-    }
482
-
483
-    /**
484
-     * Checks whether destination folder exists
485
-     *
486
-     * @return bool
487
-     */
488
-    protected function destination_exist()
489
-    {
490
-        return is_writable($this->root . $this->destination);
491
-    }
492
-
493
-    /**
494
-     * Create path to destination
495
-     *
496
-     * @return bool
497
-     */
498
-    protected function create_destination()
499
-    {
500
-        return mkdir($this->root . $this->destination, $this->default_permissions, true);
501
-    }
502
-
503
-    /**
504
-     * Set unique filename
505
-     *
506
-     * @return string
507
-     */
508
-    protected function create_new_filename()
509
-    {
510
-        $filename = sha1(mt_rand(1, 9999) . $this->destination . uniqid()) . time() . '.' . $this->extension;
511
-        $this->set_filename($filename);
512
-    }
513
-
514
-    /**
515
-     * Convert bytes to mb.
516
-     *
517
-     * @param int $bytes
518
-     * @return int
519
-     */
520
-    protected function bytes_to_mb($bytes)
521
-    {
522
-        return round(($bytes / 1048576), 2);
523
-    }
16
+	/**
17
+	 * Default directory persmissions (destination dir)
18
+	 */
19
+	protected $default_permissions = 750;
20
+
21
+
22
+	/**
23
+	 * File post array
24
+	 *
25
+	 * @var array
26
+	 */
27
+	protected $files_post = array();
28
+
29
+
30
+	/**
31
+	 * Destination directory
32
+	 *
33
+	 * @var string
34
+	 */
35
+	protected $destination;
36
+
37
+
38
+	/**
39
+	 * Fileinfo
40
+	 *
41
+	 * @var object
42
+	 */
43
+	protected $finfo;
44
+
45
+
46
+	/**
47
+	 * Data about file
48
+	 *
49
+	 * @var array
50
+	 */
51
+	public $file = array();
52
+
53
+
54
+	/**
55
+	 * Max. file size
56
+	 *
57
+	 * @var int
58
+	 */
59
+	protected $max_file_size;
60
+
61
+
62
+	/**
63
+	 * Allowed mime types
64
+	 *
65
+	 * @var array
66
+	 */
67
+	protected $mimes = array();
68
+
69
+
70
+	/**
71
+	 * External callback object
72
+	 *
73
+	 * @var obejct
74
+	 */
75
+	protected $external_callback_object;
76
+
77
+
78
+	/**
79
+	 * External callback methods
80
+	 *
81
+	 * @var array
82
+	 */
83
+	protected $external_callback_methods = array();
84
+
85
+
86
+	/**
87
+	 * Temp path
88
+	 *
89
+	 * @var string
90
+	 */
91
+	protected $tmp_name;
92
+
93
+
94
+	/**
95
+	 * Validation errors
96
+	 *
97
+	 * @var array
98
+	 */
99
+	protected $validation_errors = array();
100
+
101
+
102
+	/**
103
+	 * Filename (new)
104
+	 *
105
+	 * @var string
106
+	 */
107
+	protected $filename;
108
+
109
+	/**
110
+	 * File extension
111
+	 * @var string
112
+	 */
113
+	protected $extension;
114
+
115
+	/**
116
+	 * Internal callbacks (filesize check, mime, etc)
117
+	 *
118
+	 * @var array
119
+	 */
120
+	private $callbacks = array();
121
+
122
+	/**
123
+	 * Root dir
124
+	 *
125
+	 * @var string
126
+	 */
127
+	protected $root;
128
+
129
+	/**
130
+	 * Return upload object
131
+	 *
132
+	 * $destination = 'path/to/your/file/destination/folder';
133
+	 *
134
+	 * @param string $phpbb_root_path
135
+	 * @return Upload
136
+	 */
137
+	public static function factory($phpbb_root_path)
138
+	{
139
+		return new Upload($phpbb_root_path);
140
+	}
141
+
142
+	/**
143
+	 *  Define ROOT constant and set & create destination path
144
+	 *
145
+	 * @param string $phpbb_root_path
146
+	 * @throws Exception
147
+	 */
148
+	public function __construct($phpbb_root_path)
149
+	{
150
+			$phpbb_root_path = $phpbb_root_path . 'store/messenger/files';
151
+		// set & create destination path
152
+		if (!$this->set_destination($phpbb_root_path)) {
153
+			throw new Exception('Upload: Can\'t create destination. ' . $this->root . $this->destination);
154
+		}
155
+
156
+		//create finfo object
157
+		$this->finfo = new finfo();
158
+	}
159
+
160
+	/**
161
+	 * Set target filename
162
+	 *
163
+	 * @param string $filename
164
+	 */
165
+	public function set_filename($filename)
166
+	{
167
+		$this->filename = $filename;
168
+	}
169
+
170
+	/**
171
+	 * Check & Save file
172
+	 *
173
+	 * Return data about current upload
174
+	 *
175
+	 * @return array
176
+	 */
177
+	public function upload($filename = '')
178
+	{
179
+		if ($this->check()) {
180
+			$this->save();
181
+		}
182
+		// return state data
183
+		return $this->get_state();
184
+	}
185
+
186
+
187
+	/**
188
+	 * Save file on server
189
+	 *
190
+	 * Return state data
191
+	 *
192
+	 * @return array
193
+	 */
194
+	public function save()
195
+	{
196
+		$this->save_file();
197
+		return $this->get_state();
198
+	}
199
+
200
+
201
+	/**
202
+	 * Validate file (execute callbacks)
203
+	 *
204
+	 * Returns TRUE if validation successful
205
+	 *
206
+	 * @return bool
207
+	 */
208
+	public function check()
209
+	{
210
+		//execute callbacks (check filesize, mime, also external callbacks
211
+		$this->validate();
212
+
213
+		//add error messages
214
+		$this->file['errors'] = $this->get_errors();
215
+
216
+		//change file validation status
217
+		$this->file['status'] = empty($this->validation_errors);
218
+
219
+		return $this->file['status'];
220
+	}
221
+
222
+	/**
223
+	 * Get current state data
224
+	 *
225
+	 * @return array
226
+	 */
227
+	public function get_state()
228
+	{
229
+		return $this->file;
230
+	}
231
+
232
+
233
+	/**
234
+	 * Save file on server
235
+	 */
236
+	protected function save_file()
237
+	{
238
+		//create & set new filename
239
+		if (empty($this->filename)) {
240
+			$this->create_new_filename();
241
+		}
242
+
243
+		//set filename
244
+		$this->file['filename'] = $this->filename;
245
+
246
+		//set full path
247
+		$this->file['full_path'] = $this->root . $this->destination . $this->filename;
248
+		$this->file['path'] = $this->destination . $this->filename;
249
+
250
+		$status = move_uploaded_file($this->tmp_name, $this->file['full_path']);
251
+
252
+		//checks whether upload successful
253
+		if (!$status) {
254
+			throw new Exception('Upload: Can\'t upload file.');
255
+		}
256
+
257
+		//done
258
+		$this->file['status'] = true;
259
+	}
260
+
261
+	/**
262
+	 * Set data about file
263
+	 */
264
+	protected function set_file_data()
265
+	{
266
+		$file_size = $this->get_file_size();
267
+
268
+		$this->file = array(
269
+			'status' => false,
270
+			'destination' => $this->destination,
271
+			'size_in_bytes' => $file_size,
272
+			'size_in_mb' => $this->bytes_to_mb($file_size),
273
+			'mime' => $this->get_file_mime(),
274
+			'original_filename' => $this->file_post['name'],
275
+			'tmp_name' => $this->file_post['tmp_name'],
276
+			'post_data' => $this->file_post,
277
+		);
278
+	}
279
+
280
+	/**
281
+	 * Set validation error
282
+	 *
283
+	 * @param string $message
284
+	 */
285
+	public function set_error($message)
286
+	{
287
+		$this->validation_errors[] = $message;
288
+	}
289
+
290
+	/**
291
+	 * Return validation errors
292
+	 *
293
+	 * @return array
294
+	 */
295
+	public function get_errors()
296
+	{
297
+		return $this->validation_errors;
298
+	}
299
+
300
+	/**
301
+	 * Set external callback methods
302
+	 *
303
+	 * @param object $instance_of_callback_object
304
+	 * @param array $callback_methods
305
+	 * @throws Exception
306
+	 */
307
+	public function callbacks($instance_of_callback_object, $callback_methods)
308
+	{
309
+		if (empty($instance_of_callback_object)) {
310
+			throw new Exception('Upload: $instance_of_callback_object can\'t be empty.');
311
+		}
312
+
313
+		if (!is_array($callback_methods)) {
314
+			throw new Exception('Upload: $callback_methods data type need to be array.');
315
+		}
316
+
317
+		$this->external_callback_object = $instance_of_callback_object;
318
+		$this->external_callback_methods = $callback_methods;
319
+	}
320
+
321
+	/**
322
+	 * Execute callbacks
323
+	 */
324
+	protected function validate()
325
+	{
326
+		//get curent errors
327
+		$errors = $this->get_errors();
328
+
329
+		if (empty($errors)) {
330
+			//set data about current file
331
+			$this->set_file_data();
332
+
333
+			//execute internal callbacks
334
+			$this->execute_callbacks($this->callbacks, $this);
335
+
336
+			//execute external callbacks
337
+			$this->execute_callbacks($this->external_callback_methods, $this->external_callback_object);
338
+		}
339
+	}
340
+
341
+	/**
342
+	 * Execute callbacks
343
+	 */
344
+	protected function execute_callbacks($callbacks, $object)
345
+	{
346
+		foreach ($callbacks as $method) {
347
+			$object->$method($this);
348
+		}
349
+	}
350
+
351
+	/**
352
+	 * File mime type validation callback
353
+	 *
354
+	 * @param mixed $object
355
+	 */
356
+	protected function check_mime_type($object)
357
+	{
358
+		if (!empty($object->mimes)) {
359
+			if (!in_array($object->file['mime'], $object->mimes)) {
360
+				$object->set_error('Mime type not allowed.');
361
+			}
362
+		}
363
+	}
364
+
365
+	/**
366
+	 * Set allowed mime types
367
+	 *
368
+	 * @param array $mimes
369
+	 */
370
+	public function set_allowed_mime_types($mimes)
371
+	{
372
+		$this->mimes = $mimes;
373
+		//if mime types is set -> set callback
374
+		$this->callbacks[] = 'check_mime_type';
375
+	}
376
+
377
+	/**
378
+	 * File size validation callback
379
+	 *
380
+	 * @param object $object
381
+	 */
382
+	protected function check_file_size($object)
383
+	{
384
+		if (!empty($object->max_file_size)) {
385
+			$file_size_in_mb = $this->bytes_to_mb($object->file['size_in_bytes']);
386
+			if ($object->max_file_size <= $file_size_in_mb) {
387
+				$object->set_error('File is too big.');
388
+			}
389
+		}
390
+	}
391
+
392
+	/**
393
+	 * Set max. file size
394
+	 *
395
+	 * @param int $size
396
+	 */
397
+	public function set_max_file_size($size)
398
+	{
399
+		$this->max_file_size = $size;
400
+		//if max file size is set -> set callback
401
+		$this->callbacks[] = 'check_file_size';
402
+	}
403
+
404
+	/**
405
+	 * Set File array to object
406
+	 *
407
+	 * @param array $file
408
+	 */
409
+	public function file($file)
410
+	{
411
+		$this->set_file_array($file);
412
+	}
413
+
414
+	/**
415
+	 * Set file array
416
+	 *
417
+	 * @param array $file
418
+	 */
419
+	protected function set_file_array($file)
420
+	{
421
+		//checks whether file array is valid
422
+		if (!$this->check_file_array($file)) {
423
+			//file not selected or some bigger problems (broken files array)
424
+			$this->set_error('Please select file.');
425
+		}
426
+
427
+		//set file data
428
+		$this->file_post = $file;
429
+
430
+		//set tmp path
431
+		$this->tmp_name = $file['tmp_name'];
432
+
433
+		// set file extension
434
+		$this->extension = pathinfo($file['name'], PATHINFO_EXTENSION);
435
+	}
436
+
437
+	/**
438
+	 * Checks whether Files post array is valid
439
+	 *
440
+	 * @return bool
441
+	 */
442
+	protected function check_file_array($file)
443
+	{
444
+		return isset($file['error'])
445
+		&& !empty($file['name'])
446
+		&& !empty($file['type'])
447
+		&& !empty($file['tmp_name'])
448
+		&& !empty($file['size']);
449
+	}
450
+
451
+	/**
452
+	 * Get file mime type
453
+	 *
454
+	 * @return string
455
+	 */
456
+	protected function get_file_mime()
457
+	{
458
+		return $this->finfo->file($this->tmp_name, FILEINFO_MIME_TYPE);
459
+	}
460
+
461
+	/**
462
+	 * Get file size
463
+	 *
464
+	 * @return int
465
+	 */
466
+	protected function get_file_size()
467
+	{
468
+		return filesize($this->tmp_name);
469
+	}
470
+
471
+	/**
472
+	 * Set destination path (return TRUE on success)
473
+	 *
474
+	 * @param string $destination
475
+	 * @return bool
476
+	 */
477
+	protected function set_destination($destination)
478
+	{
479
+		$this->destination = $destination . DIRECTORY_SEPARATOR;
480
+		return $this->destination_exist() ? TRUE : $this->create_destination();
481
+	}
482
+
483
+	/**
484
+	 * Checks whether destination folder exists
485
+	 *
486
+	 * @return bool
487
+	 */
488
+	protected function destination_exist()
489
+	{
490
+		return is_writable($this->root . $this->destination);
491
+	}
492
+
493
+	/**
494
+	 * Create path to destination
495
+	 *
496
+	 * @return bool
497
+	 */
498
+	protected function create_destination()
499
+	{
500
+		return mkdir($this->root . $this->destination, $this->default_permissions, true);
501
+	}
502
+
503
+	/**
504
+	 * Set unique filename
505
+	 *
506
+	 * @return string
507
+	 */
508
+	protected function create_new_filename()
509
+	{
510
+		$filename = sha1(mt_rand(1, 9999) . $this->destination . uniqid()) . time() . '.' . $this->extension;
511
+		$this->set_filename($filename);
512
+	}
513
+
514
+	/**
515
+	 * Convert bytes to mb.
516
+	 *
517
+	 * @param int $bytes
518
+	 * @return int
519
+	 */
520
+	protected function bytes_to_mb($bytes)
521
+	{
522
+		return round(($bytes / 1048576), 2);
523
+	}
524 524
 
525 525
 
526 526
 } // end of Upload
527 527
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
      */
148 148
     public function __construct($phpbb_root_path)
149 149
     {
150
-            $phpbb_root_path = $phpbb_root_path . 'store/messenger/files';
150
+            $phpbb_root_path = $phpbb_root_path.'store/messenger/files';
151 151
         // set & create destination path
152 152
         if (!$this->set_destination($phpbb_root_path)) {
153
-            throw new Exception('Upload: Can\'t create destination. ' . $this->root . $this->destination);
153
+            throw new Exception('Upload: Can\'t create destination. '.$this->root.$this->destination);
154 154
         }
155 155
 
156 156
         //create finfo object
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
         $this->file['filename'] = $this->filename;
245 245
 
246 246
         //set full path
247
-        $this->file['full_path'] = $this->root . $this->destination . $this->filename;
248
-        $this->file['path'] = $this->destination . $this->filename;
247
+        $this->file['full_path'] = $this->root.$this->destination.$this->filename;
248
+        $this->file['path'] = $this->destination.$this->filename;
249 249
 
250 250
         $status = move_uploaded_file($this->tmp_name, $this->file['full_path']);
251 251
 
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
      */
477 477
     protected function set_destination($destination)
478 478
     {
479
-        $this->destination = $destination . DIRECTORY_SEPARATOR;
479
+        $this->destination = $destination.DIRECTORY_SEPARATOR;
480 480
         return $this->destination_exist() ? TRUE : $this->create_destination();
481 481
     }
482 482
 
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
      */
488 488
     protected function destination_exist()
489 489
     {
490
-        return is_writable($this->root . $this->destination);
490
+        return is_writable($this->root.$this->destination);
491 491
     }
492 492
 
493 493
     /**
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
      */
498 498
     protected function create_destination()
499 499
     {
500
-        return mkdir($this->root . $this->destination, $this->default_permissions, true);
500
+        return mkdir($this->root.$this->destination, $this->default_permissions, true);
501 501
     }
502 502
 
503 503
     /**
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
      */
508 508
     protected function create_new_filename()
509 509
     {
510
-        $filename = sha1(mt_rand(1, 9999) . $this->destination . uniqid()) . time() . '.' . $this->extension;
510
+        $filename = sha1(mt_rand(1, 9999).$this->destination.uniqid()).time().'.'.$this->extension;
511 511
         $this->set_filename($filename);
512 512
     }
513 513
 
Please login to merge, or discard this patch.
libs/database.php 2 patches
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -6,98 +6,98 @@
 block discarded – undo
6 6
 
7 7
 class database extends \PDO
8 8
 {
9
-    protected $extension_manager;
10
-
11
-    public function __construct()
12
-    {
13
-        global $phpbb_root_path;
14
-
15
-        $database = $phpbb_root_path . 'store/messenger.db';
16
-        parent::__construct('sqlite:' . $database);
17
-        parent::setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
18
-    }
19
-
20
-    /**
21
-     * @param string $sql
22
-     * @return array
23
-     */
24
-    public function select($sql, $array = array(), $fetchMode = PDO::FETCH_ASSOC)
25
-    {
26
-        $sth = $this->prepare($sql);
27
-        foreach ($array as $key => $value) {
28
-            $sth->bindValue("$key", $value);
29
-        }
30
-
31
-        $sth->execute();
32
-        return $sth->fetchAll($fetchMode);
33
-    }
34
-
35
-    /**
36
-     * @param string $table
37
-     * @return bool
38
-     */
39
-    public function insert($table, $data)
40
-    {
41
-        //ksort($data);
42
-
43
-        $fieldNames = implode('`, `', array_keys($data));
44
-        $fieldValues = ':' . implode(', :', array_keys($data));
45
-
46
-        $sth = $this->prepare("INSERT INTO $table (`$fieldNames`) VALUES ($fieldValues)");
47
-
48
-        foreach ($data as $key => $value) {
49
-            $sth->bindValue(":$key", $value);
50
-        }
51
-
52
-        return $sth->execute();
53
-    }
54
-
55
-    /**
56
-     * @param string $table
57
-     * @param array $data
58
-     * @param string $where
59
-     * @return bool
60
-     */
61
-    public function update($table, $data, $where)
62
-    {
63
-        ksort($data);
64
-
65
-        $fieldDetails = NULL;
66
-        foreach ($data as $key => $value) {
67
-            $fieldDetails .= "`$key`=:$key,";
68
-        }
69
-        $fieldDetails = rtrim($fieldDetails, ',');
70
-
71
-        $sth = $this->prepare("UPDATE $table SET $fieldDetails WHERE $where");
72
-
73
-        foreach ($data as $key => $value) {
74
-            $sth->bindValue(":$key", $value);
75
-        }
76
-
77
-        return $sth->execute();
78
-    }
79
-
80
-    /**
81
-     * @param string $table
82
-     * @param string $where
83
-     * @param int $limit
84
-     * @return int
85
-     */
86
-    public function delete($table, $where, $limit = 1)
87
-    {
88
-        return $this->exec("DELETE FROM $table WHERE $where LIMIT $limit");
89
-    }
90
-
91
-    protected function find($path, $prefix, $suffix)
92
-    {
93
-        $finder = $this->extension_manager->get_finder();
94
-
95
-        return $finder
96
-            ->set_extensions(array('phpbb/messenger'))
97
-            ->prefix($prefix)
98
-            ->suffix($suffix)
99
-            ->core_path("$path/")
100
-            ->extension_directory("/$path")
101
-            ->find();
102
-    }
9
+	protected $extension_manager;
10
+
11
+	public function __construct()
12
+	{
13
+		global $phpbb_root_path;
14
+
15
+		$database = $phpbb_root_path . 'store/messenger.db';
16
+		parent::__construct('sqlite:' . $database);
17
+		parent::setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
18
+	}
19
+
20
+	/**
21
+	 * @param string $sql
22
+	 * @return array
23
+	 */
24
+	public function select($sql, $array = array(), $fetchMode = PDO::FETCH_ASSOC)
25
+	{
26
+		$sth = $this->prepare($sql);
27
+		foreach ($array as $key => $value) {
28
+			$sth->bindValue("$key", $value);
29
+		}
30
+
31
+		$sth->execute();
32
+		return $sth->fetchAll($fetchMode);
33
+	}
34
+
35
+	/**
36
+	 * @param string $table
37
+	 * @return bool
38
+	 */
39
+	public function insert($table, $data)
40
+	{
41
+		//ksort($data);
42
+
43
+		$fieldNames = implode('`, `', array_keys($data));
44
+		$fieldValues = ':' . implode(', :', array_keys($data));
45
+
46
+		$sth = $this->prepare("INSERT INTO $table (`$fieldNames`) VALUES ($fieldValues)");
47
+
48
+		foreach ($data as $key => $value) {
49
+			$sth->bindValue(":$key", $value);
50
+		}
51
+
52
+		return $sth->execute();
53
+	}
54
+
55
+	/**
56
+	 * @param string $table
57
+	 * @param array $data
58
+	 * @param string $where
59
+	 * @return bool
60
+	 */
61
+	public function update($table, $data, $where)
62
+	{
63
+		ksort($data);
64
+
65
+		$fieldDetails = NULL;
66
+		foreach ($data as $key => $value) {
67
+			$fieldDetails .= "`$key`=:$key,";
68
+		}
69
+		$fieldDetails = rtrim($fieldDetails, ',');
70
+
71
+		$sth = $this->prepare("UPDATE $table SET $fieldDetails WHERE $where");
72
+
73
+		foreach ($data as $key => $value) {
74
+			$sth->bindValue(":$key", $value);
75
+		}
76
+
77
+		return $sth->execute();
78
+	}
79
+
80
+	/**
81
+	 * @param string $table
82
+	 * @param string $where
83
+	 * @param int $limit
84
+	 * @return int
85
+	 */
86
+	public function delete($table, $where, $limit = 1)
87
+	{
88
+		return $this->exec("DELETE FROM $table WHERE $where LIMIT $limit");
89
+	}
90
+
91
+	protected function find($path, $prefix, $suffix)
92
+	{
93
+		$finder = $this->extension_manager->get_finder();
94
+
95
+		return $finder
96
+			->set_extensions(array('phpbb/messenger'))
97
+			->prefix($prefix)
98
+			->suffix($suffix)
99
+			->core_path("$path/")
100
+			->extension_directory("/$path")
101
+			->find();
102
+	}
103 103
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
     {
13 13
         global $phpbb_root_path;
14 14
 
15
-        $database = $phpbb_root_path . 'store/messenger.db';
16
-        parent::__construct('sqlite:' . $database);
15
+        $database = $phpbb_root_path.'store/messenger.db';
16
+        parent::__construct('sqlite:'.$database);
17 17
         parent::setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
18 18
     }
19 19
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         //ksort($data);
42 42
 
43 43
         $fieldNames = implode('`, `', array_keys($data));
44
-        $fieldValues = ':' . implode(', :', array_keys($data));
44
+        $fieldValues = ':'.implode(', :', array_keys($data));
45 45
 
46 46
         $sth = $this->prepare("INSERT INTO $table (`$fieldNames`) VALUES ($fieldValues)");
47 47
 
Please login to merge, or discard this patch.
libs/mimetypes.php 1 patch
Indentation   +1071 added lines, -1071 removed lines patch added patch discarded remove patch
@@ -33,1080 +33,1080 @@
 block discarded – undo
33 33
  */
34 34
 class Mimetypes
35 35
 {
36
-    /**
37
-     * @var self
38
-     */
39
-    protected static $instance;
36
+	/**
37
+	 * @var self
38
+	 */
39
+	protected static $instance;
40 40
 
41
-    /**
42
-     * Returns an associative array with extension => mimetype mappings.
43
-     *
44
-     * Generated from source on 2 Aug 2013, 9:22pm PDT.
45
-     *
46
-     * @return array An associative array with extension => mimetype mappings.
47
-     */
48
-    public function getMimeTypes()
49
-    {
50
-        return array(
51
-            '3dml'        => 'text/vnd.in3d.3dml',
52
-            '3ds'         => 'image/x-3ds',
53
-            '3g2'         => 'video/3gpp2',
54
-            '3gp'         => 'video/3gpp',
55
-            '7z'          => 'application/x-7z-compressed',
56
-            'aab'         => 'application/x-authorware-bin',
57
-            'aac'         => 'audio/x-aac',
58
-            'aam'         => 'application/x-authorware-map',
59
-            'aas'         => 'application/x-authorware-seg',
60
-            'abw'         => 'application/x-abiword',
61
-            'ac'          => 'application/pkix-attr-cert',
62
-            'acc'         => 'application/vnd.americandynamics.acc',
63
-            'ace'         => 'application/x-ace-compressed',
64
-            'acu'         => 'application/vnd.acucobol',
65
-            'acutc'       => 'application/vnd.acucorp',
66
-            'adp'         => 'audio/adpcm',
67
-            'aep'         => 'application/vnd.audiograph',
68
-            'afm'         => 'application/x-font-type1',
69
-            'afp'         => 'application/vnd.ibm.modcap',
70
-            'ahead'       => 'application/vnd.ahead.space',
71
-            'ai'          => 'application/postscript',
72
-            'aif'         => 'audio/x-aiff',
73
-            'aifc'        => 'audio/x-aiff',
74
-            'aiff'        => 'audio/x-aiff',
75
-            'air'         => 'application/vnd.adobe.air-application-installer-package+zip',
76
-            'ait'         => 'application/vnd.dvb.ait',
77
-            'ami'         => 'application/vnd.amiga.ami',
78
-            'apk'         => 'application/vnd.android.package-archive',
79
-            'appcache'    => 'text/cache-manifest',
80
-            'application' => 'application/x-ms-application',
81
-            'apr'         => 'application/vnd.lotus-approach',
82
-            'arc'         => 'application/x-freearc',
83
-            'asa'         => 'text/plain',
84
-            'asax'        => 'application/octet-stream',
85
-            'asc'         => 'application/pgp-signature',
86
-            'ascx'        => 'text/plain',
87
-            'asf'         => 'video/x-ms-asf',
88
-            'ashx'        => 'text/plain',
89
-            'asm'         => 'text/x-asm',
90
-            'asmx'        => 'text/plain',
91
-            'aso'         => 'application/vnd.accpac.simply.aso',
92
-            'asp'         => 'text/plain',
93
-            'aspx'        => 'text/plain',
94
-            'asx'         => 'video/x-ms-asf',
95
-            'atc'         => 'application/vnd.acucorp',
96
-            'atom'        => 'application/atom+xml',
97
-            'atomcat'     => 'application/atomcat+xml',
98
-            'atomsvc'     => 'application/atomsvc+xml',
99
-            'atx'         => 'application/vnd.antix.game-component',
100
-            'au'          => 'audio/basic',
101
-            'avi'         => 'video/x-msvideo',
102
-            'aw'          => 'application/applixware',
103
-            'axd'         => 'text/plain',
104
-            'azf'         => 'application/vnd.airzip.filesecure.azf',
105
-            'azs'         => 'application/vnd.airzip.filesecure.azs',
106
-            'azw'         => 'application/vnd.amazon.ebook',
107
-            'bat'         => 'application/x-msdownload',
108
-            'bcpio'       => 'application/x-bcpio',
109
-            'bdf'         => 'application/x-font-bdf',
110
-            'bdm'         => 'application/vnd.syncml.dm+wbxml',
111
-            'bed'         => 'application/vnd.realvnc.bed',
112
-            'bh2'         => 'application/vnd.fujitsu.oasysprs',
113
-            'bin'         => 'application/octet-stream',
114
-            'blb'         => 'application/x-blorb',
115
-            'blorb'       => 'application/x-blorb',
116
-            'bmi'         => 'application/vnd.bmi',
117
-            'bmp'         => 'image/bmp',
118
-            'book'        => 'application/vnd.framemaker',
119
-            'box'         => 'application/vnd.previewsystems.box',
120
-            'boz'         => 'application/x-bzip2',
121
-            'bpk'         => 'application/octet-stream',
122
-            'btif'        => 'image/prs.btif',
123
-            'bz'          => 'application/x-bzip',
124
-            'bz2'         => 'application/x-bzip2',
125
-            'c'           => 'text/x-c',
126
-            'c11amc'      => 'application/vnd.cluetrust.cartomobile-config',
127
-            'c11amz'      => 'application/vnd.cluetrust.cartomobile-config-pkg',
128
-            'c4d'         => 'application/vnd.clonk.c4group',
129
-            'c4f'         => 'application/vnd.clonk.c4group',
130
-            'c4g'         => 'application/vnd.clonk.c4group',
131
-            'c4p'         => 'application/vnd.clonk.c4group',
132
-            'c4u'         => 'application/vnd.clonk.c4group',
133
-            'cab'         => 'application/vnd.ms-cab-compressed',
134
-            'caf'         => 'audio/x-caf',
135
-            'cap'         => 'application/vnd.tcpdump.pcap',
136
-            'car'         => 'application/vnd.curl.car',
137
-            'cat'         => 'application/vnd.ms-pki.seccat',
138
-            'cb7'         => 'application/x-cbr',
139
-            'cba'         => 'application/x-cbr',
140
-            'cbr'         => 'application/x-cbr',
141
-            'cbt'         => 'application/x-cbr',
142
-            'cbz'         => 'application/x-cbr',
143
-            'cc'          => 'text/x-c',
144
-            'cct'         => 'application/x-director',
145
-            'ccxml'       => 'application/ccxml+xml',
146
-            'cdbcmsg'     => 'application/vnd.contact.cmsg',
147
-            'cdf'         => 'application/x-netcdf',
148
-            'cdkey'       => 'application/vnd.mediastation.cdkey',
149
-            'cdmia'       => 'application/cdmi-capability',
150
-            'cdmic'       => 'application/cdmi-container',
151
-            'cdmid'       => 'application/cdmi-domain',
152
-            'cdmio'       => 'application/cdmi-object',
153
-            'cdmiq'       => 'application/cdmi-queue',
154
-            'cdx'         => 'chemical/x-cdx',
155
-            'cdxml'       => 'application/vnd.chemdraw+xml',
156
-            'cdy'         => 'application/vnd.cinderella',
157
-            'cer'         => 'application/pkix-cert',
158
-            'cfc'         => 'application/x-coldfusion',
159
-            'cfm'         => 'application/x-coldfusion',
160
-            'cfs'         => 'application/x-cfs-compressed',
161
-            'cgm'         => 'image/cgm',
162
-            'chat'        => 'application/x-chat',
163
-            'chm'         => 'application/vnd.ms-htmlhelp',
164
-            'chrt'        => 'application/vnd.kde.kchart',
165
-            'cif'         => 'chemical/x-cif',
166
-            'cii'         => 'application/vnd.anser-web-certificate-issue-initiation',
167
-            'cil'         => 'application/vnd.ms-artgalry',
168
-            'cla'         => 'application/vnd.claymore',
169
-            'class'       => 'application/java-vm',
170
-            'clkk'        => 'application/vnd.crick.clicker.keyboard',
171
-            'clkp'        => 'application/vnd.crick.clicker.palette',
172
-            'clkt'        => 'application/vnd.crick.clicker.template',
173
-            'clkw'        => 'application/vnd.crick.clicker.wordbank',
174
-            'clkx'        => 'application/vnd.crick.clicker',
175
-            'clp'         => 'application/x-msclip',
176
-            'cmc'         => 'application/vnd.cosmocaller',
177
-            'cmdf'        => 'chemical/x-cmdf',
178
-            'cml'         => 'chemical/x-cml',
179
-            'cmp'         => 'application/vnd.yellowriver-custom-menu',
180
-            'cmx'         => 'image/x-cmx',
181
-            'cod'         => 'application/vnd.rim.cod',
182
-            'com'         => 'application/x-msdownload',
183
-            'conf'        => 'text/plain',
184
-            'cpio'        => 'application/x-cpio',
185
-            'cpp'         => 'text/x-c',
186
-            'cpt'         => 'application/mac-compactpro',
187
-            'crd'         => 'application/x-mscardfile',
188
-            'crl'         => 'application/pkix-crl',
189
-            'crt'         => 'application/x-x509-ca-cert',
190
-            'crx'         => 'application/octet-stream',
191
-            'cryptonote'  => 'application/vnd.rig.cryptonote',
192
-            'cs'          => 'text/plain',
193
-            'csh'         => 'application/x-csh',
194
-            'csml'        => 'chemical/x-csml',
195
-            'csp'         => 'application/vnd.commonspace',
196
-            'css'         => 'text/css',
197
-            'cst'         => 'application/x-director',
198
-            'csv'         => 'text/csv',
199
-            'cu'          => 'application/cu-seeme',
200
-            'curl'        => 'text/vnd.curl',
201
-            'cww'         => 'application/prs.cww',
202
-            'cxt'         => 'application/x-director',
203
-            'cxx'         => 'text/x-c',
204
-            'dae'         => 'model/vnd.collada+xml',
205
-            'daf'         => 'application/vnd.mobius.daf',
206
-            'dart'        => 'application/vnd.dart',
207
-            'dataless'    => 'application/vnd.fdsn.seed',
208
-            'davmount'    => 'application/davmount+xml',
209
-            'dbk'         => 'application/docbook+xml',
210
-            'dcr'         => 'application/x-director',
211
-            'dcurl'       => 'text/vnd.curl.dcurl',
212
-            'dd2'         => 'application/vnd.oma.dd2+xml',
213
-            'ddd'         => 'application/vnd.fujixerox.ddd',
214
-            'deb'         => 'application/x-debian-package',
215
-            'def'         => 'text/plain',
216
-            'deploy'      => 'application/octet-stream',
217
-            'der'         => 'application/x-x509-ca-cert',
218
-            'dfac'        => 'application/vnd.dreamfactory',
219
-            'dgc'         => 'application/x-dgc-compressed',
220
-            'dic'         => 'text/x-c',
221
-            'dir'         => 'application/x-director',
222
-            'dis'         => 'application/vnd.mobius.dis',
223
-            'dist'        => 'application/octet-stream',
224
-            'distz'       => 'application/octet-stream',
225
-            'djv'         => 'image/vnd.djvu',
226
-            'djvu'        => 'image/vnd.djvu',
227
-            'dll'         => 'application/x-msdownload',
228
-            'dmg'         => 'application/x-apple-diskimage',
229
-            'dmp'         => 'application/vnd.tcpdump.pcap',
230
-            'dms'         => 'application/octet-stream',
231
-            'dna'         => 'application/vnd.dna',
232
-            'doc'         => 'application/msword',
233
-            'docm'        => 'application/vnd.ms-word.document.macroenabled.12',
234
-            'docx'        => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
235
-            'dot'         => 'application/msword',
236
-            'dotm'        => 'application/vnd.ms-word.template.macroenabled.12',
237
-            'dotx'        => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
238
-            'dp'          => 'application/vnd.osgi.dp',
239
-            'dpg'         => 'application/vnd.dpgraph',
240
-            'dra'         => 'audio/vnd.dra',
241
-            'dsc'         => 'text/prs.lines.tag',
242
-            'dssc'        => 'application/dssc+der',
243
-            'dtb'         => 'application/x-dtbook+xml',
244
-            'dtd'         => 'application/xml-dtd',
245
-            'dts'         => 'audio/vnd.dts',
246
-            'dtshd'       => 'audio/vnd.dts.hd',
247
-            'dump'        => 'application/octet-stream',
248
-            'dvb'         => 'video/vnd.dvb.file',
249
-            'dvi'         => 'application/x-dvi',
250
-            'dwf'         => 'model/vnd.dwf',
251
-            'dwg'         => 'image/vnd.dwg',
252
-            'dxf'         => 'image/vnd.dxf',
253
-            'dxp'         => 'application/vnd.spotfire.dxp',
254
-            'dxr'         => 'application/x-director',
255
-            'ecelp4800'   => 'audio/vnd.nuera.ecelp4800',
256
-            'ecelp7470'   => 'audio/vnd.nuera.ecelp7470',
257
-            'ecelp9600'   => 'audio/vnd.nuera.ecelp9600',
258
-            'ecma'        => 'application/ecmascript',
259
-            'edm'         => 'application/vnd.novadigm.edm',
260
-            'edx'         => 'application/vnd.novadigm.edx',
261
-            'efif'        => 'application/vnd.picsel',
262
-            'ei6'         => 'application/vnd.pg.osasli',
263
-            'elc'         => 'application/octet-stream',
264
-            'emf'         => 'application/x-msmetafile',
265
-            'eml'         => 'message/rfc822',
266
-            'emma'        => 'application/emma+xml',
267
-            'emz'         => 'application/x-msmetafile',
268
-            'eol'         => 'audio/vnd.digital-winds',
269
-            'eot'         => 'application/vnd.ms-fontobject',
270
-            'eps'         => 'application/postscript',
271
-            'epub'        => 'application/epub+zip',
272
-            'es3'         => 'application/vnd.eszigno3+xml',
273
-            'esa'         => 'application/vnd.osgi.subsystem',
274
-            'esf'         => 'application/vnd.epson.esf',
275
-            'et3'         => 'application/vnd.eszigno3+xml',
276
-            'etx'         => 'text/x-setext',
277
-            'eva'         => 'application/x-eva',
278
-            'evy'         => 'application/x-envoy',
279
-            'exe'         => 'application/x-msdownload',
280
-            'exi'         => 'application/exi',
281
-            'ext'         => 'application/vnd.novadigm.ext',
282
-            'ez'          => 'application/andrew-inset',
283
-            'ez2'         => 'application/vnd.ezpix-album',
284
-            'ez3'         => 'application/vnd.ezpix-package',
285
-            'f'           => 'text/x-fortran',
286
-            'f4v'         => 'video/x-f4v',
287
-            'f77'         => 'text/x-fortran',
288
-            'f90'         => 'text/x-fortran',
289
-            'fbs'         => 'image/vnd.fastbidsheet',
290
-            'fcdt'        => 'application/vnd.adobe.formscentral.fcdt',
291
-            'fcs'         => 'application/vnd.isac.fcs',
292
-            'fdf'         => 'application/vnd.fdf',
293
-            'fe_launch'   => 'application/vnd.denovo.fcselayout-link',
294
-            'fg5'         => 'application/vnd.fujitsu.oasysgp',
295
-            'fgd'         => 'application/x-director',
296
-            'fh'          => 'image/x-freehand',
297
-            'fh4'         => 'image/x-freehand',
298
-            'fh5'         => 'image/x-freehand',
299
-            'fh7'         => 'image/x-freehand',
300
-            'fhc'         => 'image/x-freehand',
301
-            'fig'         => 'application/x-xfig',
302
-            'flac'        => 'audio/x-flac',
303
-            'fli'         => 'video/x-fli',
304
-            'flo'         => 'application/vnd.micrografx.flo',
305
-            'flv'         => 'video/x-flv',
306
-            'flw'         => 'application/vnd.kde.kivio',
307
-            'flx'         => 'text/vnd.fmi.flexstor',
308
-            'fly'         => 'text/vnd.fly',
309
-            'fm'          => 'application/vnd.framemaker',
310
-            'fnc'         => 'application/vnd.frogans.fnc',
311
-            'for'         => 'text/x-fortran',
312
-            'fpx'         => 'image/vnd.fpx',
313
-            'frame'       => 'application/vnd.framemaker',
314
-            'fsc'         => 'application/vnd.fsc.weblaunch',
315
-            'fst'         => 'image/vnd.fst',
316
-            'ftc'         => 'application/vnd.fluxtime.clip',
317
-            'fti'         => 'application/vnd.anser-web-funds-transfer-initiation',
318
-            'fvt'         => 'video/vnd.fvt',
319
-            'fxp'         => 'application/vnd.adobe.fxp',
320
-            'fxpl'        => 'application/vnd.adobe.fxp',
321
-            'fzs'         => 'application/vnd.fuzzysheet',
322
-            'g2w'         => 'application/vnd.geoplan',
323
-            'g3'          => 'image/g3fax',
324
-            'g3w'         => 'application/vnd.geospace',
325
-            'gac'         => 'application/vnd.groove-account',
326
-            'gam'         => 'application/x-tads',
327
-            'gbr'         => 'application/rpki-ghostbusters',
328
-            'gca'         => 'application/x-gca-compressed',
329
-            'gdl'         => 'model/vnd.gdl',
330
-            'geo'         => 'application/vnd.dynageo',
331
-            'gex'         => 'application/vnd.geometry-explorer',
332
-            'ggb'         => 'application/vnd.geogebra.file',
333
-            'ggt'         => 'application/vnd.geogebra.tool',
334
-            'ghf'         => 'application/vnd.groove-help',
335
-            'gif'         => 'image/gif',
336
-            'gim'         => 'application/vnd.groove-identity-message',
337
-            'gml'         => 'application/gml+xml',
338
-            'gmx'         => 'application/vnd.gmx',
339
-            'gnumeric'    => 'application/x-gnumeric',
340
-            'gph'         => 'application/vnd.flographit',
341
-            'gpx'         => 'application/gpx+xml',
342
-            'gqf'         => 'application/vnd.grafeq',
343
-            'gqs'         => 'application/vnd.grafeq',
344
-            'gram'        => 'application/srgs',
345
-            'gramps'      => 'application/x-gramps-xml',
346
-            'gre'         => 'application/vnd.geometry-explorer',
347
-            'grv'         => 'application/vnd.groove-injector',
348
-            'grxml'       => 'application/srgs+xml',
349
-            'gsf'         => 'application/x-font-ghostscript',
350
-            'gtar'        => 'application/x-gtar',
351
-            'gtm'         => 'application/vnd.groove-tool-message',
352
-            'gtw'         => 'model/vnd.gtw',
353
-            'gv'          => 'text/vnd.graphviz',
354
-            'gxf'         => 'application/gxf',
355
-            'gxt'         => 'application/vnd.geonext',
356
-            'gz'          => 'application/x-gzip',
357
-            'h'           => 'text/x-c',
358
-            'h261'        => 'video/h261',
359
-            'h263'        => 'video/h263',
360
-            'h264'        => 'video/h264',
361
-            'hal'         => 'application/vnd.hal+xml',
362
-            'hbci'        => 'application/vnd.hbci',
363
-            'hdf'         => 'application/x-hdf',
364
-            'hh'          => 'text/x-c',
365
-            'hlp'         => 'application/winhlp',
366
-            'hpgl'        => 'application/vnd.hp-hpgl',
367
-            'hpid'        => 'application/vnd.hp-hpid',
368
-            'hps'         => 'application/vnd.hp-hps',
369
-            'hqx'         => 'application/mac-binhex40',
370
-            'hta'         => 'application/octet-stream',
371
-            'htc'         => 'text/html',
372
-            'htke'        => 'application/vnd.kenameaapp',
373
-            'htm'         => 'text/html',
374
-            'html'        => 'text/html',
375
-            'hvd'         => 'application/vnd.yamaha.hv-dic',
376
-            'hvp'         => 'application/vnd.yamaha.hv-voice',
377
-            'hvs'         => 'application/vnd.yamaha.hv-script',
378
-            'i2g'         => 'application/vnd.intergeo',
379
-            'icc'         => 'application/vnd.iccprofile',
380
-            'ice'         => 'x-conference/x-cooltalk',
381
-            'icm'         => 'application/vnd.iccprofile',
382
-            'ico'         => 'image/x-icon',
383
-            'ics'         => 'text/calendar',
384
-            'ief'         => 'image/ief',
385
-            'ifb'         => 'text/calendar',
386
-            'ifm'         => 'application/vnd.shana.informed.formdata',
387
-            'iges'        => 'model/iges',
388
-            'igl'         => 'application/vnd.igloader',
389
-            'igm'         => 'application/vnd.insors.igm',
390
-            'igs'         => 'model/iges',
391
-            'igx'         => 'application/vnd.micrografx.igx',
392
-            'iif'         => 'application/vnd.shana.informed.interchange',
393
-            'imp'         => 'application/vnd.accpac.simply.imp',
394
-            'ims'         => 'application/vnd.ms-ims',
395
-            'in'          => 'text/plain',
396
-            'ini'         => 'text/plain',
397
-            'ink'         => 'application/inkml+xml',
398
-            'inkml'       => 'application/inkml+xml',
399
-            'install'     => 'application/x-install-instructions',
400
-            'iota'        => 'application/vnd.astraea-software.iota',
401
-            'ipa'         => 'application/octet-stream',
402
-            'ipfix'       => 'application/ipfix',
403
-            'ipk'         => 'application/vnd.shana.informed.package',
404
-            'irm'         => 'application/vnd.ibm.rights-management',
405
-            'irp'         => 'application/vnd.irepository.package+xml',
406
-            'iso'         => 'application/x-iso9660-image',
407
-            'itp'         => 'application/vnd.shana.informed.formtemplate',
408
-            'ivp'         => 'application/vnd.immervision-ivp',
409
-            'ivu'         => 'application/vnd.immervision-ivu',
410
-            'jad'         => 'text/vnd.sun.j2me.app-descriptor',
411
-            'jam'         => 'application/vnd.jam',
412
-            'jar'         => 'application/java-archive',
413
-            'java'        => 'text/x-java-source',
414
-            'jisp'        => 'application/vnd.jisp',
415
-            'jlt'         => 'application/vnd.hp-jlyt',
416
-            'jnlp'        => 'application/x-java-jnlp-file',
417
-            'joda'        => 'application/vnd.joost.joda-archive',
418
-            'jpe'         => 'image/jpeg',
419
-            'jpeg'        => 'image/jpeg',
420
-            'jpg'         => 'image/jpeg',
421
-            'jpgm'        => 'video/jpm',
422
-            'jpgv'        => 'video/jpeg',
423
-            'jpm'         => 'video/jpm',
424
-            'js'          => 'text/javascript',
425
-            'json'        => 'application/json',
426
-            'jsonml'      => 'application/jsonml+json',
427
-            'kar'         => 'audio/midi',
428
-            'karbon'      => 'application/vnd.kde.karbon',
429
-            'kfo'         => 'application/vnd.kde.kformula',
430
-            'kia'         => 'application/vnd.kidspiration',
431
-            'kml'         => 'application/vnd.google-earth.kml+xml',
432
-            'kmz'         => 'application/vnd.google-earth.kmz',
433
-            'kne'         => 'application/vnd.kinar',
434
-            'knp'         => 'application/vnd.kinar',
435
-            'kon'         => 'application/vnd.kde.kontour',
436
-            'kpr'         => 'application/vnd.kde.kpresenter',
437
-            'kpt'         => 'application/vnd.kde.kpresenter',
438
-            'kpxx'        => 'application/vnd.ds-keypoint',
439
-            'ksp'         => 'application/vnd.kde.kspread',
440
-            'ktr'         => 'application/vnd.kahootz',
441
-            'ktx'         => 'image/ktx',
442
-            'ktz'         => 'application/vnd.kahootz',
443
-            'kwd'         => 'application/vnd.kde.kword',
444
-            'kwt'         => 'application/vnd.kde.kword',
445
-            'lasxml'      => 'application/vnd.las.las+xml',
446
-            'latex'       => 'application/x-latex',
447
-            'lbd'         => 'application/vnd.llamagraphics.life-balance.desktop',
448
-            'lbe'         => 'application/vnd.llamagraphics.life-balance.exchange+xml',
449
-            'les'         => 'application/vnd.hhe.lesson-player',
450
-            'lha'         => 'application/x-lzh-compressed',
451
-            'link66'      => 'application/vnd.route66.link66+xml',
452
-            'list'        => 'text/plain',
453
-            'list3820'    => 'application/vnd.ibm.modcap',
454
-            'listafp'     => 'application/vnd.ibm.modcap',
455
-            'lnk'         => 'application/x-ms-shortcut',
456
-            'log'         => 'text/plain',
457
-            'lostxml'     => 'application/lost+xml',
458
-            'lrf'         => 'application/octet-stream',
459
-            'lrm'         => 'application/vnd.ms-lrm',
460
-            'ltf'         => 'application/vnd.frogans.ltf',
461
-            'lvp'         => 'audio/vnd.lucent.voice',
462
-            'lwp'         => 'application/vnd.lotus-wordpro',
463
-            'lz'          => 'application/x-lzip',
464
-            'lzh'         => 'application/x-lzh-compressed',
465
-            'lzma'        => 'application/x-lzma',
466
-            'lzo'         => 'application/x-lzop',
467
-            'm13'         => 'application/x-msmediaview',
468
-            'm14'         => 'application/x-msmediaview',
469
-            'm1v'         => 'video/mpeg',
470
-            'm21'         => 'application/mp21',
471
-            'm2a'         => 'audio/mpeg',
472
-            'm2v'         => 'video/mpeg',
473
-            'm3a'         => 'audio/mpeg',
474
-            'm3u'         => 'audio/x-mpegurl',
475
-            'm3u8'        => 'application/vnd.apple.mpegurl',
476
-            'm4a'         => 'audio/mp4',
477
-            'm4u'         => 'video/vnd.mpegurl',
478
-            'm4v'         => 'video/mp4',
479
-            'ma'          => 'application/mathematica',
480
-            'mads'        => 'application/mads+xml',
481
-            'mag'         => 'application/vnd.ecowin.chart',
482
-            'maker'       => 'application/vnd.framemaker',
483
-            'man'         => 'text/troff',
484
-            'mar'         => 'application/octet-stream',
485
-            'mathml'      => 'application/mathml+xml',
486
-            'mb'          => 'application/mathematica',
487
-            'mbk'         => 'application/vnd.mobius.mbk',
488
-            'mbox'        => 'application/mbox',
489
-            'mc1'         => 'application/vnd.medcalcdata',
490
-            'mcd'         => 'application/vnd.mcd',
491
-            'mcurl'       => 'text/vnd.curl.mcurl',
492
-            'mdb'         => 'application/x-msaccess',
493
-            'mdi'         => 'image/vnd.ms-modi',
494
-            'me'          => 'text/troff',
495
-            'mesh'        => 'model/mesh',
496
-            'meta4'       => 'application/metalink4+xml',
497
-            'metalink'    => 'application/metalink+xml',
498
-            'mets'        => 'application/mets+xml',
499
-            'mfm'         => 'application/vnd.mfmp',
500
-            'mft'         => 'application/rpki-manifest',
501
-            'mgp'         => 'application/vnd.osgeo.mapguide.package',
502
-            'mgz'         => 'application/vnd.proteus.magazine',
503
-            'mid'         => 'audio/midi',
504
-            'midi'        => 'audio/midi',
505
-            'mie'         => 'application/x-mie',
506
-            'mif'         => 'application/vnd.mif',
507
-            'mime'        => 'message/rfc822',
508
-            'mj2'         => 'video/mj2',
509
-            'mjp2'        => 'video/mj2',
510
-            'mk3d'        => 'video/x-matroska',
511
-            'mka'         => 'audio/x-matroska',
512
-            'mks'         => 'video/x-matroska',
513
-            'mkv'         => 'video/x-matroska',
514
-            'mlp'         => 'application/vnd.dolby.mlp',
515
-            'mmd'         => 'application/vnd.chipnuts.karaoke-mmd',
516
-            'mmf'         => 'application/vnd.smaf',
517
-            'mmr'         => 'image/vnd.fujixerox.edmics-mmr',
518
-            'mng'         => 'video/x-mng',
519
-            'mny'         => 'application/x-msmoney',
520
-            'mobi'        => 'application/x-mobipocket-ebook',
521
-            'mods'        => 'application/mods+xml',
522
-            'mov'         => 'video/quicktime',
523
-            'movie'       => 'video/x-sgi-movie',
524
-            'mp2'         => 'audio/mpeg',
525
-            'mp21'        => 'application/mp21',
526
-            'mp2a'        => 'audio/mpeg',
527
-            'mp3'         => 'audio/mpeg',
528
-            'mp4'         => 'video/mp4',
529
-            'mp4a'        => 'audio/mp4',
530
-            'mp4s'        => 'application/mp4',
531
-            'mp4v'        => 'video/mp4',
532
-            'mpc'         => 'application/vnd.mophun.certificate',
533
-            'mpe'         => 'video/mpeg',
534
-            'mpeg'        => 'video/mpeg',
535
-            'mpg'         => 'video/mpeg',
536
-            'mpg4'        => 'video/mp4',
537
-            'mpga'        => 'audio/mpeg',
538
-            'mpkg'        => 'application/vnd.apple.installer+xml',
539
-            'mpm'         => 'application/vnd.blueice.multipass',
540
-            'mpn'         => 'application/vnd.mophun.application',
541
-            'mpp'         => 'application/vnd.ms-project',
542
-            'mpt'         => 'application/vnd.ms-project',
543
-            'mpy'         => 'application/vnd.ibm.minipay',
544
-            'mqy'         => 'application/vnd.mobius.mqy',
545
-            'mrc'         => 'application/marc',
546
-            'mrcx'        => 'application/marcxml+xml',
547
-            'ms'          => 'text/troff',
548
-            'mscml'       => 'application/mediaservercontrol+xml',
549
-            'mseed'       => 'application/vnd.fdsn.mseed',
550
-            'mseq'        => 'application/vnd.mseq',
551
-            'msf'         => 'application/vnd.epson.msf',
552
-            'msh'         => 'model/mesh',
553
-            'msi'         => 'application/x-msdownload',
554
-            'msl'         => 'application/vnd.mobius.msl',
555
-            'msty'        => 'application/vnd.muvee.style',
556
-            'mts'         => 'model/vnd.mts',
557
-            'mus'         => 'application/vnd.musician',
558
-            'musicxml'    => 'application/vnd.recordare.musicxml+xml',
559
-            'mvb'         => 'application/x-msmediaview',
560
-            'mwf'         => 'application/vnd.mfer',
561
-            'mxf'         => 'application/mxf',
562
-            'mxl'         => 'application/vnd.recordare.musicxml',
563
-            'mxml'        => 'application/xv+xml',
564
-            'mxs'         => 'application/vnd.triscape.mxs',
565
-            'mxu'         => 'video/vnd.mpegurl',
566
-            'n-gage'      => 'application/vnd.nokia.n-gage.symbian.install',
567
-            'n3'          => 'text/n3',
568
-            'nb'          => 'application/mathematica',
569
-            'nbp'         => 'application/vnd.wolfram.player',
570
-            'nc'          => 'application/x-netcdf',
571
-            'ncx'         => 'application/x-dtbncx+xml',
572
-            'nfo'         => 'text/x-nfo',
573
-            'ngdat'       => 'application/vnd.nokia.n-gage.data',
574
-            'nitf'        => 'application/vnd.nitf',
575
-            'nlu'         => 'application/vnd.neurolanguage.nlu',
576
-            'nml'         => 'application/vnd.enliven',
577
-            'nnd'         => 'application/vnd.noblenet-directory',
578
-            'nns'         => 'application/vnd.noblenet-sealer',
579
-            'nnw'         => 'application/vnd.noblenet-web',
580
-            'npx'         => 'image/vnd.net-fpx',
581
-            'nsc'         => 'application/x-conference',
582
-            'nsf'         => 'application/vnd.lotus-notes',
583
-            'ntf'         => 'application/vnd.nitf',
584
-            'nzb'         => 'application/x-nzb',
585
-            'oa2'         => 'application/vnd.fujitsu.oasys2',
586
-            'oa3'         => 'application/vnd.fujitsu.oasys3',
587
-            'oas'         => 'application/vnd.fujitsu.oasys',
588
-            'obd'         => 'application/x-msbinder',
589
-            'obj'         => 'application/x-tgif',
590
-            'oda'         => 'application/oda',
591
-            'odb'         => 'application/vnd.oasis.opendocument.database',
592
-            'odc'         => 'application/vnd.oasis.opendocument.chart',
593
-            'odf'         => 'application/vnd.oasis.opendocument.formula',
594
-            'odft'        => 'application/vnd.oasis.opendocument.formula-template',
595
-            'odg'         => 'application/vnd.oasis.opendocument.graphics',
596
-            'odi'         => 'application/vnd.oasis.opendocument.image',
597
-            'odm'         => 'application/vnd.oasis.opendocument.text-master',
598
-            'odp'         => 'application/vnd.oasis.opendocument.presentation',
599
-            'ods'         => 'application/vnd.oasis.opendocument.spreadsheet',
600
-            'odt'         => 'application/vnd.oasis.opendocument.text',
601
-            'oga'         => 'audio/ogg',
602
-            'ogg'         => 'audio/ogg',
603
-            'ogv'         => 'video/ogg',
604
-            'ogx'         => 'application/ogg',
605
-            'omdoc'       => 'application/omdoc+xml',
606
-            'onepkg'      => 'application/onenote',
607
-            'onetmp'      => 'application/onenote',
608
-            'onetoc'      => 'application/onenote',
609
-            'onetoc2'     => 'application/onenote',
610
-            'opf'         => 'application/oebps-package+xml',
611
-            'opml'        => 'text/x-opml',
612
-            'oprc'        => 'application/vnd.palm',
613
-            'org'         => 'application/vnd.lotus-organizer',
614
-            'osf'         => 'application/vnd.yamaha.openscoreformat',
615
-            'osfpvg'      => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
616
-            'otc'         => 'application/vnd.oasis.opendocument.chart-template',
617
-            'otf'         => 'application/x-font-otf',
618
-            'otg'         => 'application/vnd.oasis.opendocument.graphics-template',
619
-            'oth'         => 'application/vnd.oasis.opendocument.text-web',
620
-            'oti'         => 'application/vnd.oasis.opendocument.image-template',
621
-            'otp'         => 'application/vnd.oasis.opendocument.presentation-template',
622
-            'ots'         => 'application/vnd.oasis.opendocument.spreadsheet-template',
623
-            'ott'         => 'application/vnd.oasis.opendocument.text-template',
624
-            'oxps'        => 'application/oxps',
625
-            'oxt'         => 'application/vnd.openofficeorg.extension',
626
-            'p'           => 'text/x-pascal',
627
-            'p10'         => 'application/pkcs10',
628
-            'p12'         => 'application/x-pkcs12',
629
-            'p7b'         => 'application/x-pkcs7-certificates',
630
-            'p7c'         => 'application/pkcs7-mime',
631
-            'p7m'         => 'application/pkcs7-mime',
632
-            'p7r'         => 'application/x-pkcs7-certreqresp',
633
-            'p7s'         => 'application/pkcs7-signature',
634
-            'p8'          => 'application/pkcs8',
635
-            'pas'         => 'text/x-pascal',
636
-            'paw'         => 'application/vnd.pawaafile',
637
-            'pbd'         => 'application/vnd.powerbuilder6',
638
-            'pbm'         => 'image/x-portable-bitmap',
639
-            'pcap'        => 'application/vnd.tcpdump.pcap',
640
-            'pcf'         => 'application/x-font-pcf',
641
-            'pcl'         => 'application/vnd.hp-pcl',
642
-            'pclxl'       => 'application/vnd.hp-pclxl',
643
-            'pct'         => 'image/x-pict',
644
-            'pcurl'       => 'application/vnd.curl.pcurl',
645
-            'pcx'         => 'image/x-pcx',
646
-            'pdb'         => 'application/vnd.palm',
647
-            'pdf'         => 'application/pdf',
648
-            'pfa'         => 'application/x-font-type1',
649
-            'pfb'         => 'application/x-font-type1',
650
-            'pfm'         => 'application/x-font-type1',
651
-            'pfr'         => 'application/font-tdpfr',
652
-            'pfx'         => 'application/x-pkcs12',
653
-            'pgm'         => 'image/x-portable-graymap',
654
-            'pgn'         => 'application/x-chess-pgn',
655
-            'pgp'         => 'application/pgp-encrypted',
656
-            'phar'        => 'application/octet-stream',
657
-            'php'         => 'text/plain',
658
-            'phps'        => 'application/x-httpd-phps',
659
-            'pic'         => 'image/x-pict',
660
-            'pkg'         => 'application/octet-stream',
661
-            'pki'         => 'application/pkixcmp',
662
-            'pkipath'     => 'application/pkix-pkipath',
663
-            'plb'         => 'application/vnd.3gpp.pic-bw-large',
664
-            'plc'         => 'application/vnd.mobius.plc',
665
-            'plf'         => 'application/vnd.pocketlearn',
666
-            'plist'       => 'application/x-plist',
667
-            'pls'         => 'application/pls+xml',
668
-            'pml'         => 'application/vnd.ctc-posml',
669
-            'png'         => 'image/png',
670
-            'pnm'         => 'image/x-portable-anymap',
671
-            'portpkg'     => 'application/vnd.macports.portpkg',
672
-            'pot'         => 'application/vnd.ms-powerpoint',
673
-            'potm'        => 'application/vnd.ms-powerpoint.template.macroenabled.12',
674
-            'potx'        => 'application/vnd.openxmlformats-officedocument.presentationml.template',
675
-            'ppam'        => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
676
-            'ppd'         => 'application/vnd.cups-ppd',
677
-            'ppm'         => 'image/x-portable-pixmap',
678
-            'pps'         => 'application/vnd.ms-powerpoint',
679
-            'ppsm'        => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
680
-            'ppsx'        => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
681
-            'ppt'         => 'application/vnd.ms-powerpoint',
682
-            'pptm'        => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
683
-            'pptx'        => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
684
-            'pqa'         => 'application/vnd.palm',
685
-            'prc'         => 'application/x-mobipocket-ebook',
686
-            'pre'         => 'application/vnd.lotus-freelance',
687
-            'prf'         => 'application/pics-rules',
688
-            'ps'          => 'application/postscript',
689
-            'psb'         => 'application/vnd.3gpp.pic-bw-small',
690
-            'psd'         => 'image/vnd.adobe.photoshop',
691
-            'psf'         => 'application/x-font-linux-psf',
692
-            'pskcxml'     => 'application/pskc+xml',
693
-            'ptid'        => 'application/vnd.pvi.ptid1',
694
-            'pub'         => 'application/x-mspublisher',
695
-            'pvb'         => 'application/vnd.3gpp.pic-bw-var',
696
-            'pwn'         => 'application/vnd.3m.post-it-notes',
697
-            'pya'         => 'audio/vnd.ms-playready.media.pya',
698
-            'pyv'         => 'video/vnd.ms-playready.media.pyv',
699
-            'qam'         => 'application/vnd.epson.quickanime',
700
-            'qbo'         => 'application/vnd.intu.qbo',
701
-            'qfx'         => 'application/vnd.intu.qfx',
702
-            'qps'         => 'application/vnd.publishare-delta-tree',
703
-            'qt'          => 'video/quicktime',
704
-            'qwd'         => 'application/vnd.quark.quarkxpress',
705
-            'qwt'         => 'application/vnd.quark.quarkxpress',
706
-            'qxb'         => 'application/vnd.quark.quarkxpress',
707
-            'qxd'         => 'application/vnd.quark.quarkxpress',
708
-            'qxl'         => 'application/vnd.quark.quarkxpress',
709
-            'qxt'         => 'application/vnd.quark.quarkxpress',
710
-            'ra'          => 'audio/x-pn-realaudio',
711
-            'ram'         => 'audio/x-pn-realaudio',
712
-            'rar'         => 'application/x-rar-compressed',
713
-            'ras'         => 'image/x-cmu-raster',
714
-            'rb'          => 'text/plain',
715
-            'rcprofile'   => 'application/vnd.ipunplugged.rcprofile',
716
-            'rdf'         => 'application/rdf+xml',
717
-            'rdz'         => 'application/vnd.data-vision.rdz',
718
-            'rep'         => 'application/vnd.businessobjects',
719
-            'res'         => 'application/x-dtbresource+xml',
720
-            'resx'        => 'text/xml',
721
-            'rgb'         => 'image/x-rgb',
722
-            'rif'         => 'application/reginfo+xml',
723
-            'rip'         => 'audio/vnd.rip',
724
-            'ris'         => 'application/x-research-info-systems',
725
-            'rl'          => 'application/resource-lists+xml',
726
-            'rlc'         => 'image/vnd.fujixerox.edmics-rlc',
727
-            'rld'         => 'application/resource-lists-diff+xml',
728
-            'rm'          => 'application/vnd.rn-realmedia',
729
-            'rmi'         => 'audio/midi',
730
-            'rmp'         => 'audio/x-pn-realaudio-plugin',
731
-            'rms'         => 'application/vnd.jcp.javame.midlet-rms',
732
-            'rmvb'        => 'application/vnd.rn-realmedia-vbr',
733
-            'rnc'         => 'application/relax-ng-compact-syntax',
734
-            'roa'         => 'application/rpki-roa',
735
-            'roff'        => 'text/troff',
736
-            'rp9'         => 'application/vnd.cloanto.rp9',
737
-            'rpm'         => 'application/x-rpm',
738
-            'rpss'        => 'application/vnd.nokia.radio-presets',
739
-            'rpst'        => 'application/vnd.nokia.radio-preset',
740
-            'rq'          => 'application/sparql-query',
741
-            'rs'          => 'application/rls-services+xml',
742
-            'rsd'         => 'application/rsd+xml',
743
-            'rss'         => 'application/rss+xml',
744
-            'rtf'         => 'application/rtf',
745
-            'rtx'         => 'text/richtext',
746
-            's'           => 'text/x-asm',
747
-            's3m'         => 'audio/s3m',
748
-            's7z'         => 'application/x-7z-compressed',
749
-            'saf'         => 'application/vnd.yamaha.smaf-audio',
750
-            'safariextz'  => 'application/octet-stream',
751
-            'sass'        => 'text/x-sass',
752
-            'sbml'        => 'application/sbml+xml',
753
-            'sc'          => 'application/vnd.ibm.secure-container',
754
-            'scd'         => 'application/x-msschedule',
755
-            'scm'         => 'application/vnd.lotus-screencam',
756
-            'scq'         => 'application/scvp-cv-request',
757
-            'scs'         => 'application/scvp-cv-response',
758
-            'scss'        => 'text/x-scss',
759
-            'scurl'       => 'text/vnd.curl.scurl',
760
-            'sda'         => 'application/vnd.stardivision.draw',
761
-            'sdc'         => 'application/vnd.stardivision.calc',
762
-            'sdd'         => 'application/vnd.stardivision.impress',
763
-            'sdkd'        => 'application/vnd.solent.sdkm+xml',
764
-            'sdkm'        => 'application/vnd.solent.sdkm+xml',
765
-            'sdp'         => 'application/sdp',
766
-            'sdw'         => 'application/vnd.stardivision.writer',
767
-            'see'         => 'application/vnd.seemail',
768
-            'seed'        => 'application/vnd.fdsn.seed',
769
-            'sema'        => 'application/vnd.sema',
770
-            'semd'        => 'application/vnd.semd',
771
-            'semf'        => 'application/vnd.semf',
772
-            'ser'         => 'application/java-serialized-object',
773
-            'setpay'      => 'application/set-payment-initiation',
774
-            'setreg'      => 'application/set-registration-initiation',
775
-            'sfd-hdstx'   => 'application/vnd.hydrostatix.sof-data',
776
-            'sfs'         => 'application/vnd.spotfire.sfs',
777
-            'sfv'         => 'text/x-sfv',
778
-            'sgi'         => 'image/sgi',
779
-            'sgl'         => 'application/vnd.stardivision.writer-global',
780
-            'sgm'         => 'text/sgml',
781
-            'sgml'        => 'text/sgml',
782
-            'sh'          => 'application/x-sh',
783
-            'shar'        => 'application/x-shar',
784
-            'shf'         => 'application/shf+xml',
785
-            'sid'         => 'image/x-mrsid-image',
786
-            'sig'         => 'application/pgp-signature',
787
-            'sil'         => 'audio/silk',
788
-            'silo'        => 'model/mesh',
789
-            'sis'         => 'application/vnd.symbian.install',
790
-            'sisx'        => 'application/vnd.symbian.install',
791
-            'sit'         => 'application/x-stuffit',
792
-            'sitx'        => 'application/x-stuffitx',
793
-            'skd'         => 'application/vnd.koan',
794
-            'skm'         => 'application/vnd.koan',
795
-            'skp'         => 'application/vnd.koan',
796
-            'skt'         => 'application/vnd.koan',
797
-            'sldm'        => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
798
-            'sldx'        => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
799
-            'slt'         => 'application/vnd.epson.salt',
800
-            'sm'          => 'application/vnd.stepmania.stepchart',
801
-            'smf'         => 'application/vnd.stardivision.math',
802
-            'smi'         => 'application/smil+xml',
803
-            'smil'        => 'application/smil+xml',
804
-            'smv'         => 'video/x-smv',
805
-            'smzip'       => 'application/vnd.stepmania.package',
806
-            'snd'         => 'audio/basic',
807
-            'snf'         => 'application/x-font-snf',
808
-            'so'          => 'application/octet-stream',
809
-            'spc'         => 'application/x-pkcs7-certificates',
810
-            'spf'         => 'application/vnd.yamaha.smaf-phrase',
811
-            'spl'         => 'application/x-futuresplash',
812
-            'spot'        => 'text/vnd.in3d.spot',
813
-            'spp'         => 'application/scvp-vp-response',
814
-            'spq'         => 'application/scvp-vp-request',
815
-            'spx'         => 'audio/ogg',
816
-            'sql'         => 'application/x-sql',
817
-            'src'         => 'application/x-wais-source',
818
-            'srt'         => 'application/x-subrip',
819
-            'sru'         => 'application/sru+xml',
820
-            'srx'         => 'application/sparql-results+xml',
821
-            'ssdl'        => 'application/ssdl+xml',
822
-            'sse'         => 'application/vnd.kodak-descriptor',
823
-            'ssf'         => 'application/vnd.epson.ssf',
824
-            'ssml'        => 'application/ssml+xml',
825
-            'st'          => 'application/vnd.sailingtracker.track',
826
-            'stc'         => 'application/vnd.sun.xml.calc.template',
827
-            'std'         => 'application/vnd.sun.xml.draw.template',
828
-            'stf'         => 'application/vnd.wt.stf',
829
-            'sti'         => 'application/vnd.sun.xml.impress.template',
830
-            'stk'         => 'application/hyperstudio',
831
-            'stl'         => 'application/vnd.ms-pki.stl',
832
-            'str'         => 'application/vnd.pg.format',
833
-            'stw'         => 'application/vnd.sun.xml.writer.template',
834
-            'styl'        => 'text/x-styl',
835
-            'sub'         => 'image/vnd.dvb.subtitle',
836
-            'sus'         => 'application/vnd.sus-calendar',
837
-            'susp'        => 'application/vnd.sus-calendar',
838
-            'sv4cpio'     => 'application/x-sv4cpio',
839
-            'sv4crc'      => 'application/x-sv4crc',
840
-            'svc'         => 'application/vnd.dvb.service',
841
-            'svd'         => 'application/vnd.svd',
842
-            'svg'         => 'image/svg+xml',
843
-            'svgz'        => 'image/svg+xml',
844
-            'swa'         => 'application/x-director',
845
-            'swf'         => 'application/x-shockwave-flash',
846
-            'swi'         => 'application/vnd.aristanetworks.swi',
847
-            'sxc'         => 'application/vnd.sun.xml.calc',
848
-            'sxd'         => 'application/vnd.sun.xml.draw',
849
-            'sxg'         => 'application/vnd.sun.xml.writer.global',
850
-            'sxi'         => 'application/vnd.sun.xml.impress',
851
-            'sxm'         => 'application/vnd.sun.xml.math',
852
-            'sxw'         => 'application/vnd.sun.xml.writer',
853
-            't'           => 'text/troff',
854
-            't3'          => 'application/x-t3vm-image',
855
-            'taglet'      => 'application/vnd.mynfc',
856
-            'tao'         => 'application/vnd.tao.intent-module-archive',
857
-            'tar'         => 'application/x-tar',
858
-            'tcap'        => 'application/vnd.3gpp2.tcap',
859
-            'tcl'         => 'application/x-tcl',
860
-            'teacher'     => 'application/vnd.smart.teacher',
861
-            'tei'         => 'application/tei+xml',
862
-            'teicorpus'   => 'application/tei+xml',
863
-            'tex'         => 'application/x-tex',
864
-            'texi'        => 'application/x-texinfo',
865
-            'texinfo'     => 'application/x-texinfo',
866
-            'text'        => 'text/plain',
867
-            'tfi'         => 'application/thraud+xml',
868
-            'tfm'         => 'application/x-tex-tfm',
869
-            'tga'         => 'image/x-tga',
870
-            'tgz'         => 'application/x-gzip',
871
-            'thmx'        => 'application/vnd.ms-officetheme',
872
-            'tif'         => 'image/tiff',
873
-            'tiff'        => 'image/tiff',
874
-            'tmo'         => 'application/vnd.tmobile-livetv',
875
-            'torrent'     => 'application/x-bittorrent',
876
-            'tpl'         => 'application/vnd.groove-tool-template',
877
-            'tpt'         => 'application/vnd.trid.tpt',
878
-            'tr'          => 'text/troff',
879
-            'tra'         => 'application/vnd.trueapp',
880
-            'trm'         => 'application/x-msterminal',
881
-            'tsd'         => 'application/timestamped-data',
882
-            'tsv'         => 'text/tab-separated-values',
883
-            'ttc'         => 'application/x-font-ttf',
884
-            'ttf'         => 'application/x-font-ttf',
885
-            'ttl'         => 'text/turtle',
886
-            'twd'         => 'application/vnd.simtech-mindmapper',
887
-            'twds'        => 'application/vnd.simtech-mindmapper',
888
-            'txd'         => 'application/vnd.genomatix.tuxedo',
889
-            'txf'         => 'application/vnd.mobius.txf',
890
-            'txt'         => 'text/plain',
891
-            'u32'         => 'application/x-authorware-bin',
892
-            'udeb'        => 'application/x-debian-package',
893
-            'ufd'         => 'application/vnd.ufdl',
894
-            'ufdl'        => 'application/vnd.ufdl',
895
-            'ulx'         => 'application/x-glulx',
896
-            'umj'         => 'application/vnd.umajin',
897
-            'unityweb'    => 'application/vnd.unity',
898
-            'uoml'        => 'application/vnd.uoml+xml',
899
-            'uri'         => 'text/uri-list',
900
-            'uris'        => 'text/uri-list',
901
-            'urls'        => 'text/uri-list',
902
-            'ustar'       => 'application/x-ustar',
903
-            'utz'         => 'application/vnd.uiq.theme',
904
-            'uu'          => 'text/x-uuencode',
905
-            'uva'         => 'audio/vnd.dece.audio',
906
-            'uvd'         => 'application/vnd.dece.data',
907
-            'uvf'         => 'application/vnd.dece.data',
908
-            'uvg'         => 'image/vnd.dece.graphic',
909
-            'uvh'         => 'video/vnd.dece.hd',
910
-            'uvi'         => 'image/vnd.dece.graphic',
911
-            'uvm'         => 'video/vnd.dece.mobile',
912
-            'uvp'         => 'video/vnd.dece.pd',
913
-            'uvs'         => 'video/vnd.dece.sd',
914
-            'uvt'         => 'application/vnd.dece.ttml+xml',
915
-            'uvu'         => 'video/vnd.uvvu.mp4',
916
-            'uvv'         => 'video/vnd.dece.video',
917
-            'uvva'        => 'audio/vnd.dece.audio',
918
-            'uvvd'        => 'application/vnd.dece.data',
919
-            'uvvf'        => 'application/vnd.dece.data',
920
-            'uvvg'        => 'image/vnd.dece.graphic',
921
-            'uvvh'        => 'video/vnd.dece.hd',
922
-            'uvvi'        => 'image/vnd.dece.graphic',
923
-            'uvvm'        => 'video/vnd.dece.mobile',
924
-            'uvvp'        => 'video/vnd.dece.pd',
925
-            'uvvs'        => 'video/vnd.dece.sd',
926
-            'uvvt'        => 'application/vnd.dece.ttml+xml',
927
-            'uvvu'        => 'video/vnd.uvvu.mp4',
928
-            'uvvv'        => 'video/vnd.dece.video',
929
-            'uvvx'        => 'application/vnd.dece.unspecified',
930
-            'uvvz'        => 'application/vnd.dece.zip',
931
-            'uvx'         => 'application/vnd.dece.unspecified',
932
-            'uvz'         => 'application/vnd.dece.zip',
933
-            'vcard'       => 'text/vcard',
934
-            'vcd'         => 'application/x-cdlink',
935
-            'vcf'         => 'text/x-vcard',
936
-            'vcg'         => 'application/vnd.groove-vcard',
937
-            'vcs'         => 'text/x-vcalendar',
938
-            'vcx'         => 'application/vnd.vcx',
939
-            'vis'         => 'application/vnd.visionary',
940
-            'viv'         => 'video/vnd.vivo',
941
-            'vob'         => 'video/x-ms-vob',
942
-            'vor'         => 'application/vnd.stardivision.writer',
943
-            'vox'         => 'application/x-authorware-bin',
944
-            'vrml'        => 'model/vrml',
945
-            'vsd'         => 'application/vnd.visio',
946
-            'vsf'         => 'application/vnd.vsf',
947
-            'vss'         => 'application/vnd.visio',
948
-            'vst'         => 'application/vnd.visio',
949
-            'vsw'         => 'application/vnd.visio',
950
-            'vtu'         => 'model/vnd.vtu',
951
-            'vxml'        => 'application/voicexml+xml',
952
-            'w3d'         => 'application/x-director',
953
-            'wad'         => 'application/x-doom',
954
-            'wav'         => 'audio/x-wav',
955
-            'wax'         => 'audio/x-ms-wax',
956
-            'wbmp'        => 'image/vnd.wap.wbmp',
957
-            'wbs'         => 'application/vnd.criticaltools.wbs+xml',
958
-            'wbxml'       => 'application/vnd.wap.wbxml',
959
-            'wcm'         => 'application/vnd.ms-works',
960
-            'wdb'         => 'application/vnd.ms-works',
961
-            'wdp'         => 'image/vnd.ms-photo',
962
-            'weba'        => 'audio/webm',
963
-            'webm'        => 'video/webm',
964
-            'webp'        => 'image/webp',
965
-            'wg'          => 'application/vnd.pmi.widget',
966
-            'wgt'         => 'application/widget',
967
-            'wks'         => 'application/vnd.ms-works',
968
-            'wm'          => 'video/x-ms-wm',
969
-            'wma'         => 'audio/x-ms-wma',
970
-            'wmd'         => 'application/x-ms-wmd',
971
-            'wmf'         => 'application/x-msmetafile',
972
-            'wml'         => 'text/vnd.wap.wml',
973
-            'wmlc'        => 'application/vnd.wap.wmlc',
974
-            'wmls'        => 'text/vnd.wap.wmlscript',
975
-            'wmlsc'       => 'application/vnd.wap.wmlscriptc',
976
-            'wmv'         => 'video/x-ms-wmv',
977
-            'wmx'         => 'video/x-ms-wmx',
978
-            'wmz'         => 'application/x-ms-wmz',
979
-            'woff'        => 'application/x-font-woff',
980
-            'wpd'         => 'application/vnd.wordperfect',
981
-            'wpl'         => 'application/vnd.ms-wpl',
982
-            'wps'         => 'application/vnd.ms-works',
983
-            'wqd'         => 'application/vnd.wqd',
984
-            'wri'         => 'application/x-mswrite',
985
-            'wrl'         => 'model/vrml',
986
-            'wsdl'        => 'application/wsdl+xml',
987
-            'wspolicy'    => 'application/wspolicy+xml',
988
-            'wtb'         => 'application/vnd.webturbo',
989
-            'wvx'         => 'video/x-ms-wvx',
990
-            'x32'         => 'application/x-authorware-bin',
991
-            'x3d'         => 'model/x3d+xml',
992
-            'x3db'        => 'model/x3d+binary',
993
-            'x3dbz'       => 'model/x3d+binary',
994
-            'x3dv'        => 'model/x3d+vrml',
995
-            'x3dvz'       => 'model/x3d+vrml',
996
-            'x3dz'        => 'model/x3d+xml',
997
-            'xaml'        => 'application/xaml+xml',
998
-            'xap'         => 'application/x-silverlight-app',
999
-            'xar'         => 'application/vnd.xara',
1000
-            'xbap'        => 'application/x-ms-xbap',
1001
-            'xbd'         => 'application/vnd.fujixerox.docuworks.binder',
1002
-            'xbm'         => 'image/x-xbitmap',
1003
-            'xdf'         => 'application/xcap-diff+xml',
1004
-            'xdm'         => 'application/vnd.syncml.dm+xml',
1005
-            'xdp'         => 'application/vnd.adobe.xdp+xml',
1006
-            'xdssc'       => 'application/dssc+xml',
1007
-            'xdw'         => 'application/vnd.fujixerox.docuworks',
1008
-            'xenc'        => 'application/xenc+xml',
1009
-            'xer'         => 'application/patch-ops-error+xml',
1010
-            'xfdf'        => 'application/vnd.adobe.xfdf',
1011
-            'xfdl'        => 'application/vnd.xfdl',
1012
-            'xht'         => 'application/xhtml+xml',
1013
-            'xhtml'       => 'application/xhtml+xml',
1014
-            'xhvml'       => 'application/xv+xml',
1015
-            'xif'         => 'image/vnd.xiff',
1016
-            'xla'         => 'application/vnd.ms-excel',
1017
-            'xlam'        => 'application/vnd.ms-excel.addin.macroenabled.12',
1018
-            'xlc'         => 'application/vnd.ms-excel',
1019
-            'xlf'         => 'application/x-xliff+xml',
1020
-            'xlm'         => 'application/vnd.ms-excel',
1021
-            'xls'         => 'application/vnd.ms-excel',
1022
-            'xlsb'        => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
1023
-            'xlsm'        => 'application/vnd.ms-excel.sheet.macroenabled.12',
1024
-            'xlsx'        => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
1025
-            'xlt'         => 'application/vnd.ms-excel',
1026
-            'xltm'        => 'application/vnd.ms-excel.template.macroenabled.12',
1027
-            'xltx'        => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
1028
-            'xlw'         => 'application/vnd.ms-excel',
1029
-            'xm'          => 'audio/xm',
1030
-            'xml'         => 'application/xml',
1031
-            'xo'          => 'application/vnd.olpc-sugar',
1032
-            'xop'         => 'application/xop+xml',
1033
-            'xpi'         => 'application/x-xpinstall',
1034
-            'xpl'         => 'application/xproc+xml',
1035
-            'xpm'         => 'image/x-xpixmap',
1036
-            'xpr'         => 'application/vnd.is-xpr',
1037
-            'xps'         => 'application/vnd.ms-xpsdocument',
1038
-            'xpw'         => 'application/vnd.intercon.formnet',
1039
-            'xpx'         => 'application/vnd.intercon.formnet',
1040
-            'xsl'         => 'application/xml',
1041
-            'xslt'        => 'application/xslt+xml',
1042
-            'xsm'         => 'application/vnd.syncml+xml',
1043
-            'xspf'        => 'application/xspf+xml',
1044
-            'xul'         => 'application/vnd.mozilla.xul+xml',
1045
-            'xvm'         => 'application/xv+xml',
1046
-            'xvml'        => 'application/xv+xml',
1047
-            'xwd'         => 'image/x-xwindowdump',
1048
-            'xyz'         => 'chemical/x-xyz',
1049
-            'xz'          => 'application/x-xz',
1050
-            'yaml'        => 'text/yaml',
1051
-            'yang'        => 'application/yang',
1052
-            'yin'         => 'application/yin+xml',
1053
-            'yml'         => 'text/yaml',
1054
-            'z'           => 'application/x-compress',
1055
-            'z1'          => 'application/x-zmachine',
1056
-            'z2'          => 'application/x-zmachine',
1057
-            'z3'          => 'application/x-zmachine',
1058
-            'z4'          => 'application/x-zmachine',
1059
-            'z5'          => 'application/x-zmachine',
1060
-            'z6'          => 'application/x-zmachine',
1061
-            'z7'          => 'application/x-zmachine',
1062
-            'z8'          => 'application/x-zmachine',
1063
-            'zaz'         => 'application/vnd.zzazz.deck+xml',
1064
-            'zip'         => 'application/zip',
1065
-            'zir'         => 'application/vnd.zul',
1066
-            'zirz'        => 'application/vnd.zul',
1067
-            'zmm'         => 'application/vnd.handheld-entertainment+xml',
1068
-            '123'         => 'application/vnd.lotus-1-2-3',
1069
-        );
1070
-    }
41
+	/**
42
+	 * Returns an associative array with extension => mimetype mappings.
43
+	 *
44
+	 * Generated from source on 2 Aug 2013, 9:22pm PDT.
45
+	 *
46
+	 * @return array An associative array with extension => mimetype mappings.
47
+	 */
48
+	public function getMimeTypes()
49
+	{
50
+		return array(
51
+			'3dml'        => 'text/vnd.in3d.3dml',
52
+			'3ds'         => 'image/x-3ds',
53
+			'3g2'         => 'video/3gpp2',
54
+			'3gp'         => 'video/3gpp',
55
+			'7z'          => 'application/x-7z-compressed',
56
+			'aab'         => 'application/x-authorware-bin',
57
+			'aac'         => 'audio/x-aac',
58
+			'aam'         => 'application/x-authorware-map',
59
+			'aas'         => 'application/x-authorware-seg',
60
+			'abw'         => 'application/x-abiword',
61
+			'ac'          => 'application/pkix-attr-cert',
62
+			'acc'         => 'application/vnd.americandynamics.acc',
63
+			'ace'         => 'application/x-ace-compressed',
64
+			'acu'         => 'application/vnd.acucobol',
65
+			'acutc'       => 'application/vnd.acucorp',
66
+			'adp'         => 'audio/adpcm',
67
+			'aep'         => 'application/vnd.audiograph',
68
+			'afm'         => 'application/x-font-type1',
69
+			'afp'         => 'application/vnd.ibm.modcap',
70
+			'ahead'       => 'application/vnd.ahead.space',
71
+			'ai'          => 'application/postscript',
72
+			'aif'         => 'audio/x-aiff',
73
+			'aifc'        => 'audio/x-aiff',
74
+			'aiff'        => 'audio/x-aiff',
75
+			'air'         => 'application/vnd.adobe.air-application-installer-package+zip',
76
+			'ait'         => 'application/vnd.dvb.ait',
77
+			'ami'         => 'application/vnd.amiga.ami',
78
+			'apk'         => 'application/vnd.android.package-archive',
79
+			'appcache'    => 'text/cache-manifest',
80
+			'application' => 'application/x-ms-application',
81
+			'apr'         => 'application/vnd.lotus-approach',
82
+			'arc'         => 'application/x-freearc',
83
+			'asa'         => 'text/plain',
84
+			'asax'        => 'application/octet-stream',
85
+			'asc'         => 'application/pgp-signature',
86
+			'ascx'        => 'text/plain',
87
+			'asf'         => 'video/x-ms-asf',
88
+			'ashx'        => 'text/plain',
89
+			'asm'         => 'text/x-asm',
90
+			'asmx'        => 'text/plain',
91
+			'aso'         => 'application/vnd.accpac.simply.aso',
92
+			'asp'         => 'text/plain',
93
+			'aspx'        => 'text/plain',
94
+			'asx'         => 'video/x-ms-asf',
95
+			'atc'         => 'application/vnd.acucorp',
96
+			'atom'        => 'application/atom+xml',
97
+			'atomcat'     => 'application/atomcat+xml',
98
+			'atomsvc'     => 'application/atomsvc+xml',
99
+			'atx'         => 'application/vnd.antix.game-component',
100
+			'au'          => 'audio/basic',
101
+			'avi'         => 'video/x-msvideo',
102
+			'aw'          => 'application/applixware',
103
+			'axd'         => 'text/plain',
104
+			'azf'         => 'application/vnd.airzip.filesecure.azf',
105
+			'azs'         => 'application/vnd.airzip.filesecure.azs',
106
+			'azw'         => 'application/vnd.amazon.ebook',
107
+			'bat'         => 'application/x-msdownload',
108
+			'bcpio'       => 'application/x-bcpio',
109
+			'bdf'         => 'application/x-font-bdf',
110
+			'bdm'         => 'application/vnd.syncml.dm+wbxml',
111
+			'bed'         => 'application/vnd.realvnc.bed',
112
+			'bh2'         => 'application/vnd.fujitsu.oasysprs',
113
+			'bin'         => 'application/octet-stream',
114
+			'blb'         => 'application/x-blorb',
115
+			'blorb'       => 'application/x-blorb',
116
+			'bmi'         => 'application/vnd.bmi',
117
+			'bmp'         => 'image/bmp',
118
+			'book'        => 'application/vnd.framemaker',
119
+			'box'         => 'application/vnd.previewsystems.box',
120
+			'boz'         => 'application/x-bzip2',
121
+			'bpk'         => 'application/octet-stream',
122
+			'btif'        => 'image/prs.btif',
123
+			'bz'          => 'application/x-bzip',
124
+			'bz2'         => 'application/x-bzip2',
125
+			'c'           => 'text/x-c',
126
+			'c11amc'      => 'application/vnd.cluetrust.cartomobile-config',
127
+			'c11amz'      => 'application/vnd.cluetrust.cartomobile-config-pkg',
128
+			'c4d'         => 'application/vnd.clonk.c4group',
129
+			'c4f'         => 'application/vnd.clonk.c4group',
130
+			'c4g'         => 'application/vnd.clonk.c4group',
131
+			'c4p'         => 'application/vnd.clonk.c4group',
132
+			'c4u'         => 'application/vnd.clonk.c4group',
133
+			'cab'         => 'application/vnd.ms-cab-compressed',
134
+			'caf'         => 'audio/x-caf',
135
+			'cap'         => 'application/vnd.tcpdump.pcap',
136
+			'car'         => 'application/vnd.curl.car',
137
+			'cat'         => 'application/vnd.ms-pki.seccat',
138
+			'cb7'         => 'application/x-cbr',
139
+			'cba'         => 'application/x-cbr',
140
+			'cbr'         => 'application/x-cbr',
141
+			'cbt'         => 'application/x-cbr',
142
+			'cbz'         => 'application/x-cbr',
143
+			'cc'          => 'text/x-c',
144
+			'cct'         => 'application/x-director',
145
+			'ccxml'       => 'application/ccxml+xml',
146
+			'cdbcmsg'     => 'application/vnd.contact.cmsg',
147
+			'cdf'         => 'application/x-netcdf',
148
+			'cdkey'       => 'application/vnd.mediastation.cdkey',
149
+			'cdmia'       => 'application/cdmi-capability',
150
+			'cdmic'       => 'application/cdmi-container',
151
+			'cdmid'       => 'application/cdmi-domain',
152
+			'cdmio'       => 'application/cdmi-object',
153
+			'cdmiq'       => 'application/cdmi-queue',
154
+			'cdx'         => 'chemical/x-cdx',
155
+			'cdxml'       => 'application/vnd.chemdraw+xml',
156
+			'cdy'         => 'application/vnd.cinderella',
157
+			'cer'         => 'application/pkix-cert',
158
+			'cfc'         => 'application/x-coldfusion',
159
+			'cfm'         => 'application/x-coldfusion',
160
+			'cfs'         => 'application/x-cfs-compressed',
161
+			'cgm'         => 'image/cgm',
162
+			'chat'        => 'application/x-chat',
163
+			'chm'         => 'application/vnd.ms-htmlhelp',
164
+			'chrt'        => 'application/vnd.kde.kchart',
165
+			'cif'         => 'chemical/x-cif',
166
+			'cii'         => 'application/vnd.anser-web-certificate-issue-initiation',
167
+			'cil'         => 'application/vnd.ms-artgalry',
168
+			'cla'         => 'application/vnd.claymore',
169
+			'class'       => 'application/java-vm',
170
+			'clkk'        => 'application/vnd.crick.clicker.keyboard',
171
+			'clkp'        => 'application/vnd.crick.clicker.palette',
172
+			'clkt'        => 'application/vnd.crick.clicker.template',
173
+			'clkw'        => 'application/vnd.crick.clicker.wordbank',
174
+			'clkx'        => 'application/vnd.crick.clicker',
175
+			'clp'         => 'application/x-msclip',
176
+			'cmc'         => 'application/vnd.cosmocaller',
177
+			'cmdf'        => 'chemical/x-cmdf',
178
+			'cml'         => 'chemical/x-cml',
179
+			'cmp'         => 'application/vnd.yellowriver-custom-menu',
180
+			'cmx'         => 'image/x-cmx',
181
+			'cod'         => 'application/vnd.rim.cod',
182
+			'com'         => 'application/x-msdownload',
183
+			'conf'        => 'text/plain',
184
+			'cpio'        => 'application/x-cpio',
185
+			'cpp'         => 'text/x-c',
186
+			'cpt'         => 'application/mac-compactpro',
187
+			'crd'         => 'application/x-mscardfile',
188
+			'crl'         => 'application/pkix-crl',
189
+			'crt'         => 'application/x-x509-ca-cert',
190
+			'crx'         => 'application/octet-stream',
191
+			'cryptonote'  => 'application/vnd.rig.cryptonote',
192
+			'cs'          => 'text/plain',
193
+			'csh'         => 'application/x-csh',
194
+			'csml'        => 'chemical/x-csml',
195
+			'csp'         => 'application/vnd.commonspace',
196
+			'css'         => 'text/css',
197
+			'cst'         => 'application/x-director',
198
+			'csv'         => 'text/csv',
199
+			'cu'          => 'application/cu-seeme',
200
+			'curl'        => 'text/vnd.curl',
201
+			'cww'         => 'application/prs.cww',
202
+			'cxt'         => 'application/x-director',
203
+			'cxx'         => 'text/x-c',
204
+			'dae'         => 'model/vnd.collada+xml',
205
+			'daf'         => 'application/vnd.mobius.daf',
206
+			'dart'        => 'application/vnd.dart',
207
+			'dataless'    => 'application/vnd.fdsn.seed',
208
+			'davmount'    => 'application/davmount+xml',
209
+			'dbk'         => 'application/docbook+xml',
210
+			'dcr'         => 'application/x-director',
211
+			'dcurl'       => 'text/vnd.curl.dcurl',
212
+			'dd2'         => 'application/vnd.oma.dd2+xml',
213
+			'ddd'         => 'application/vnd.fujixerox.ddd',
214
+			'deb'         => 'application/x-debian-package',
215
+			'def'         => 'text/plain',
216
+			'deploy'      => 'application/octet-stream',
217
+			'der'         => 'application/x-x509-ca-cert',
218
+			'dfac'        => 'application/vnd.dreamfactory',
219
+			'dgc'         => 'application/x-dgc-compressed',
220
+			'dic'         => 'text/x-c',
221
+			'dir'         => 'application/x-director',
222
+			'dis'         => 'application/vnd.mobius.dis',
223
+			'dist'        => 'application/octet-stream',
224
+			'distz'       => 'application/octet-stream',
225
+			'djv'         => 'image/vnd.djvu',
226
+			'djvu'        => 'image/vnd.djvu',
227
+			'dll'         => 'application/x-msdownload',
228
+			'dmg'         => 'application/x-apple-diskimage',
229
+			'dmp'         => 'application/vnd.tcpdump.pcap',
230
+			'dms'         => 'application/octet-stream',
231
+			'dna'         => 'application/vnd.dna',
232
+			'doc'         => 'application/msword',
233
+			'docm'        => 'application/vnd.ms-word.document.macroenabled.12',
234
+			'docx'        => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
235
+			'dot'         => 'application/msword',
236
+			'dotm'        => 'application/vnd.ms-word.template.macroenabled.12',
237
+			'dotx'        => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
238
+			'dp'          => 'application/vnd.osgi.dp',
239
+			'dpg'         => 'application/vnd.dpgraph',
240
+			'dra'         => 'audio/vnd.dra',
241
+			'dsc'         => 'text/prs.lines.tag',
242
+			'dssc'        => 'application/dssc+der',
243
+			'dtb'         => 'application/x-dtbook+xml',
244
+			'dtd'         => 'application/xml-dtd',
245
+			'dts'         => 'audio/vnd.dts',
246
+			'dtshd'       => 'audio/vnd.dts.hd',
247
+			'dump'        => 'application/octet-stream',
248
+			'dvb'         => 'video/vnd.dvb.file',
249
+			'dvi'         => 'application/x-dvi',
250
+			'dwf'         => 'model/vnd.dwf',
251
+			'dwg'         => 'image/vnd.dwg',
252
+			'dxf'         => 'image/vnd.dxf',
253
+			'dxp'         => 'application/vnd.spotfire.dxp',
254
+			'dxr'         => 'application/x-director',
255
+			'ecelp4800'   => 'audio/vnd.nuera.ecelp4800',
256
+			'ecelp7470'   => 'audio/vnd.nuera.ecelp7470',
257
+			'ecelp9600'   => 'audio/vnd.nuera.ecelp9600',
258
+			'ecma'        => 'application/ecmascript',
259
+			'edm'         => 'application/vnd.novadigm.edm',
260
+			'edx'         => 'application/vnd.novadigm.edx',
261
+			'efif'        => 'application/vnd.picsel',
262
+			'ei6'         => 'application/vnd.pg.osasli',
263
+			'elc'         => 'application/octet-stream',
264
+			'emf'         => 'application/x-msmetafile',
265
+			'eml'         => 'message/rfc822',
266
+			'emma'        => 'application/emma+xml',
267
+			'emz'         => 'application/x-msmetafile',
268
+			'eol'         => 'audio/vnd.digital-winds',
269
+			'eot'         => 'application/vnd.ms-fontobject',
270
+			'eps'         => 'application/postscript',
271
+			'epub'        => 'application/epub+zip',
272
+			'es3'         => 'application/vnd.eszigno3+xml',
273
+			'esa'         => 'application/vnd.osgi.subsystem',
274
+			'esf'         => 'application/vnd.epson.esf',
275
+			'et3'         => 'application/vnd.eszigno3+xml',
276
+			'etx'         => 'text/x-setext',
277
+			'eva'         => 'application/x-eva',
278
+			'evy'         => 'application/x-envoy',
279
+			'exe'         => 'application/x-msdownload',
280
+			'exi'         => 'application/exi',
281
+			'ext'         => 'application/vnd.novadigm.ext',
282
+			'ez'          => 'application/andrew-inset',
283
+			'ez2'         => 'application/vnd.ezpix-album',
284
+			'ez3'         => 'application/vnd.ezpix-package',
285
+			'f'           => 'text/x-fortran',
286
+			'f4v'         => 'video/x-f4v',
287
+			'f77'         => 'text/x-fortran',
288
+			'f90'         => 'text/x-fortran',
289
+			'fbs'         => 'image/vnd.fastbidsheet',
290
+			'fcdt'        => 'application/vnd.adobe.formscentral.fcdt',
291
+			'fcs'         => 'application/vnd.isac.fcs',
292
+			'fdf'         => 'application/vnd.fdf',
293
+			'fe_launch'   => 'application/vnd.denovo.fcselayout-link',
294
+			'fg5'         => 'application/vnd.fujitsu.oasysgp',
295
+			'fgd'         => 'application/x-director',
296
+			'fh'          => 'image/x-freehand',
297
+			'fh4'         => 'image/x-freehand',
298
+			'fh5'         => 'image/x-freehand',
299
+			'fh7'         => 'image/x-freehand',
300
+			'fhc'         => 'image/x-freehand',
301
+			'fig'         => 'application/x-xfig',
302
+			'flac'        => 'audio/x-flac',
303
+			'fli'         => 'video/x-fli',
304
+			'flo'         => 'application/vnd.micrografx.flo',
305
+			'flv'         => 'video/x-flv',
306
+			'flw'         => 'application/vnd.kde.kivio',
307
+			'flx'         => 'text/vnd.fmi.flexstor',
308
+			'fly'         => 'text/vnd.fly',
309
+			'fm'          => 'application/vnd.framemaker',
310
+			'fnc'         => 'application/vnd.frogans.fnc',
311
+			'for'         => 'text/x-fortran',
312
+			'fpx'         => 'image/vnd.fpx',
313
+			'frame'       => 'application/vnd.framemaker',
314
+			'fsc'         => 'application/vnd.fsc.weblaunch',
315
+			'fst'         => 'image/vnd.fst',
316
+			'ftc'         => 'application/vnd.fluxtime.clip',
317
+			'fti'         => 'application/vnd.anser-web-funds-transfer-initiation',
318
+			'fvt'         => 'video/vnd.fvt',
319
+			'fxp'         => 'application/vnd.adobe.fxp',
320
+			'fxpl'        => 'application/vnd.adobe.fxp',
321
+			'fzs'         => 'application/vnd.fuzzysheet',
322
+			'g2w'         => 'application/vnd.geoplan',
323
+			'g3'          => 'image/g3fax',
324
+			'g3w'         => 'application/vnd.geospace',
325
+			'gac'         => 'application/vnd.groove-account',
326
+			'gam'         => 'application/x-tads',
327
+			'gbr'         => 'application/rpki-ghostbusters',
328
+			'gca'         => 'application/x-gca-compressed',
329
+			'gdl'         => 'model/vnd.gdl',
330
+			'geo'         => 'application/vnd.dynageo',
331
+			'gex'         => 'application/vnd.geometry-explorer',
332
+			'ggb'         => 'application/vnd.geogebra.file',
333
+			'ggt'         => 'application/vnd.geogebra.tool',
334
+			'ghf'         => 'application/vnd.groove-help',
335
+			'gif'         => 'image/gif',
336
+			'gim'         => 'application/vnd.groove-identity-message',
337
+			'gml'         => 'application/gml+xml',
338
+			'gmx'         => 'application/vnd.gmx',
339
+			'gnumeric'    => 'application/x-gnumeric',
340
+			'gph'         => 'application/vnd.flographit',
341
+			'gpx'         => 'application/gpx+xml',
342
+			'gqf'         => 'application/vnd.grafeq',
343
+			'gqs'         => 'application/vnd.grafeq',
344
+			'gram'        => 'application/srgs',
345
+			'gramps'      => 'application/x-gramps-xml',
346
+			'gre'         => 'application/vnd.geometry-explorer',
347
+			'grv'         => 'application/vnd.groove-injector',
348
+			'grxml'       => 'application/srgs+xml',
349
+			'gsf'         => 'application/x-font-ghostscript',
350
+			'gtar'        => 'application/x-gtar',
351
+			'gtm'         => 'application/vnd.groove-tool-message',
352
+			'gtw'         => 'model/vnd.gtw',
353
+			'gv'          => 'text/vnd.graphviz',
354
+			'gxf'         => 'application/gxf',
355
+			'gxt'         => 'application/vnd.geonext',
356
+			'gz'          => 'application/x-gzip',
357
+			'h'           => 'text/x-c',
358
+			'h261'        => 'video/h261',
359
+			'h263'        => 'video/h263',
360
+			'h264'        => 'video/h264',
361
+			'hal'         => 'application/vnd.hal+xml',
362
+			'hbci'        => 'application/vnd.hbci',
363
+			'hdf'         => 'application/x-hdf',
364
+			'hh'          => 'text/x-c',
365
+			'hlp'         => 'application/winhlp',
366
+			'hpgl'        => 'application/vnd.hp-hpgl',
367
+			'hpid'        => 'application/vnd.hp-hpid',
368
+			'hps'         => 'application/vnd.hp-hps',
369
+			'hqx'         => 'application/mac-binhex40',
370
+			'hta'         => 'application/octet-stream',
371
+			'htc'         => 'text/html',
372
+			'htke'        => 'application/vnd.kenameaapp',
373
+			'htm'         => 'text/html',
374
+			'html'        => 'text/html',
375
+			'hvd'         => 'application/vnd.yamaha.hv-dic',
376
+			'hvp'         => 'application/vnd.yamaha.hv-voice',
377
+			'hvs'         => 'application/vnd.yamaha.hv-script',
378
+			'i2g'         => 'application/vnd.intergeo',
379
+			'icc'         => 'application/vnd.iccprofile',
380
+			'ice'         => 'x-conference/x-cooltalk',
381
+			'icm'         => 'application/vnd.iccprofile',
382
+			'ico'         => 'image/x-icon',
383
+			'ics'         => 'text/calendar',
384
+			'ief'         => 'image/ief',
385
+			'ifb'         => 'text/calendar',
386
+			'ifm'         => 'application/vnd.shana.informed.formdata',
387
+			'iges'        => 'model/iges',
388
+			'igl'         => 'application/vnd.igloader',
389
+			'igm'         => 'application/vnd.insors.igm',
390
+			'igs'         => 'model/iges',
391
+			'igx'         => 'application/vnd.micrografx.igx',
392
+			'iif'         => 'application/vnd.shana.informed.interchange',
393
+			'imp'         => 'application/vnd.accpac.simply.imp',
394
+			'ims'         => 'application/vnd.ms-ims',
395
+			'in'          => 'text/plain',
396
+			'ini'         => 'text/plain',
397
+			'ink'         => 'application/inkml+xml',
398
+			'inkml'       => 'application/inkml+xml',
399
+			'install'     => 'application/x-install-instructions',
400
+			'iota'        => 'application/vnd.astraea-software.iota',
401
+			'ipa'         => 'application/octet-stream',
402
+			'ipfix'       => 'application/ipfix',
403
+			'ipk'         => 'application/vnd.shana.informed.package',
404
+			'irm'         => 'application/vnd.ibm.rights-management',
405
+			'irp'         => 'application/vnd.irepository.package+xml',
406
+			'iso'         => 'application/x-iso9660-image',
407
+			'itp'         => 'application/vnd.shana.informed.formtemplate',
408
+			'ivp'         => 'application/vnd.immervision-ivp',
409
+			'ivu'         => 'application/vnd.immervision-ivu',
410
+			'jad'         => 'text/vnd.sun.j2me.app-descriptor',
411
+			'jam'         => 'application/vnd.jam',
412
+			'jar'         => 'application/java-archive',
413
+			'java'        => 'text/x-java-source',
414
+			'jisp'        => 'application/vnd.jisp',
415
+			'jlt'         => 'application/vnd.hp-jlyt',
416
+			'jnlp'        => 'application/x-java-jnlp-file',
417
+			'joda'        => 'application/vnd.joost.joda-archive',
418
+			'jpe'         => 'image/jpeg',
419
+			'jpeg'        => 'image/jpeg',
420
+			'jpg'         => 'image/jpeg',
421
+			'jpgm'        => 'video/jpm',
422
+			'jpgv'        => 'video/jpeg',
423
+			'jpm'         => 'video/jpm',
424
+			'js'          => 'text/javascript',
425
+			'json'        => 'application/json',
426
+			'jsonml'      => 'application/jsonml+json',
427
+			'kar'         => 'audio/midi',
428
+			'karbon'      => 'application/vnd.kde.karbon',
429
+			'kfo'         => 'application/vnd.kde.kformula',
430
+			'kia'         => 'application/vnd.kidspiration',
431
+			'kml'         => 'application/vnd.google-earth.kml+xml',
432
+			'kmz'         => 'application/vnd.google-earth.kmz',
433
+			'kne'         => 'application/vnd.kinar',
434
+			'knp'         => 'application/vnd.kinar',
435
+			'kon'         => 'application/vnd.kde.kontour',
436
+			'kpr'         => 'application/vnd.kde.kpresenter',
437
+			'kpt'         => 'application/vnd.kde.kpresenter',
438
+			'kpxx'        => 'application/vnd.ds-keypoint',
439
+			'ksp'         => 'application/vnd.kde.kspread',
440
+			'ktr'         => 'application/vnd.kahootz',
441
+			'ktx'         => 'image/ktx',
442
+			'ktz'         => 'application/vnd.kahootz',
443
+			'kwd'         => 'application/vnd.kde.kword',
444
+			'kwt'         => 'application/vnd.kde.kword',
445
+			'lasxml'      => 'application/vnd.las.las+xml',
446
+			'latex'       => 'application/x-latex',
447
+			'lbd'         => 'application/vnd.llamagraphics.life-balance.desktop',
448
+			'lbe'         => 'application/vnd.llamagraphics.life-balance.exchange+xml',
449
+			'les'         => 'application/vnd.hhe.lesson-player',
450
+			'lha'         => 'application/x-lzh-compressed',
451
+			'link66'      => 'application/vnd.route66.link66+xml',
452
+			'list'        => 'text/plain',
453
+			'list3820'    => 'application/vnd.ibm.modcap',
454
+			'listafp'     => 'application/vnd.ibm.modcap',
455
+			'lnk'         => 'application/x-ms-shortcut',
456
+			'log'         => 'text/plain',
457
+			'lostxml'     => 'application/lost+xml',
458
+			'lrf'         => 'application/octet-stream',
459
+			'lrm'         => 'application/vnd.ms-lrm',
460
+			'ltf'         => 'application/vnd.frogans.ltf',
461
+			'lvp'         => 'audio/vnd.lucent.voice',
462
+			'lwp'         => 'application/vnd.lotus-wordpro',
463
+			'lz'          => 'application/x-lzip',
464
+			'lzh'         => 'application/x-lzh-compressed',
465
+			'lzma'        => 'application/x-lzma',
466
+			'lzo'         => 'application/x-lzop',
467
+			'm13'         => 'application/x-msmediaview',
468
+			'm14'         => 'application/x-msmediaview',
469
+			'm1v'         => 'video/mpeg',
470
+			'm21'         => 'application/mp21',
471
+			'm2a'         => 'audio/mpeg',
472
+			'm2v'         => 'video/mpeg',
473
+			'm3a'         => 'audio/mpeg',
474
+			'm3u'         => 'audio/x-mpegurl',
475
+			'm3u8'        => 'application/vnd.apple.mpegurl',
476
+			'm4a'         => 'audio/mp4',
477
+			'm4u'         => 'video/vnd.mpegurl',
478
+			'm4v'         => 'video/mp4',
479
+			'ma'          => 'application/mathematica',
480
+			'mads'        => 'application/mads+xml',
481
+			'mag'         => 'application/vnd.ecowin.chart',
482
+			'maker'       => 'application/vnd.framemaker',
483
+			'man'         => 'text/troff',
484
+			'mar'         => 'application/octet-stream',
485
+			'mathml'      => 'application/mathml+xml',
486
+			'mb'          => 'application/mathematica',
487
+			'mbk'         => 'application/vnd.mobius.mbk',
488
+			'mbox'        => 'application/mbox',
489
+			'mc1'         => 'application/vnd.medcalcdata',
490
+			'mcd'         => 'application/vnd.mcd',
491
+			'mcurl'       => 'text/vnd.curl.mcurl',
492
+			'mdb'         => 'application/x-msaccess',
493
+			'mdi'         => 'image/vnd.ms-modi',
494
+			'me'          => 'text/troff',
495
+			'mesh'        => 'model/mesh',
496
+			'meta4'       => 'application/metalink4+xml',
497
+			'metalink'    => 'application/metalink+xml',
498
+			'mets'        => 'application/mets+xml',
499
+			'mfm'         => 'application/vnd.mfmp',
500
+			'mft'         => 'application/rpki-manifest',
501
+			'mgp'         => 'application/vnd.osgeo.mapguide.package',
502
+			'mgz'         => 'application/vnd.proteus.magazine',
503
+			'mid'         => 'audio/midi',
504
+			'midi'        => 'audio/midi',
505
+			'mie'         => 'application/x-mie',
506
+			'mif'         => 'application/vnd.mif',
507
+			'mime'        => 'message/rfc822',
508
+			'mj2'         => 'video/mj2',
509
+			'mjp2'        => 'video/mj2',
510
+			'mk3d'        => 'video/x-matroska',
511
+			'mka'         => 'audio/x-matroska',
512
+			'mks'         => 'video/x-matroska',
513
+			'mkv'         => 'video/x-matroska',
514
+			'mlp'         => 'application/vnd.dolby.mlp',
515
+			'mmd'         => 'application/vnd.chipnuts.karaoke-mmd',
516
+			'mmf'         => 'application/vnd.smaf',
517
+			'mmr'         => 'image/vnd.fujixerox.edmics-mmr',
518
+			'mng'         => 'video/x-mng',
519
+			'mny'         => 'application/x-msmoney',
520
+			'mobi'        => 'application/x-mobipocket-ebook',
521
+			'mods'        => 'application/mods+xml',
522
+			'mov'         => 'video/quicktime',
523
+			'movie'       => 'video/x-sgi-movie',
524
+			'mp2'         => 'audio/mpeg',
525
+			'mp21'        => 'application/mp21',
526
+			'mp2a'        => 'audio/mpeg',
527
+			'mp3'         => 'audio/mpeg',
528
+			'mp4'         => 'video/mp4',
529
+			'mp4a'        => 'audio/mp4',
530
+			'mp4s'        => 'application/mp4',
531
+			'mp4v'        => 'video/mp4',
532
+			'mpc'         => 'application/vnd.mophun.certificate',
533
+			'mpe'         => 'video/mpeg',
534
+			'mpeg'        => 'video/mpeg',
535
+			'mpg'         => 'video/mpeg',
536
+			'mpg4'        => 'video/mp4',
537
+			'mpga'        => 'audio/mpeg',
538
+			'mpkg'        => 'application/vnd.apple.installer+xml',
539
+			'mpm'         => 'application/vnd.blueice.multipass',
540
+			'mpn'         => 'application/vnd.mophun.application',
541
+			'mpp'         => 'application/vnd.ms-project',
542
+			'mpt'         => 'application/vnd.ms-project',
543
+			'mpy'         => 'application/vnd.ibm.minipay',
544
+			'mqy'         => 'application/vnd.mobius.mqy',
545
+			'mrc'         => 'application/marc',
546
+			'mrcx'        => 'application/marcxml+xml',
547
+			'ms'          => 'text/troff',
548
+			'mscml'       => 'application/mediaservercontrol+xml',
549
+			'mseed'       => 'application/vnd.fdsn.mseed',
550
+			'mseq'        => 'application/vnd.mseq',
551
+			'msf'         => 'application/vnd.epson.msf',
552
+			'msh'         => 'model/mesh',
553
+			'msi'         => 'application/x-msdownload',
554
+			'msl'         => 'application/vnd.mobius.msl',
555
+			'msty'        => 'application/vnd.muvee.style',
556
+			'mts'         => 'model/vnd.mts',
557
+			'mus'         => 'application/vnd.musician',
558
+			'musicxml'    => 'application/vnd.recordare.musicxml+xml',
559
+			'mvb'         => 'application/x-msmediaview',
560
+			'mwf'         => 'application/vnd.mfer',
561
+			'mxf'         => 'application/mxf',
562
+			'mxl'         => 'application/vnd.recordare.musicxml',
563
+			'mxml'        => 'application/xv+xml',
564
+			'mxs'         => 'application/vnd.triscape.mxs',
565
+			'mxu'         => 'video/vnd.mpegurl',
566
+			'n-gage'      => 'application/vnd.nokia.n-gage.symbian.install',
567
+			'n3'          => 'text/n3',
568
+			'nb'          => 'application/mathematica',
569
+			'nbp'         => 'application/vnd.wolfram.player',
570
+			'nc'          => 'application/x-netcdf',
571
+			'ncx'         => 'application/x-dtbncx+xml',
572
+			'nfo'         => 'text/x-nfo',
573
+			'ngdat'       => 'application/vnd.nokia.n-gage.data',
574
+			'nitf'        => 'application/vnd.nitf',
575
+			'nlu'         => 'application/vnd.neurolanguage.nlu',
576
+			'nml'         => 'application/vnd.enliven',
577
+			'nnd'         => 'application/vnd.noblenet-directory',
578
+			'nns'         => 'application/vnd.noblenet-sealer',
579
+			'nnw'         => 'application/vnd.noblenet-web',
580
+			'npx'         => 'image/vnd.net-fpx',
581
+			'nsc'         => 'application/x-conference',
582
+			'nsf'         => 'application/vnd.lotus-notes',
583
+			'ntf'         => 'application/vnd.nitf',
584
+			'nzb'         => 'application/x-nzb',
585
+			'oa2'         => 'application/vnd.fujitsu.oasys2',
586
+			'oa3'         => 'application/vnd.fujitsu.oasys3',
587
+			'oas'         => 'application/vnd.fujitsu.oasys',
588
+			'obd'         => 'application/x-msbinder',
589
+			'obj'         => 'application/x-tgif',
590
+			'oda'         => 'application/oda',
591
+			'odb'         => 'application/vnd.oasis.opendocument.database',
592
+			'odc'         => 'application/vnd.oasis.opendocument.chart',
593
+			'odf'         => 'application/vnd.oasis.opendocument.formula',
594
+			'odft'        => 'application/vnd.oasis.opendocument.formula-template',
595
+			'odg'         => 'application/vnd.oasis.opendocument.graphics',
596
+			'odi'         => 'application/vnd.oasis.opendocument.image',
597
+			'odm'         => 'application/vnd.oasis.opendocument.text-master',
598
+			'odp'         => 'application/vnd.oasis.opendocument.presentation',
599
+			'ods'         => 'application/vnd.oasis.opendocument.spreadsheet',
600
+			'odt'         => 'application/vnd.oasis.opendocument.text',
601
+			'oga'         => 'audio/ogg',
602
+			'ogg'         => 'audio/ogg',
603
+			'ogv'         => 'video/ogg',
604
+			'ogx'         => 'application/ogg',
605
+			'omdoc'       => 'application/omdoc+xml',
606
+			'onepkg'      => 'application/onenote',
607
+			'onetmp'      => 'application/onenote',
608
+			'onetoc'      => 'application/onenote',
609
+			'onetoc2'     => 'application/onenote',
610
+			'opf'         => 'application/oebps-package+xml',
611
+			'opml'        => 'text/x-opml',
612
+			'oprc'        => 'application/vnd.palm',
613
+			'org'         => 'application/vnd.lotus-organizer',
614
+			'osf'         => 'application/vnd.yamaha.openscoreformat',
615
+			'osfpvg'      => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
616
+			'otc'         => 'application/vnd.oasis.opendocument.chart-template',
617
+			'otf'         => 'application/x-font-otf',
618
+			'otg'         => 'application/vnd.oasis.opendocument.graphics-template',
619
+			'oth'         => 'application/vnd.oasis.opendocument.text-web',
620
+			'oti'         => 'application/vnd.oasis.opendocument.image-template',
621
+			'otp'         => 'application/vnd.oasis.opendocument.presentation-template',
622
+			'ots'         => 'application/vnd.oasis.opendocument.spreadsheet-template',
623
+			'ott'         => 'application/vnd.oasis.opendocument.text-template',
624
+			'oxps'        => 'application/oxps',
625
+			'oxt'         => 'application/vnd.openofficeorg.extension',
626
+			'p'           => 'text/x-pascal',
627
+			'p10'         => 'application/pkcs10',
628
+			'p12'         => 'application/x-pkcs12',
629
+			'p7b'         => 'application/x-pkcs7-certificates',
630
+			'p7c'         => 'application/pkcs7-mime',
631
+			'p7m'         => 'application/pkcs7-mime',
632
+			'p7r'         => 'application/x-pkcs7-certreqresp',
633
+			'p7s'         => 'application/pkcs7-signature',
634
+			'p8'          => 'application/pkcs8',
635
+			'pas'         => 'text/x-pascal',
636
+			'paw'         => 'application/vnd.pawaafile',
637
+			'pbd'         => 'application/vnd.powerbuilder6',
638
+			'pbm'         => 'image/x-portable-bitmap',
639
+			'pcap'        => 'application/vnd.tcpdump.pcap',
640
+			'pcf'         => 'application/x-font-pcf',
641
+			'pcl'         => 'application/vnd.hp-pcl',
642
+			'pclxl'       => 'application/vnd.hp-pclxl',
643
+			'pct'         => 'image/x-pict',
644
+			'pcurl'       => 'application/vnd.curl.pcurl',
645
+			'pcx'         => 'image/x-pcx',
646
+			'pdb'         => 'application/vnd.palm',
647
+			'pdf'         => 'application/pdf',
648
+			'pfa'         => 'application/x-font-type1',
649
+			'pfb'         => 'application/x-font-type1',
650
+			'pfm'         => 'application/x-font-type1',
651
+			'pfr'         => 'application/font-tdpfr',
652
+			'pfx'         => 'application/x-pkcs12',
653
+			'pgm'         => 'image/x-portable-graymap',
654
+			'pgn'         => 'application/x-chess-pgn',
655
+			'pgp'         => 'application/pgp-encrypted',
656
+			'phar'        => 'application/octet-stream',
657
+			'php'         => 'text/plain',
658
+			'phps'        => 'application/x-httpd-phps',
659
+			'pic'         => 'image/x-pict',
660
+			'pkg'         => 'application/octet-stream',
661
+			'pki'         => 'application/pkixcmp',
662
+			'pkipath'     => 'application/pkix-pkipath',
663
+			'plb'         => 'application/vnd.3gpp.pic-bw-large',
664
+			'plc'         => 'application/vnd.mobius.plc',
665
+			'plf'         => 'application/vnd.pocketlearn',
666
+			'plist'       => 'application/x-plist',
667
+			'pls'         => 'application/pls+xml',
668
+			'pml'         => 'application/vnd.ctc-posml',
669
+			'png'         => 'image/png',
670
+			'pnm'         => 'image/x-portable-anymap',
671
+			'portpkg'     => 'application/vnd.macports.portpkg',
672
+			'pot'         => 'application/vnd.ms-powerpoint',
673
+			'potm'        => 'application/vnd.ms-powerpoint.template.macroenabled.12',
674
+			'potx'        => 'application/vnd.openxmlformats-officedocument.presentationml.template',
675
+			'ppam'        => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
676
+			'ppd'         => 'application/vnd.cups-ppd',
677
+			'ppm'         => 'image/x-portable-pixmap',
678
+			'pps'         => 'application/vnd.ms-powerpoint',
679
+			'ppsm'        => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
680
+			'ppsx'        => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
681
+			'ppt'         => 'application/vnd.ms-powerpoint',
682
+			'pptm'        => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
683
+			'pptx'        => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
684
+			'pqa'         => 'application/vnd.palm',
685
+			'prc'         => 'application/x-mobipocket-ebook',
686
+			'pre'         => 'application/vnd.lotus-freelance',
687
+			'prf'         => 'application/pics-rules',
688
+			'ps'          => 'application/postscript',
689
+			'psb'         => 'application/vnd.3gpp.pic-bw-small',
690
+			'psd'         => 'image/vnd.adobe.photoshop',
691
+			'psf'         => 'application/x-font-linux-psf',
692
+			'pskcxml'     => 'application/pskc+xml',
693
+			'ptid'        => 'application/vnd.pvi.ptid1',
694
+			'pub'         => 'application/x-mspublisher',
695
+			'pvb'         => 'application/vnd.3gpp.pic-bw-var',
696
+			'pwn'         => 'application/vnd.3m.post-it-notes',
697
+			'pya'         => 'audio/vnd.ms-playready.media.pya',
698
+			'pyv'         => 'video/vnd.ms-playready.media.pyv',
699
+			'qam'         => 'application/vnd.epson.quickanime',
700
+			'qbo'         => 'application/vnd.intu.qbo',
701
+			'qfx'         => 'application/vnd.intu.qfx',
702
+			'qps'         => 'application/vnd.publishare-delta-tree',
703
+			'qt'          => 'video/quicktime',
704
+			'qwd'         => 'application/vnd.quark.quarkxpress',
705
+			'qwt'         => 'application/vnd.quark.quarkxpress',
706
+			'qxb'         => 'application/vnd.quark.quarkxpress',
707
+			'qxd'         => 'application/vnd.quark.quarkxpress',
708
+			'qxl'         => 'application/vnd.quark.quarkxpress',
709
+			'qxt'         => 'application/vnd.quark.quarkxpress',
710
+			'ra'          => 'audio/x-pn-realaudio',
711
+			'ram'         => 'audio/x-pn-realaudio',
712
+			'rar'         => 'application/x-rar-compressed',
713
+			'ras'         => 'image/x-cmu-raster',
714
+			'rb'          => 'text/plain',
715
+			'rcprofile'   => 'application/vnd.ipunplugged.rcprofile',
716
+			'rdf'         => 'application/rdf+xml',
717
+			'rdz'         => 'application/vnd.data-vision.rdz',
718
+			'rep'         => 'application/vnd.businessobjects',
719
+			'res'         => 'application/x-dtbresource+xml',
720
+			'resx'        => 'text/xml',
721
+			'rgb'         => 'image/x-rgb',
722
+			'rif'         => 'application/reginfo+xml',
723
+			'rip'         => 'audio/vnd.rip',
724
+			'ris'         => 'application/x-research-info-systems',
725
+			'rl'          => 'application/resource-lists+xml',
726
+			'rlc'         => 'image/vnd.fujixerox.edmics-rlc',
727
+			'rld'         => 'application/resource-lists-diff+xml',
728
+			'rm'          => 'application/vnd.rn-realmedia',
729
+			'rmi'         => 'audio/midi',
730
+			'rmp'         => 'audio/x-pn-realaudio-plugin',
731
+			'rms'         => 'application/vnd.jcp.javame.midlet-rms',
732
+			'rmvb'        => 'application/vnd.rn-realmedia-vbr',
733
+			'rnc'         => 'application/relax-ng-compact-syntax',
734
+			'roa'         => 'application/rpki-roa',
735
+			'roff'        => 'text/troff',
736
+			'rp9'         => 'application/vnd.cloanto.rp9',
737
+			'rpm'         => 'application/x-rpm',
738
+			'rpss'        => 'application/vnd.nokia.radio-presets',
739
+			'rpst'        => 'application/vnd.nokia.radio-preset',
740
+			'rq'          => 'application/sparql-query',
741
+			'rs'          => 'application/rls-services+xml',
742
+			'rsd'         => 'application/rsd+xml',
743
+			'rss'         => 'application/rss+xml',
744
+			'rtf'         => 'application/rtf',
745
+			'rtx'         => 'text/richtext',
746
+			's'           => 'text/x-asm',
747
+			's3m'         => 'audio/s3m',
748
+			's7z'         => 'application/x-7z-compressed',
749
+			'saf'         => 'application/vnd.yamaha.smaf-audio',
750
+			'safariextz'  => 'application/octet-stream',
751
+			'sass'        => 'text/x-sass',
752
+			'sbml'        => 'application/sbml+xml',
753
+			'sc'          => 'application/vnd.ibm.secure-container',
754
+			'scd'         => 'application/x-msschedule',
755
+			'scm'         => 'application/vnd.lotus-screencam',
756
+			'scq'         => 'application/scvp-cv-request',
757
+			'scs'         => 'application/scvp-cv-response',
758
+			'scss'        => 'text/x-scss',
759
+			'scurl'       => 'text/vnd.curl.scurl',
760
+			'sda'         => 'application/vnd.stardivision.draw',
761
+			'sdc'         => 'application/vnd.stardivision.calc',
762
+			'sdd'         => 'application/vnd.stardivision.impress',
763
+			'sdkd'        => 'application/vnd.solent.sdkm+xml',
764
+			'sdkm'        => 'application/vnd.solent.sdkm+xml',
765
+			'sdp'         => 'application/sdp',
766
+			'sdw'         => 'application/vnd.stardivision.writer',
767
+			'see'         => 'application/vnd.seemail',
768
+			'seed'        => 'application/vnd.fdsn.seed',
769
+			'sema'        => 'application/vnd.sema',
770
+			'semd'        => 'application/vnd.semd',
771
+			'semf'        => 'application/vnd.semf',
772
+			'ser'         => 'application/java-serialized-object',
773
+			'setpay'      => 'application/set-payment-initiation',
774
+			'setreg'      => 'application/set-registration-initiation',
775
+			'sfd-hdstx'   => 'application/vnd.hydrostatix.sof-data',
776
+			'sfs'         => 'application/vnd.spotfire.sfs',
777
+			'sfv'         => 'text/x-sfv',
778
+			'sgi'         => 'image/sgi',
779
+			'sgl'         => 'application/vnd.stardivision.writer-global',
780
+			'sgm'         => 'text/sgml',
781
+			'sgml'        => 'text/sgml',
782
+			'sh'          => 'application/x-sh',
783
+			'shar'        => 'application/x-shar',
784
+			'shf'         => 'application/shf+xml',
785
+			'sid'         => 'image/x-mrsid-image',
786
+			'sig'         => 'application/pgp-signature',
787
+			'sil'         => 'audio/silk',
788
+			'silo'        => 'model/mesh',
789
+			'sis'         => 'application/vnd.symbian.install',
790
+			'sisx'        => 'application/vnd.symbian.install',
791
+			'sit'         => 'application/x-stuffit',
792
+			'sitx'        => 'application/x-stuffitx',
793
+			'skd'         => 'application/vnd.koan',
794
+			'skm'         => 'application/vnd.koan',
795
+			'skp'         => 'application/vnd.koan',
796
+			'skt'         => 'application/vnd.koan',
797
+			'sldm'        => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
798
+			'sldx'        => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
799
+			'slt'         => 'application/vnd.epson.salt',
800
+			'sm'          => 'application/vnd.stepmania.stepchart',
801
+			'smf'         => 'application/vnd.stardivision.math',
802
+			'smi'         => 'application/smil+xml',
803
+			'smil'        => 'application/smil+xml',
804
+			'smv'         => 'video/x-smv',
805
+			'smzip'       => 'application/vnd.stepmania.package',
806
+			'snd'         => 'audio/basic',
807
+			'snf'         => 'application/x-font-snf',
808
+			'so'          => 'application/octet-stream',
809
+			'spc'         => 'application/x-pkcs7-certificates',
810
+			'spf'         => 'application/vnd.yamaha.smaf-phrase',
811
+			'spl'         => 'application/x-futuresplash',
812
+			'spot'        => 'text/vnd.in3d.spot',
813
+			'spp'         => 'application/scvp-vp-response',
814
+			'spq'         => 'application/scvp-vp-request',
815
+			'spx'         => 'audio/ogg',
816
+			'sql'         => 'application/x-sql',
817
+			'src'         => 'application/x-wais-source',
818
+			'srt'         => 'application/x-subrip',
819
+			'sru'         => 'application/sru+xml',
820
+			'srx'         => 'application/sparql-results+xml',
821
+			'ssdl'        => 'application/ssdl+xml',
822
+			'sse'         => 'application/vnd.kodak-descriptor',
823
+			'ssf'         => 'application/vnd.epson.ssf',
824
+			'ssml'        => 'application/ssml+xml',
825
+			'st'          => 'application/vnd.sailingtracker.track',
826
+			'stc'         => 'application/vnd.sun.xml.calc.template',
827
+			'std'         => 'application/vnd.sun.xml.draw.template',
828
+			'stf'         => 'application/vnd.wt.stf',
829
+			'sti'         => 'application/vnd.sun.xml.impress.template',
830
+			'stk'         => 'application/hyperstudio',
831
+			'stl'         => 'application/vnd.ms-pki.stl',
832
+			'str'         => 'application/vnd.pg.format',
833
+			'stw'         => 'application/vnd.sun.xml.writer.template',
834
+			'styl'        => 'text/x-styl',
835
+			'sub'         => 'image/vnd.dvb.subtitle',
836
+			'sus'         => 'application/vnd.sus-calendar',
837
+			'susp'        => 'application/vnd.sus-calendar',
838
+			'sv4cpio'     => 'application/x-sv4cpio',
839
+			'sv4crc'      => 'application/x-sv4crc',
840
+			'svc'         => 'application/vnd.dvb.service',
841
+			'svd'         => 'application/vnd.svd',
842
+			'svg'         => 'image/svg+xml',
843
+			'svgz'        => 'image/svg+xml',
844
+			'swa'         => 'application/x-director',
845
+			'swf'         => 'application/x-shockwave-flash',
846
+			'swi'         => 'application/vnd.aristanetworks.swi',
847
+			'sxc'         => 'application/vnd.sun.xml.calc',
848
+			'sxd'         => 'application/vnd.sun.xml.draw',
849
+			'sxg'         => 'application/vnd.sun.xml.writer.global',
850
+			'sxi'         => 'application/vnd.sun.xml.impress',
851
+			'sxm'         => 'application/vnd.sun.xml.math',
852
+			'sxw'         => 'application/vnd.sun.xml.writer',
853
+			't'           => 'text/troff',
854
+			't3'          => 'application/x-t3vm-image',
855
+			'taglet'      => 'application/vnd.mynfc',
856
+			'tao'         => 'application/vnd.tao.intent-module-archive',
857
+			'tar'         => 'application/x-tar',
858
+			'tcap'        => 'application/vnd.3gpp2.tcap',
859
+			'tcl'         => 'application/x-tcl',
860
+			'teacher'     => 'application/vnd.smart.teacher',
861
+			'tei'         => 'application/tei+xml',
862
+			'teicorpus'   => 'application/tei+xml',
863
+			'tex'         => 'application/x-tex',
864
+			'texi'        => 'application/x-texinfo',
865
+			'texinfo'     => 'application/x-texinfo',
866
+			'text'        => 'text/plain',
867
+			'tfi'         => 'application/thraud+xml',
868
+			'tfm'         => 'application/x-tex-tfm',
869
+			'tga'         => 'image/x-tga',
870
+			'tgz'         => 'application/x-gzip',
871
+			'thmx'        => 'application/vnd.ms-officetheme',
872
+			'tif'         => 'image/tiff',
873
+			'tiff'        => 'image/tiff',
874
+			'tmo'         => 'application/vnd.tmobile-livetv',
875
+			'torrent'     => 'application/x-bittorrent',
876
+			'tpl'         => 'application/vnd.groove-tool-template',
877
+			'tpt'         => 'application/vnd.trid.tpt',
878
+			'tr'          => 'text/troff',
879
+			'tra'         => 'application/vnd.trueapp',
880
+			'trm'         => 'application/x-msterminal',
881
+			'tsd'         => 'application/timestamped-data',
882
+			'tsv'         => 'text/tab-separated-values',
883
+			'ttc'         => 'application/x-font-ttf',
884
+			'ttf'         => 'application/x-font-ttf',
885
+			'ttl'         => 'text/turtle',
886
+			'twd'         => 'application/vnd.simtech-mindmapper',
887
+			'twds'        => 'application/vnd.simtech-mindmapper',
888
+			'txd'         => 'application/vnd.genomatix.tuxedo',
889
+			'txf'         => 'application/vnd.mobius.txf',
890
+			'txt'         => 'text/plain',
891
+			'u32'         => 'application/x-authorware-bin',
892
+			'udeb'        => 'application/x-debian-package',
893
+			'ufd'         => 'application/vnd.ufdl',
894
+			'ufdl'        => 'application/vnd.ufdl',
895
+			'ulx'         => 'application/x-glulx',
896
+			'umj'         => 'application/vnd.umajin',
897
+			'unityweb'    => 'application/vnd.unity',
898
+			'uoml'        => 'application/vnd.uoml+xml',
899
+			'uri'         => 'text/uri-list',
900
+			'uris'        => 'text/uri-list',
901
+			'urls'        => 'text/uri-list',
902
+			'ustar'       => 'application/x-ustar',
903
+			'utz'         => 'application/vnd.uiq.theme',
904
+			'uu'          => 'text/x-uuencode',
905
+			'uva'         => 'audio/vnd.dece.audio',
906
+			'uvd'         => 'application/vnd.dece.data',
907
+			'uvf'         => 'application/vnd.dece.data',
908
+			'uvg'         => 'image/vnd.dece.graphic',
909
+			'uvh'         => 'video/vnd.dece.hd',
910
+			'uvi'         => 'image/vnd.dece.graphic',
911
+			'uvm'         => 'video/vnd.dece.mobile',
912
+			'uvp'         => 'video/vnd.dece.pd',
913
+			'uvs'         => 'video/vnd.dece.sd',
914
+			'uvt'         => 'application/vnd.dece.ttml+xml',
915
+			'uvu'         => 'video/vnd.uvvu.mp4',
916
+			'uvv'         => 'video/vnd.dece.video',
917
+			'uvva'        => 'audio/vnd.dece.audio',
918
+			'uvvd'        => 'application/vnd.dece.data',
919
+			'uvvf'        => 'application/vnd.dece.data',
920
+			'uvvg'        => 'image/vnd.dece.graphic',
921
+			'uvvh'        => 'video/vnd.dece.hd',
922
+			'uvvi'        => 'image/vnd.dece.graphic',
923
+			'uvvm'        => 'video/vnd.dece.mobile',
924
+			'uvvp'        => 'video/vnd.dece.pd',
925
+			'uvvs'        => 'video/vnd.dece.sd',
926
+			'uvvt'        => 'application/vnd.dece.ttml+xml',
927
+			'uvvu'        => 'video/vnd.uvvu.mp4',
928
+			'uvvv'        => 'video/vnd.dece.video',
929
+			'uvvx'        => 'application/vnd.dece.unspecified',
930
+			'uvvz'        => 'application/vnd.dece.zip',
931
+			'uvx'         => 'application/vnd.dece.unspecified',
932
+			'uvz'         => 'application/vnd.dece.zip',
933
+			'vcard'       => 'text/vcard',
934
+			'vcd'         => 'application/x-cdlink',
935
+			'vcf'         => 'text/x-vcard',
936
+			'vcg'         => 'application/vnd.groove-vcard',
937
+			'vcs'         => 'text/x-vcalendar',
938
+			'vcx'         => 'application/vnd.vcx',
939
+			'vis'         => 'application/vnd.visionary',
940
+			'viv'         => 'video/vnd.vivo',
941
+			'vob'         => 'video/x-ms-vob',
942
+			'vor'         => 'application/vnd.stardivision.writer',
943
+			'vox'         => 'application/x-authorware-bin',
944
+			'vrml'        => 'model/vrml',
945
+			'vsd'         => 'application/vnd.visio',
946
+			'vsf'         => 'application/vnd.vsf',
947
+			'vss'         => 'application/vnd.visio',
948
+			'vst'         => 'application/vnd.visio',
949
+			'vsw'         => 'application/vnd.visio',
950
+			'vtu'         => 'model/vnd.vtu',
951
+			'vxml'        => 'application/voicexml+xml',
952
+			'w3d'         => 'application/x-director',
953
+			'wad'         => 'application/x-doom',
954
+			'wav'         => 'audio/x-wav',
955
+			'wax'         => 'audio/x-ms-wax',
956
+			'wbmp'        => 'image/vnd.wap.wbmp',
957
+			'wbs'         => 'application/vnd.criticaltools.wbs+xml',
958
+			'wbxml'       => 'application/vnd.wap.wbxml',
959
+			'wcm'         => 'application/vnd.ms-works',
960
+			'wdb'         => 'application/vnd.ms-works',
961
+			'wdp'         => 'image/vnd.ms-photo',
962
+			'weba'        => 'audio/webm',
963
+			'webm'        => 'video/webm',
964
+			'webp'        => 'image/webp',
965
+			'wg'          => 'application/vnd.pmi.widget',
966
+			'wgt'         => 'application/widget',
967
+			'wks'         => 'application/vnd.ms-works',
968
+			'wm'          => 'video/x-ms-wm',
969
+			'wma'         => 'audio/x-ms-wma',
970
+			'wmd'         => 'application/x-ms-wmd',
971
+			'wmf'         => 'application/x-msmetafile',
972
+			'wml'         => 'text/vnd.wap.wml',
973
+			'wmlc'        => 'application/vnd.wap.wmlc',
974
+			'wmls'        => 'text/vnd.wap.wmlscript',
975
+			'wmlsc'       => 'application/vnd.wap.wmlscriptc',
976
+			'wmv'         => 'video/x-ms-wmv',
977
+			'wmx'         => 'video/x-ms-wmx',
978
+			'wmz'         => 'application/x-ms-wmz',
979
+			'woff'        => 'application/x-font-woff',
980
+			'wpd'         => 'application/vnd.wordperfect',
981
+			'wpl'         => 'application/vnd.ms-wpl',
982
+			'wps'         => 'application/vnd.ms-works',
983
+			'wqd'         => 'application/vnd.wqd',
984
+			'wri'         => 'application/x-mswrite',
985
+			'wrl'         => 'model/vrml',
986
+			'wsdl'        => 'application/wsdl+xml',
987
+			'wspolicy'    => 'application/wspolicy+xml',
988
+			'wtb'         => 'application/vnd.webturbo',
989
+			'wvx'         => 'video/x-ms-wvx',
990
+			'x32'         => 'application/x-authorware-bin',
991
+			'x3d'         => 'model/x3d+xml',
992
+			'x3db'        => 'model/x3d+binary',
993
+			'x3dbz'       => 'model/x3d+binary',
994
+			'x3dv'        => 'model/x3d+vrml',
995
+			'x3dvz'       => 'model/x3d+vrml',
996
+			'x3dz'        => 'model/x3d+xml',
997
+			'xaml'        => 'application/xaml+xml',
998
+			'xap'         => 'application/x-silverlight-app',
999
+			'xar'         => 'application/vnd.xara',
1000
+			'xbap'        => 'application/x-ms-xbap',
1001
+			'xbd'         => 'application/vnd.fujixerox.docuworks.binder',
1002
+			'xbm'         => 'image/x-xbitmap',
1003
+			'xdf'         => 'application/xcap-diff+xml',
1004
+			'xdm'         => 'application/vnd.syncml.dm+xml',
1005
+			'xdp'         => 'application/vnd.adobe.xdp+xml',
1006
+			'xdssc'       => 'application/dssc+xml',
1007
+			'xdw'         => 'application/vnd.fujixerox.docuworks',
1008
+			'xenc'        => 'application/xenc+xml',
1009
+			'xer'         => 'application/patch-ops-error+xml',
1010
+			'xfdf'        => 'application/vnd.adobe.xfdf',
1011
+			'xfdl'        => 'application/vnd.xfdl',
1012
+			'xht'         => 'application/xhtml+xml',
1013
+			'xhtml'       => 'application/xhtml+xml',
1014
+			'xhvml'       => 'application/xv+xml',
1015
+			'xif'         => 'image/vnd.xiff',
1016
+			'xla'         => 'application/vnd.ms-excel',
1017
+			'xlam'        => 'application/vnd.ms-excel.addin.macroenabled.12',
1018
+			'xlc'         => 'application/vnd.ms-excel',
1019
+			'xlf'         => 'application/x-xliff+xml',
1020
+			'xlm'         => 'application/vnd.ms-excel',
1021
+			'xls'         => 'application/vnd.ms-excel',
1022
+			'xlsb'        => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
1023
+			'xlsm'        => 'application/vnd.ms-excel.sheet.macroenabled.12',
1024
+			'xlsx'        => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
1025
+			'xlt'         => 'application/vnd.ms-excel',
1026
+			'xltm'        => 'application/vnd.ms-excel.template.macroenabled.12',
1027
+			'xltx'        => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
1028
+			'xlw'         => 'application/vnd.ms-excel',
1029
+			'xm'          => 'audio/xm',
1030
+			'xml'         => 'application/xml',
1031
+			'xo'          => 'application/vnd.olpc-sugar',
1032
+			'xop'         => 'application/xop+xml',
1033
+			'xpi'         => 'application/x-xpinstall',
1034
+			'xpl'         => 'application/xproc+xml',
1035
+			'xpm'         => 'image/x-xpixmap',
1036
+			'xpr'         => 'application/vnd.is-xpr',
1037
+			'xps'         => 'application/vnd.ms-xpsdocument',
1038
+			'xpw'         => 'application/vnd.intercon.formnet',
1039
+			'xpx'         => 'application/vnd.intercon.formnet',
1040
+			'xsl'         => 'application/xml',
1041
+			'xslt'        => 'application/xslt+xml',
1042
+			'xsm'         => 'application/vnd.syncml+xml',
1043
+			'xspf'        => 'application/xspf+xml',
1044
+			'xul'         => 'application/vnd.mozilla.xul+xml',
1045
+			'xvm'         => 'application/xv+xml',
1046
+			'xvml'        => 'application/xv+xml',
1047
+			'xwd'         => 'image/x-xwindowdump',
1048
+			'xyz'         => 'chemical/x-xyz',
1049
+			'xz'          => 'application/x-xz',
1050
+			'yaml'        => 'text/yaml',
1051
+			'yang'        => 'application/yang',
1052
+			'yin'         => 'application/yin+xml',
1053
+			'yml'         => 'text/yaml',
1054
+			'z'           => 'application/x-compress',
1055
+			'z1'          => 'application/x-zmachine',
1056
+			'z2'          => 'application/x-zmachine',
1057
+			'z3'          => 'application/x-zmachine',
1058
+			'z4'          => 'application/x-zmachine',
1059
+			'z5'          => 'application/x-zmachine',
1060
+			'z6'          => 'application/x-zmachine',
1061
+			'z7'          => 'application/x-zmachine',
1062
+			'z8'          => 'application/x-zmachine',
1063
+			'zaz'         => 'application/vnd.zzazz.deck+xml',
1064
+			'zip'         => 'application/zip',
1065
+			'zir'         => 'application/vnd.zul',
1066
+			'zirz'        => 'application/vnd.zul',
1067
+			'zmm'         => 'application/vnd.handheld-entertainment+xml',
1068
+			'123'         => 'application/vnd.lotus-1-2-3',
1069
+		);
1070
+	}
1071 1071
 
1072
-    /**
1073
-     * Get a singleton instance of the class
1074
-     *
1075
-     * @return self
1076
-     * @codeCoverageIgnore
1077
-     */
1078
-    public static function getInstance()
1079
-    {
1080
-        if (!self::$instance) {
1081
-            self::$instance = new self();
1082
-        }
1072
+	/**
1073
+	 * Get a singleton instance of the class
1074
+	 *
1075
+	 * @return self
1076
+	 * @codeCoverageIgnore
1077
+	 */
1078
+	public static function getInstance()
1079
+	{
1080
+		if (!self::$instance) {
1081
+			self::$instance = new self();
1082
+		}
1083 1083
 
1084
-        return self::$instance;
1085
-    }
1084
+		return self::$instance;
1085
+	}
1086 1086
 
1087
-    /**
1088
-     * Get a mimetype value from a file extension
1089
-     *
1090
-     * @param string $extension File extension
1091
-     *
1092
-     * @return string|null
1093
-     *
1094
-     */
1095
-    public function fromExtension($extension)
1096
-    {
1097
-        $mimetypes = $this->getMimeTypes();
1098
-        return isset($mimetypes[$extension]) ? $mimetypes[$extension] : null;
1099
-    }
1087
+	/**
1088
+	 * Get a mimetype value from a file extension
1089
+	 *
1090
+	 * @param string $extension File extension
1091
+	 *
1092
+	 * @return string|null
1093
+	 *
1094
+	 */
1095
+	public function fromExtension($extension)
1096
+	{
1097
+		$mimetypes = $this->getMimeTypes();
1098
+		return isset($mimetypes[$extension]) ? $mimetypes[$extension] : null;
1099
+	}
1100 1100
 
1101
-    /**
1102
-     * Get a mimetype from a filename
1103
-     *
1104
-     * @param string $filename Filename to generate a mimetype from
1105
-     *
1106
-     * @return string|null
1107
-     */
1108
-    public function fromFilename($filename)
1109
-    {
1110
-        return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION));
1111
-    }
1101
+	/**
1102
+	 * Get a mimetype from a filename
1103
+	 *
1104
+	 * @param string $filename Filename to generate a mimetype from
1105
+	 *
1106
+	 * @return string|null
1107
+	 */
1108
+	public function fromFilename($filename)
1109
+	{
1110
+		return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION));
1111
+	}
1112 1112
 }
1113 1113
\ No newline at end of file
Please login to merge, or discard this patch.
libs/download.php 2 patches
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -5,109 +5,109 @@
 block discarded – undo
5 5
 use InvalidArgumentException;
6 6
 class download {
7 7
 
8
-    /**
9
-     * File directory
10
-     * @var string
11
-     */
12
-    protected $directory;
13
-
14
-    /**
15
-     * File name
16
-     * @var string
17
-     */
18
-    protected $filename;
19
-
20
-    /**
21
-     * File pointer
22
-     * @var resource
23
-     */
24
-    protected $file;
25
-
26
-    /**
27
-     * File full path
28
-     * @var string
29
-     */
30
-    protected $full_path;
31
-
32
-    /**
33
-     * @param string $phpbb_root_path phpBB root path
34
-     */
35
-    public function __construct($phpbb_root_path) {
36
-        $this->directory = $phpbb_root_path . 'store/messenger/files';
37
-    }
38
-
39
-
40
-    /**
41
-     * Set the filename
42
-     * @param string $filename File name
43
-     * @throws InvalidArgumentException when the file not exist or is not readable
44
-     */
45
-    public function setFile($filename) {
46
-        $file_full_path = $this->directory . '/'. $filename;
47
-        if(!is_file($file_full_path)) {
48
-            throw new InvalidArgumentException("File does not exist");
49
-        } else if(!is_readable($file_full_path)) {
50
-            throw new InvalidArgumentException("File to download is not readable.");
51
-        }
52
-        $this->filename = $filename;
53
-        $this->file = fopen($file_full_path, 'rb');
54
-        $this->full_path = $file_full_path;
55
-    }
56
-
57
-    /**
58
-     * Get file mime type
59
-     * @return string
60
-     */
61
-    private function getMimeType() {
62
-        $fileExtension = pathinfo($this->filename, PATHINFO_EXTENSION);
63
-        $mimeTypeHelper = Mimetypes::getInstance();
64
-        $mimeType = $mimeTypeHelper->fromExtension($fileExtension);
65
-
66
-        return !is_null($mimeType) ? $mimeType : 'application/force-download';
67
-    }
68
-
69
-    /**
70
-     * Get file size
71
-     * @return int
72
-     */
73
-    private function getFileSize() {
74
-        $stat = fstat($this->file);
75
-        return $stat['size'];
76
-    }
77
-
78
-    /**
79
-     * Sends the download to browser
80
-     * @param bool|true $forceDownload
81
-     */
82
-    public function sendDownload($forceDownload = true) {
83
-        if(headers_sent()) {
84
-            throw new \RuntimeException("Cannot send file to the browser, since the headers were already sent");
85
-        }
86
-        $mimeType = $this->getMimeType();
87
-        $fileSize = $this->getFileSize();
88
-
89
-        ini_set('display_errors', 1);
90
-        error_reporting(E_ALL);
91
-
92
-        header("Pragma: public");
93
-        header("Expires: 0");
94
-        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
95
-        header("Cache-Control: private", false);
96
-        header("Content-Type: application/octet-stream");
97
-
98
-        if($forceDownload) {
99
-            header("Content-Disposition: attachment; filename=\"{$this->filename}\";");
100
-        } else {
101
-            header("Content-Disposition: filename=\"{$this->filename}\";");
102
-        }
103
-
104
-        header("Content-Transfer-Encoding: binary");
105
-        header("Content-Length: {$fileSize}");
106
-
107
-        @ob_clean();
108
-
109
-        rewind($this->file);
110
-        fpassthru($this->file);
111
-    }
8
+	/**
9
+	 * File directory
10
+	 * @var string
11
+	 */
12
+	protected $directory;
13
+
14
+	/**
15
+	 * File name
16
+	 * @var string
17
+	 */
18
+	protected $filename;
19
+
20
+	/**
21
+	 * File pointer
22
+	 * @var resource
23
+	 */
24
+	protected $file;
25
+
26
+	/**
27
+	 * File full path
28
+	 * @var string
29
+	 */
30
+	protected $full_path;
31
+
32
+	/**
33
+	 * @param string $phpbb_root_path phpBB root path
34
+	 */
35
+	public function __construct($phpbb_root_path) {
36
+		$this->directory = $phpbb_root_path . 'store/messenger/files';
37
+	}
38
+
39
+
40
+	/**
41
+	 * Set the filename
42
+	 * @param string $filename File name
43
+	 * @throws InvalidArgumentException when the file not exist or is not readable
44
+	 */
45
+	public function setFile($filename) {
46
+		$file_full_path = $this->directory . '/'. $filename;
47
+		if(!is_file($file_full_path)) {
48
+			throw new InvalidArgumentException("File does not exist");
49
+		} else if(!is_readable($file_full_path)) {
50
+			throw new InvalidArgumentException("File to download is not readable.");
51
+		}
52
+		$this->filename = $filename;
53
+		$this->file = fopen($file_full_path, 'rb');
54
+		$this->full_path = $file_full_path;
55
+	}
56
+
57
+	/**
58
+	 * Get file mime type
59
+	 * @return string
60
+	 */
61
+	private function getMimeType() {
62
+		$fileExtension = pathinfo($this->filename, PATHINFO_EXTENSION);
63
+		$mimeTypeHelper = Mimetypes::getInstance();
64
+		$mimeType = $mimeTypeHelper->fromExtension($fileExtension);
65
+
66
+		return !is_null($mimeType) ? $mimeType : 'application/force-download';
67
+	}
68
+
69
+	/**
70
+	 * Get file size
71
+	 * @return int
72
+	 */
73
+	private function getFileSize() {
74
+		$stat = fstat($this->file);
75
+		return $stat['size'];
76
+	}
77
+
78
+	/**
79
+	 * Sends the download to browser
80
+	 * @param bool|true $forceDownload
81
+	 */
82
+	public function sendDownload($forceDownload = true) {
83
+		if(headers_sent()) {
84
+			throw new \RuntimeException("Cannot send file to the browser, since the headers were already sent");
85
+		}
86
+		$mimeType = $this->getMimeType();
87
+		$fileSize = $this->getFileSize();
88
+
89
+		ini_set('display_errors', 1);
90
+		error_reporting(E_ALL);
91
+
92
+		header("Pragma: public");
93
+		header("Expires: 0");
94
+		header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
95
+		header("Cache-Control: private", false);
96
+		header("Content-Type: application/octet-stream");
97
+
98
+		if($forceDownload) {
99
+			header("Content-Disposition: attachment; filename=\"{$this->filename}\";");
100
+		} else {
101
+			header("Content-Disposition: filename=\"{$this->filename}\";");
102
+		}
103
+
104
+		header("Content-Transfer-Encoding: binary");
105
+		header("Content-Length: {$fileSize}");
106
+
107
+		@ob_clean();
108
+
109
+		rewind($this->file);
110
+		fpassthru($this->file);
111
+	}
112 112
 
113 113
 }
114 114
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @param string $phpbb_root_path phpBB root path
34 34
      */
35 35
     public function __construct($phpbb_root_path) {
36
-        $this->directory = $phpbb_root_path . 'store/messenger/files';
36
+        $this->directory = $phpbb_root_path.'store/messenger/files';
37 37
     }
38 38
 
39 39
 
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
      * @throws InvalidArgumentException when the file not exist or is not readable
44 44
      */
45 45
     public function setFile($filename) {
46
-        $file_full_path = $this->directory . '/'. $filename;
47
-        if(!is_file($file_full_path)) {
46
+        $file_full_path = $this->directory.'/'.$filename;
47
+        if (!is_file($file_full_path)) {
48 48
             throw new InvalidArgumentException("File does not exist");
49
-        } else if(!is_readable($file_full_path)) {
49
+        } else if (!is_readable($file_full_path)) {
50 50
             throw new InvalidArgumentException("File to download is not readable.");
51 51
         }
52 52
         $this->filename = $filename;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      * @param bool|true $forceDownload
81 81
      */
82 82
     public function sendDownload($forceDownload = true) {
83
-        if(headers_sent()) {
83
+        if (headers_sent()) {
84 84
             throw new \RuntimeException("Cannot send file to the browser, since the headers were already sent");
85 85
         }
86 86
         $mimeType = $this->getMimeType();
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         header("Cache-Control: private", false);
96 96
         header("Content-Type: application/octet-stream");
97 97
 
98
-        if($forceDownload) {
98
+        if ($forceDownload) {
99 99
             header("Content-Disposition: attachment; filename=\"{$this->filename}\";");
100 100
         } else {
101 101
             header("Content-Disposition: filename=\"{$this->filename}\";");
Please login to merge, or discard this patch.
controller/main.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
         }
220 220
 
221 221
         $friends = $this->model->getFriends();
222
-        $friends_online = array_filter($friends, function ($friend) {
222
+        $friends_online = array_filter($friends, function($friend) {
223 223
             return $friend['user_status'] != 0;
224 224
         });
225 225
 
Please login to merge, or discard this patch.
Indentation   +182 added lines, -182 removed lines patch added patch discarded remove patch
@@ -15,187 +15,187 @@
 block discarded – undo
15 15
 class main
16 16
 {
17 17
 
18
-    protected $user;
19
-    protected $model;
20
-    protected $request;
21
-    protected $notification_manager;
22
-    protected $upload;
23
-    protected $download;
24
-
25
-    public function __construct(
26
-        request $request,
27
-        user $user,
28
-        main_model $model,
29
-        manager $notification_manager,
30
-        upload $upload,
31
-        download $download
32
-    )
33
-    {
34
-        $this->request = $request;
35
-        $this->user = $user;
36
-        $this->model = $model;
37
-        $this->notification_manager = $notification_manager;
38
-        $this->upload = $upload;
39
-        $this->download = $download;
40
-    }
41
-
42
-    public function handle()
43
-    {
44
-    }
45
-
46
-    public function index()
47
-    {
48
-
49
-    }
50
-
51
-    public function publish()
52
-    {
53
-        $text = $this->request->variable('text', '', true);
54
-        $receiver_id = $this->request->variable('receiver_id', 0);
55
-        $sender_id = $this->user->data['user_id'];
56
-
57
-        $response = array();
58
-        if ($receiver_id != 0 && trim($text) != '') {
59
-            $text = htmlspecialchars($text);
60
-            $text = str_replace(array("\n", "\r"), '', $text);
61
-
62
-            $message = array(
63
-                'sender_id' => $sender_id,
64
-                'receiver_id' => $receiver_id,
65
-                'text' => $text,
66
-                'sentAt' => time()
67
-            );
68
-
69
-            if ($id = $this->model->sendMessage($message)) {
70
-                $lastMessage = $this->model->getMessageById($id);
71
-                $response = array('success' => true, 'message' => $lastMessage);
72
-            } else {
73
-                $response = array(
74
-                    'succes' => false,
75
-                    'error' => 'An error has been ocurred!'
76
-                );
77
-            }
78
-        }
79
-
80
-        return new JsonResponse($response, 200);
81
-    }
82
-
83
-    public function getFile($id)
84
-    {
85
-        $id = explode('_', $id)[1];
86
-        $file = $this->model->getFileById($id);
87
-        $this->download->setFile($file['file']);
88
-        $this->download->sendDownload();
89
-    }
90
-
91
-    public function sendFile()
92
-    {
93
-        $receiver_id = $this->request->variable('receiver_id', 0);
94
-        $sender_id = $this->user->data['user_id'];
95
-
96
-        $response = array();
97
-        $file = $this->request->file('file');
98
-        if ($receiver_id != 0 && !empty($file)) {
99
-            if ($file['error'] == 0) {
100
-                $this->upload->file($file);
101
-                $this->upload->set_allowed_mime_types(array(
102
-                    'image/gif',
103
-                    'image/jpeg',
104
-                    'image/png',
105
-                    'application/pdf',
106
-                    'application/x-rar-compressed',
107
-                    'application/zip',
108
-                    'application/x-7z-compressed',
109
-                    'text/plain'
110
-                ));
111
-                $results = $this->upload->upload();
112
-                if (isset($results['errors']) && count($results['errors'])) {
113
-                    $response = array(
114
-                        'success' => false,
115
-                        'errors' => $results['errors']
116
-                    );
117
-                } else {
118
-                    $data = array(
119
-                        'sender_id' => $sender_id,
120
-                        'receiver_id' => $receiver_id,
121
-                        'fileName' => $results['original_filename'],
122
-                        'file' => $results['filename'],
123
-                        'type' => $results['mime'],
124
-                    );
125
-                    if ($id = $this->model->sendFile($data)) {
126
-                        $lastFile = $this->model->getFileById($id);
127
-                        $response = array(
128
-                            'success' => true,
129
-                            'file' => $lastFile
130
-                        );
131
-                    } else {
132
-                        $response = array(
133
-                            'succes' => false,
134
-                            'error' => 'An error has been ocurred!'
135
-                        );
136
-                    }
137
-                }
138
-            } else {
139
-                $response = array(
140
-                    'succes' => false,
141
-                    'error' => $file['error']
142
-                );
143
-            }
144
-        }
145
-
146
-        return new JsonResponse($response, 200);
147
-    }
148
-
149
-    public function load()
150
-    {
151
-        $friend_id = $this->request->variable('friend_id', 0);
152
-
153
-        if ($friend_id > 0) {
154
-            $messages = $this->model->getMessages($friend_id);
155
-            return new JsonResponse($messages, 200);
156
-        }
157
-        return new JsonResponse(array('success' => false, 'error' => 'The request is invalid'), 200);
158
-    }
159
-
160
-    public function updateMessages()
161
-    {
162
-        $friend_id = $this->request->variable('friend_id', 0);
163
-        if ($friend_id > 0) {
164
-            $newVal = $this->model->updateMessagesStatus($friend_id);
165
-            return new JsonResponse(array('success' => true, 'newVal' => $newVal), 200);
166
-        }
167
-        return new JsonResponse(array('success' => false), 200);
168
-    }
169
-
170
-    public function checkForNewMessages()
171
-    {
172
-        $friend_id = $this->request->variable('friend_id', 0);
173
-        if ($friend_id > 0) {
174
-            $messages = $this->model->getInboxFromId($friend_id);
175
-            return new JsonResponse(array('success' => true, 'messages' => $messages), 200);
176
-        }
177
-        return new JsonResponse(array('success' => false), 200);
178
-    }
179
-
180
-    public function getFriends()
181
-    {
182
-        $friends = $this->model->getFriends();
183
-        $friends_online = array_filter($friends, function ($friend) {
184
-            return $friend['user_status'] != 0;
185
-        });
186
-
187
-        $response = array(
188
-            'friends_online' => count($friends_online),
189
-            'friends_list' => $friends
190
-        );
191
-
192
-        return new JsonResponse($response, 200);
193
-    }
194
-
195
-    public function getEmoticons()
196
-    {
197
-        $response = array();
198
-        return new JsonResponse($response, 200);
199
-    }
18
+	protected $user;
19
+	protected $model;
20
+	protected $request;
21
+	protected $notification_manager;
22
+	protected $upload;
23
+	protected $download;
24
+
25
+	public function __construct(
26
+		request $request,
27
+		user $user,
28
+		main_model $model,
29
+		manager $notification_manager,
30
+		upload $upload,
31
+		download $download
32
+	)
33
+	{
34
+		$this->request = $request;
35
+		$this->user = $user;
36
+		$this->model = $model;
37
+		$this->notification_manager = $notification_manager;
38
+		$this->upload = $upload;
39
+		$this->download = $download;
40
+	}
41
+
42
+	public function handle()
43
+	{
44
+	}
45
+
46
+	public function index()
47
+	{
48
+
49
+	}
50
+
51
+	public function publish()
52
+	{
53
+		$text = $this->request->variable('text', '', true);
54
+		$receiver_id = $this->request->variable('receiver_id', 0);
55
+		$sender_id = $this->user->data['user_id'];
56
+
57
+		$response = array();
58
+		if ($receiver_id != 0 && trim($text) != '') {
59
+			$text = htmlspecialchars($text);
60
+			$text = str_replace(array("\n", "\r"), '', $text);
61
+
62
+			$message = array(
63
+				'sender_id' => $sender_id,
64
+				'receiver_id' => $receiver_id,
65
+				'text' => $text,
66
+				'sentAt' => time()
67
+			);
68
+
69
+			if ($id = $this->model->sendMessage($message)) {
70
+				$lastMessage = $this->model->getMessageById($id);
71
+				$response = array('success' => true, 'message' => $lastMessage);
72
+			} else {
73
+				$response = array(
74
+					'succes' => false,
75
+					'error' => 'An error has been ocurred!'
76
+				);
77
+			}
78
+		}
79
+
80
+		return new JsonResponse($response, 200);
81
+	}
82
+
83
+	public function getFile($id)
84
+	{
85
+		$id = explode('_', $id)[1];
86
+		$file = $this->model->getFileById($id);
87
+		$this->download->setFile($file['file']);
88
+		$this->download->sendDownload();
89
+	}
90
+
91
+	public function sendFile()
92
+	{
93
+		$receiver_id = $this->request->variable('receiver_id', 0);
94
+		$sender_id = $this->user->data['user_id'];
95
+
96
+		$response = array();
97
+		$file = $this->request->file('file');
98
+		if ($receiver_id != 0 && !empty($file)) {
99
+			if ($file['error'] == 0) {
100
+				$this->upload->file($file);
101
+				$this->upload->set_allowed_mime_types(array(
102
+					'image/gif',
103
+					'image/jpeg',
104
+					'image/png',
105
+					'application/pdf',
106
+					'application/x-rar-compressed',
107
+					'application/zip',
108
+					'application/x-7z-compressed',
109
+					'text/plain'
110
+				));
111
+				$results = $this->upload->upload();
112
+				if (isset($results['errors']) && count($results['errors'])) {
113
+					$response = array(
114
+						'success' => false,
115
+						'errors' => $results['errors']
116
+					);
117
+				} else {
118
+					$data = array(
119
+						'sender_id' => $sender_id,
120
+						'receiver_id' => $receiver_id,
121
+						'fileName' => $results['original_filename'],
122
+						'file' => $results['filename'],
123
+						'type' => $results['mime'],
124
+					);
125
+					if ($id = $this->model->sendFile($data)) {
126
+						$lastFile = $this->model->getFileById($id);
127
+						$response = array(
128
+							'success' => true,
129
+							'file' => $lastFile
130
+						);
131
+					} else {
132
+						$response = array(
133
+							'succes' => false,
134
+							'error' => 'An error has been ocurred!'
135
+						);
136
+					}
137
+				}
138
+			} else {
139
+				$response = array(
140
+					'succes' => false,
141
+					'error' => $file['error']
142
+				);
143
+			}
144
+		}
145
+
146
+		return new JsonResponse($response, 200);
147
+	}
148
+
149
+	public function load()
150
+	{
151
+		$friend_id = $this->request->variable('friend_id', 0);
152
+
153
+		if ($friend_id > 0) {
154
+			$messages = $this->model->getMessages($friend_id);
155
+			return new JsonResponse($messages, 200);
156
+		}
157
+		return new JsonResponse(array('success' => false, 'error' => 'The request is invalid'), 200);
158
+	}
159
+
160
+	public function updateMessages()
161
+	{
162
+		$friend_id = $this->request->variable('friend_id', 0);
163
+		if ($friend_id > 0) {
164
+			$newVal = $this->model->updateMessagesStatus($friend_id);
165
+			return new JsonResponse(array('success' => true, 'newVal' => $newVal), 200);
166
+		}
167
+		return new JsonResponse(array('success' => false), 200);
168
+	}
169
+
170
+	public function checkForNewMessages()
171
+	{
172
+		$friend_id = $this->request->variable('friend_id', 0);
173
+		if ($friend_id > 0) {
174
+			$messages = $this->model->getInboxFromId($friend_id);
175
+			return new JsonResponse(array('success' => true, 'messages' => $messages), 200);
176
+		}
177
+		return new JsonResponse(array('success' => false), 200);
178
+	}
179
+
180
+	public function getFriends()
181
+	{
182
+		$friends = $this->model->getFriends();
183
+		$friends_online = array_filter($friends, function ($friend) {
184
+			return $friend['user_status'] != 0;
185
+		});
186
+
187
+		$response = array(
188
+			'friends_online' => count($friends_online),
189
+			'friends_list' => $friends
190
+		);
191
+
192
+		return new JsonResponse($response, 200);
193
+	}
194
+
195
+	public function getEmoticons()
196
+	{
197
+		$response = array();
198
+		return new JsonResponse($response, 200);
199
+	}
200 200
 
201 201
 }
Please login to merge, or discard this patch.