FileinfoMimeTypeGuesser
in package
implements
MimeTypeGuesserInterface
Guesses the MIME type using the PECL extension FileInfo.
Tags
Table of Contents
Interfaces
- MimeTypeGuesserInterface
- Guesses the MIME type of a file.
Properties
- $magicFile : mixed
Methods
- __construct() : mixed
- guessMimeType() : string|null
- Guesses the MIME type of the file with the given path.
- isGuesserSupported() : bool
- Returns true if this guesser is supported.
Properties
$magicFile
private
mixed
$magicFile
Methods
__construct()
public
__construct([string|null $magicFile = null ]) : mixed
Parameters
- $magicFile : string|null = null
-
A magic file to use with the finfo instance
Tags
guessMimeType()
Guesses the MIME type of the file with the given path.
public
guessMimeType(string $path) : string|null
Parameters
- $path : string
Return values
string|nullisGuesserSupported()
Returns true if this guesser is supported.
public
isGuesserSupported() : bool