Fix Mime Types - fix CLI param

This commit is contained in:
Stéphane Goetz
2017-12-08 16:29:44 +01:00
parent 9269b277e2
commit e844b51f10
4 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,25 @@
<?php namespace Todaymade\Daux\Server;
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
/**
* Guesses the mime type using the file's extension
*/
class ExtensionMimeTypeGuesser implements MimeTypeGuesserInterface
{
/**
* {@inheritdoc}
*/
public function guess($path)
{
$extension = pathinfo($path,PATHINFO_EXTENSION);
if ($extension == "css") {
return "text/css";
}
if ($extension == "js") {
return "application/javascript";
}
}
}