xref: /webtrees/app/Mime.php (revision 0b9cdb5b9ca2ecf6c9ffe23bfcae2cd78d9b5e96)
1e7f16b43SGreg Roach<?php
2e7f16b43SGreg Roach
3e7f16b43SGreg Roach/**
4e7f16b43SGreg Roach * webtrees: online genealogy
55bfc6897SGreg Roach * Copyright (C) 2022 webtrees development team
6e7f16b43SGreg Roach * This program is free software: you can redistribute it and/or modify
7e7f16b43SGreg Roach * it under the terms of the GNU General Public License as published by
8e7f16b43SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9e7f16b43SGreg Roach * (at your option) any later version.
10e7f16b43SGreg Roach * This program is distributed in the hope that it will be useful,
11e7f16b43SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12e7f16b43SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13e7f16b43SGreg Roach * GNU General Public License for more details.
14e7f16b43SGreg Roach * You should have received a copy of the GNU General Public License
1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16e7f16b43SGreg Roach */
17e7f16b43SGreg Roach
18e7f16b43SGreg Roachdeclare(strict_types=1);
19e7f16b43SGreg Roach
20e7f16b43SGreg Roachnamespace Fisharebest\Webtrees;
21e7f16b43SGreg Roach
22e7f16b43SGreg Roach/**
23e7f16b43SGreg Roach * A list of known or supported mime types
24e7f16b43SGreg Roach */
25e7f16b43SGreg Roachclass Mime
26e7f16b43SGreg Roach{
27e7f16b43SGreg Roach    public const DEFAULT_TYPE = 'application/octet-stream';
28e7f16b43SGreg Roach
29e7f16b43SGreg Roach    // Convert extension to mime-type
30e7f16b43SGreg Roach    public const TYPES = [
310ea5fc1cSGreg Roach        'BMP'  => 'image/bmp',
320ea5fc1cSGreg Roach        'CSS'  => 'text/css',
330ea5fc1cSGreg Roach        'DOC'  => 'application/msword',
340ea5fc1cSGreg Roach        'DOCX' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
350ea5fc1cSGreg Roach        'GED'  => 'text/vnd.familysearch.gedcom',
360ea5fc1cSGreg Roach        'GIF'  => 'image/gif',
370ea5fc1cSGreg Roach        'FLAC' => 'audio/flac',
380ea5fc1cSGreg Roach        'HEIF' => 'image/heif',
390ea5fc1cSGreg Roach        'HTM'  => 'text/html',
400ea5fc1cSGreg Roach        'HTML' => 'text/html',
410ea5fc1cSGreg Roach        'ICO'  => 'image/x-icon',
420ea5fc1cSGreg Roach        'JPE'  => 'image/jpeg',
430ea5fc1cSGreg Roach        'JPEG' => 'image/jpeg',
440ea5fc1cSGreg Roach        'JPG'  => 'image/jpeg',
450ea5fc1cSGreg Roach        'JS'   => 'application/javascript',
460ea5fc1cSGreg Roach        'JSON' => 'application/json',
470ea5fc1cSGreg Roach        'MOV'  => 'video/quicktime',
48*0b9cdb5bSGreg Roach        'M4V'  => 'video/mp4',
49*0b9cdb5bSGreg Roach        'MKV'  => 'video/x-matroska',
500ea5fc1cSGreg Roach        'MP3'  => 'audio/mpeg',
510ea5fc1cSGreg Roach        'MP4'  => 'video/mp4',
520ea5fc1cSGreg Roach        'OGA'  => 'audio/ogg',
530ea5fc1cSGreg Roach        'OGG'  => 'audio/ogg',
540ea5fc1cSGreg Roach        'OGV'  => 'video/ogg',
550ea5fc1cSGreg Roach        'PDF'  => 'application/pdf',
560ea5fc1cSGreg Roach        'PNG'  => 'image/png',
570ea5fc1cSGreg Roach        'RAR'  => 'application/x-rar-compressed',
580ea5fc1cSGreg Roach        'SVG'  => 'image/svg+xml',
590ea5fc1cSGreg Roach        'TIF'  => 'image/tiff',
600ea5fc1cSGreg Roach        'TIFF' => 'image/tiff',
610ea5fc1cSGreg Roach        'TXT'  => 'text/plain',
62*0b9cdb5bSGreg Roach        'WEBM' => 'video/webm',
630ea5fc1cSGreg Roach        'WEBP' => 'image/webp',
640ea5fc1cSGreg Roach        'WMV'  => 'video/x-ms-wmv',
650ea5fc1cSGreg Roach        'XLS'  => 'application/vnd-ms-excel',
660ea5fc1cSGreg Roach        'XLSX' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
670ea5fc1cSGreg Roach        'XML'  => 'application/xml',
680ea5fc1cSGreg Roach        'ZIP'  => 'application/zip',
69e7f16b43SGreg Roach    ];
70e7f16b43SGreg Roach}
71