summaryrefslogtreecommitdiff
path: root/src/application/fetch-mime-types.php
diff options
context:
space:
mode:
authorJonas Kohl2024-09-13 19:57:43 +0200
committerJonas Kohl2024-09-13 19:57:43 +0200
commit93817fef3ead7cfd4fcde25ea2bcec02d01310a4 (patch)
tree60f6ab69bbf2360d7cc518023090b8bf61bfd5b1 /src/application/fetch-mime-types.php
parent086e2d2668784469ec114f6e6fd2b3dace3d7c3b (diff)
A lot of changes again
Diffstat (limited to 'src/application/fetch-mime-types.php')
-rw-r--r--src/application/fetch-mime-types.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/application/fetch-mime-types.php b/src/application/fetch-mime-types.php
new file mode 100644
index 0000000..2e49726
--- /dev/null
+++ b/src/application/fetch-mime-types.php
@@ -0,0 +1,22 @@
+<?php
+
+if (PHP_SAPI !== "cli") {
+ http_response_code(400);
+ echo "This script must be run from the command line";
+ exit;
+}
+
+$input = "https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types";
+$output = __DIR__ . "/assets/mimetypes";
+
+$hInput = fopen($input, "r") or die("Failed to open input file");
+$hOutput = fopen($output, "w") or die("Failed to open output file");
+
+while (($ln = fgets($hInput)) !== false) {
+ if (strpos($ln, "#") === 0)
+ continue;
+ fputs($hOutput, $ln);
+}
+
+fclose($hInput);
+fclose($hOutput);