FileinfoMimeTypeGuesser
in package
implements
MimeTypeGuesserInterface
Guesses the mime type using the PECL extension FileInfo.
Tags
Interfaces, Classes, Traits and Enums
- MimeTypeGuesserInterface
- Guesses the mime type of a file.
Table of Contents
- $magicFile : mixed
- __construct() : mixed
- guess() : string|null
- Guesses the mime type of the file with the given path.
- isSupported() : bool
- Returns whether this guesser is supported on the current OS/PHP setup.
Properties
$magicFile
private
mixed
$magicFile
Methods
__construct()
public
__construct([string $magicFile = null ]) : mixed
Parameters
- $magicFile : string = null
-
A magic file to use with the finfo instance
Tags
Return values
mixed —guess()
Guesses the mime type of the file with the given path.
public
guess(mixed $path) : string|null
Parameters
- $path : mixed
-
The path to the file
Return values
string|null —The mime type or NULL, if none could be guessed
isSupported()
Returns whether this guesser is supported on the current OS/PHP setup.
public
static isSupported() : bool