summaryrefslogtreecommitdiff
path: root/src/application/fetch-mime-types.php
blob: 2e49726c2bcaeef53c6d15ad43f37f9b77347f3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);