Update mime types script

This commit is contained in:
Giuseppe Criscione 2024-11-29 22:27:39 +01:00
parent c942d97b43
commit 86f109c0ba
2 changed files with 5 additions and 4 deletions

View File

@ -24,7 +24,7 @@ class MimeType
/**
* Extension to MIME type mapping
*
* Last updated: 2024-11-09
* Last updated: 2024-11-29
*
* @see scripts/update-mime-types.php To update this list
*
@ -1179,6 +1179,7 @@ class MimeType
'vcs' => 'text/x-vcalendar',
'vcf' => 'text/x-vcard',
'yaml' => 'text/yaml',
'yml' => 'text/yaml',
'3gp' => 'video/3gpp',
'3g2' => 'video/3gpp2',
'h261' => 'video/h261',

View File

@ -23,7 +23,7 @@ $extensions = [
'image/tiff' => ['tiff', 'tif'],
'text/html' => ['html', 'htm'],
'text/markdown' => ['md', 'markdown'],
'text/yaml' => ['yaml', 'yaml'],
'text/yaml' => ['yaml', 'yml'],
];
foreach ($json as $mimeType => $data) {
@ -69,10 +69,10 @@ if ($content === false) {
$content = preg_replace([
'/Last updated: \d{4}-\d{2}-\d{2}\n/',
'/protected const MIME_TYPES = \[.*?\];/s',
'/protected const array MIME_TYPES = \[.*?\];/s',
], [
sprintf("Last updated: %s\n", date('Y-m-d')),
sprintf("protected const MIME_TYPES = [\n%s\n ];", implode("\n", $lines)),
sprintf("protected const array MIME_TYPES = [\n%s\n ];", implode("\n", $lines)),
], $content);
file_put_contents($file, $content);