| @@ 17-37 (lines=21) @@ | ||
| 14 | /** |
|
| 15 | * Type mapping provider for audio filetypes. |
|
| 16 | */ |
|
| 17 | class AudioTypeMap implements TypeMapInterface |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * {@inheritdoc} |
|
| 21 | * |
|
| 22 | * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types |
|
| 23 | * @see https://www.loc.gov/preservation/digital/formats/fdd/fdd000198.shtml#sign |
|
| 24 | */ |
|
| 25 | public function getMap() |
|
| 26 | { |
|
| 27 | return [ |
|
| 28 | new Type(['aac'], 'audio/aac'), |
|
| 29 | new Type(['flac', 'fla'], 'audio/flac'), |
|
| 30 | new Type(['mid', 'midi'], 'audio/midi'), |
|
| 31 | new Type(['mp3'], 'audio/mpeg'), |
|
| 32 | new Type(['oga'], 'audio/ogg'), |
|
| 33 | new Type(['wav'], 'audio/x-wav'), |
|
| 34 | new Type(['weba'], 'audio/webm'), |
|
| 35 | ]; |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| @@ 17-40 (lines=24) @@ | ||
| 14 | /** |
|
| 15 | * Type mapping provider for general document filetypes. |
|
| 16 | */ |
|
| 17 | class DocumentTypeMap implements TypeMapInterface |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * {@inheritdoc} |
|
| 21 | * |
|
| 22 | * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types |
|
| 23 | * @see https://tools.ietf.org/html/rfc7763 |
|
| 24 | * @see https://www.iana.org/assignments/media-types/application/pdf |
|
| 25 | * @see http://docutils.sourceforge.net/FAQ.html |
|
| 26 | * @see https://www.thoughtco.com/mime-types-by-content-type-3469108 |
|
| 27 | */ |
|
| 28 | public function getMap() |
|
| 29 | { |
|
| 30 | return [ |
|
| 31 | new Type(['md'], 'text/markdown'), |
|
| 32 | new Type(['pdf'], 'application/pdf'), |
|
| 33 | new Type(['ps', 'eps'], 'application/postscript'), |
|
| 34 | new Type(['rst'], 'text/x-rst'), |
|
| 35 | new Type(['rtf'], 'application/rtf'), |
|
| 36 | new Type(['tex'], 'text/x-tex'), |
|
| 37 | new Type(['txt'], 'text/plain'), |
|
| 38 | ]; |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 17-36 (lines=20) @@ | ||
| 14 | /** |
|
| 15 | * Type mapping provider for video filetypes. |
|
| 16 | */ |
|
| 17 | class VideoTypeMap implements TypeMapInterface |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * {@inheritdoc} |
|
| 21 | * |
|
| 22 | * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types |
|
| 23 | */ |
|
| 24 | public function getMap() |
|
| 25 | { |
|
| 26 | return [ |
|
| 27 | new Type(['3gp'], 'video/3gpp'), |
|
| 28 | new Type(['3gp2'], 'video/3gpp2'), |
|
| 29 | new Type(['avi'], 'video/x-msvideo'), |
|
| 30 | new Type(['mp4'], 'video/mp4'), |
|
| 31 | new Type(['mpg', 'mpeg'], 'video/mpeg'), |
|
| 32 | new Type(['ogv'], 'video/ogg'), |
|
| 33 | new Type(['webm'], 'video/webm'), |
|
| 34 | ]; |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||