diff --git a/code/extractors/FileTextExtractor.php b/code/extractors/FileTextExtractor.php index a5a2e33..b22e98e 100644 --- a/code/extractors/FileTextExtractor.php +++ b/code/extractors/FileTextExtractor.php @@ -63,11 +63,9 @@ abstract class FileTextExtractor extends Object { * @return string Mime type if found */ protected static function get_mime($path) { - if(!class_exists('finfo')) return null; + $file = new Symfony\Component\HttpFoundation\File\File($path); - // Check mime of file - $finfo = new finfo(FILEINFO_MIME_TYPE); - return $finfo->file($path); + return $file->getMimeType(); } /** diff --git a/composer.json b/composer.json index 0e3bc24..59101e5 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,11 @@ "composer/installers": "*", "silverstripe/framework": "~3.1", "guzzle/guzzle": "~3.9", - "symfony/event-dispatcher": "~2.6.0@stable" + "symfony/event-dispatcher": "~2.6.0@stable", + "symfony/http-foundation": "~2.6.0" }, "require-dev": { - "phpunit/PHPUnit": "~3.7@stable" + "phpunit/phpunit": "~3.7" }, "suggest": { "ext-fileinfo": "Improved support for file mime detection"