\Symfony\Component\HttpFoundation\File\MimeTypeFileBinaryMimeTypeGuesser

Guesses the mime type with the binary "file" (only available on *nix).

Summary

Methods
Properties
Constants
__construct()
isSupported()
guess()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$cmd
N/A

Properties

$cmd

$cmd : 

Type

Methods

__construct()

__construct(string  $cmd = 'file -b --mime %s 2>/dev/null') 

The $cmd pattern must contain a "%s" string that will be replaced with the file name to guess.

The command output must start with the mime type of the file.

Parameters

string $cmd

The command to run to get the mime type of a file

isSupported()

isSupported() : boolean

Returns whether this guesser is supported on the current OS.

Returns

boolean

guess()

guess(string  $path) : string

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

Parameters

string $path

The path to the file

Returns

string —

The mime type or NULL, if none could be guessed