Merge pull request #1070 from jygaulier/fix-phras-87

PHRAS-87 #close
This commit is contained in:
Nicolas Le Goff
2014-04-25 11:22:27 +02:00
2 changed files with 0 additions and 37 deletions

View File

@@ -40,8 +40,6 @@ class MimeGuesserConfiguration
$guesser->register(new AudioMimeTypeGuesser()); $guesser->register(new AudioMimeTypeGuesser());
$guesser->register(new VideoMimeTypeGuesser()); $guesser->register(new VideoMimeTypeGuesser());
$guesser->register(new AlchemyMimeTypeGuesser());
if ($this->conf->isSetup()) { if ($this->conf->isSetup()) {
$conf = $this->conf->getConfig(); $conf = $this->conf->getConfig();

View File

@@ -1,35 +0,0 @@
<?php
namespace Alchemy\Phrasea\Media;
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
class MimeTypeGuesser implements MimeTypeGuesserInterface
{
public static $mimeTypes = array(
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mov' => 'video/quicktime',
'dv' => 'video/x-dv',
'xls' => 'application/vnd.ms-excel',
'doc' => 'application/msword',
'ppt' => 'application/vnd.ms-powerpoint',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
);
/**
* {@inheritdoc}
*/
public function guess($path)
{
$extension = strtolower(pathinfo($path, PATHINFO_EXTENSION));
if (array_key_exists($extension, static::$mimeTypes)) {
return static::$mimeTypes[$extension];
}
return null;
}
}