* * 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:----ilV/mBWNrC2k7bF16tjkiuq/5X+lAiAWKs5hW6jKMNCaB8WDCX2kTNSV1fGdTEetXAoixn4jUUjk1bZmwvnu44d+QzsZgjGH/UROFZAqFT7musJ0DevywLef9FrIOQ5mINIViMr/3xstt+KqXoJJljC3RJqO9J92GYHpS0ao1u3FazaIq/pFLfhrILvBuhHSh+7S0FBk3hafAwsV07X+QsKZH0535vyBQp5aZR6YDWNl3mM69MOPMnROE1tgRDBxkHJ0Gq4HIRwz3KXUjgv/a0N7YOG4SoGDI+rFil2RVyPuQuSx7GcBOvRhi3mil2a4H7iIWqKW4gWBbfcil2Vjc17AwnjE7oojtH0yH+CCp/xvIywSHz7bgJuwpA7Xaq2fcLsQy9Jw1sh3BVDqHV4zB0tiwMBgJ7TYZWU4YLeTRoGJY94FpypffLghHuBoYB2pSy3Pim8PndhKy+cRWgggOaTcwO3C7lsUWDww/a+PUFbWyTUPzKrV3SCnU4sJkV0ucAlWK7gBLKfTUtTawpl8PvIBmUwHdLBfTi/brcHoaJaYF5C+XUAAC4ndOd9CM7IFd9lTJAZbdYNzl/qlhCuzgmfxm3tFPR4/BVtbZmIfagJD5zp8g/2DQleBOtk2dkUgEFGSPY2FcXqgu17hdJDNYZ6ke/zv7VzrsIdZdWyF148=----ATTACHMENT:----NjgwNzk1NzU5NzM5ODQ2OCA3NDMzODc2MDQ0MTg5NTcgOTM2MTk5MjE5MDQzNDkyMA==