retro/mime.php

26 lines
425 B
PHP
Raw Permalink Normal View History

<?php
// https://github.com/EmulatorJS/EmulatorJS/blob/main/index.html
declare(strict_types=1);
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\Mime\MimeTypes;
$mime = new MimeTypes();
foreach ($argv as $i => $arg) {
if (!$i) {
continue;
}
$types = $mime->getMimeTypes($arg);
foreach ($types as $type) {
if (preg_match('/^application\/x-.*-rom$/', $type)) {
echo $type.PHP_EOL;
}
}
}