summaryrefslogtreecommitdiff
path: root/src/functions.php
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-11-12 11:16:56 +0100
committerDaniel Weipert <code@drogueronin.de>2023-11-20 17:30:04 +0100
commit6df3d321d9b67c4541f50158b087d37c4b22e886 (patch)
tree06031988bb4b957b76f051af366ced448a48545f /src/functions.php
initial commit
Diffstat (limited to 'src/functions.php')
-rw-r--r--src/functions.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/functions.php b/src/functions.php
new file mode 100644
index 0000000..f8be759
--- /dev/null
+++ b/src/functions.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace GeminiFoundation;
+
+function mime_content_type(string $filePath): string
+{
+ $pathinfo = pathinfo($filePath);
+
+ if ($pathinfo['extension'] === 'gmi') {
+ return 'text/gemini';
+ }
+
+ return \mime_content_type($filePath) ?: '';
+}