From 86f109c0baf3518d6190d31e3dc2f8daf16b2a44 Mon Sep 17 00:00:00 2001 From: Giuseppe Criscione <18699708+giuscris@users.noreply.github.com> Date: Fri, 29 Nov 2024 22:27:39 +0100 Subject: [PATCH] Update mime types script --- formwork/src/Utils/MimeType.php | 3 ++- formwork/src/Utils/scripts/update-mime-types.php | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/formwork/src/Utils/MimeType.php b/formwork/src/Utils/MimeType.php index 97449414..12cde579 100644 --- a/formwork/src/Utils/MimeType.php +++ b/formwork/src/Utils/MimeType.php @@ -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', diff --git a/formwork/src/Utils/scripts/update-mime-types.php b/formwork/src/Utils/scripts/update-mime-types.php index 65c0866c..10ae00f7 100644 --- a/formwork/src/Utils/scripts/update-mime-types.php +++ b/formwork/src/Utils/scripts/update-mime-types.php @@ -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);