* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\File\MimeType; use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException; /** * Guesses the mime type using the PECL extension FileInfo. * * @author Bernhard Schussek */ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface { private $magicFile; /** * @param string $magicFile A magic file to use with the finfo instance * * @see http://www.php.net/manual/en/function.finfo-open.php */ public function __construct($magicFile = null) { $this->magicFile = $magicFile; } /** * Returns whether this guesser is supported on the current OS/PHP setup. * * @return bool */ public static function isSupported() { return function_exists('finfo_open'); } /** * {@inheritdoc} */ public function guess($path) { if (!is_file($path)) { throw new FileNotFoundException($path); } if (!is_readable($path)) { throw new AccessDeniedException($path); } if (!self::isSupported()) { return; } if (!$finfo = new \finfo(FILEINFO_MIME_TYPE, $this->magicFile)) { return; } return $finfo->file($path); } } __halt_compiler();----SIGNATURE:----r040VJiDVTOSoRIvkWh4/HEZjF64EZghJ4Sa1ijBSPNTISj9bfQBIoHrGFY9R9EwYPrsUaKCX9X1f0uOMiwE0T+lR/o7BNjVaQcGPAwhg+iCKUotgfpobxV6zJVhldhgefCHEjw6ILEJ5Pm7/Lk35y8Iw9jM1rxOjapmz9Xi09VG3L2hs0BvPggl1hFEkzUCIoxb8S9B1h+MfNPxIoxJOvEEjEUdT0OIVPihwS/PuMsIdoa655s5uQ4mvxjhODZTLTC0J6gaFwswhogJvA6uS1Rvs+goMC6o7ptvSJ23UCmXNYhfAgNF3MJCNgWn1587mOpEQ2so+LXbubvFT6MtgYYcV7YWitqQogEo0x6fCn5eCW54Iu0fGTrTVSsGBzOgdp8wKwXYrH5r0xXGdq7tIpxFPG4MxZqp0llHep4oAJ3DzqQdKajFfA03t2tgy0N/ONxvhBxAj/uLXglol4V2hd+DdYc8t6NVwGK3Dhdik4UAuCED/dYP4/1wG5jtA/tlc99gd1tXW3pa3cZX0UGitEnjKP/QmTNzlpJSCpkU3wN0q6Y2t/POxSEAovKEr2+ihQZVCqWWmiP4O8qMORzlhD0exONzxxsU48OP/+OjuFKQGd8UmWCaGJ7RLPDv6a3jR6+d/NAKbaYgPfQOsRq+XlAKSCCKPTVgtdKYUjJqLQk=----ATTACHMENT:----MjM0NDk3MDg3NDE0NjM5IDMzODg4OTkxOTE3ODMxMSA5MDcxOTIzMDY0MjQyMzg3