class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface

deprecated since Symfony 4.3, use {@link NewFileinfoMimeTypeGuesser} instead

Guesses the mime type using the PECL extension FileInfo.

Methods

__construct(string $magicFile = null)

No description

static bool
isSupported()

Returns whether this guesser is supported on the current OS/PHP setup.

string
guess(string $path)

Guesses the mime type of the file with the given path.

Details

at line 36
__construct(string $magicFile = null)

Parameters

string $magicFile A magic file to use with the finfo instance

See also

http://www.php.net/manual/en/function.finfo-open.php

at line 46
static bool isSupported()

Returns whether this guesser is supported on the current OS/PHP setup.

Return Value

bool

at line 54
string guess(string $path)

Guesses the mime type of the file with the given path.

Parameters

string $path The path to the file

Return Value

string The mime type or NULL, if none could be guessed

Exceptions

FileNotFoundException If the file does not exist
AccessDeniedException If the file could not be read