PHP Classes

File: bin/update.php

Recommend this page to a friend!
  Classes of Eric Sizemore   mimey PHP MIME Type Conversion   bin/update.php   Download  
File: bin/update.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: mimey PHP MIME Type Conversion
Convert between file extensions and MIME types
Author: By
Last change: adding psalm to workflow, fixes/updates throughout
Date: 25 days ago
Size: 460 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?php

declare(strict_types=1);

$updateUrl = 'https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types';
$destinationFile = \dirname(__DIR__) . '/data/mime.types';

$mimeTypes = \file_get_contents($updateUrl);

\
assert($mimeTypes !== false);

\
file_put_contents($destinationFile, $mimeTypes);

echo \
sprintf("Downloaded mime.types from '%s' and stored at '%s'", $updateUrl, $destinationFile) . \PHP_EOL;
echo \
PHP_EOL;