class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface
Guesses the mime type with the binary "file" (only available on *nix)
Methods
|
__construct(string $cmd = 'file -b --mime %s 2>/dev/null')
Constructor. |
||
| static Boolean |
isSupported()
Returns whether this guesser is supported on the current OS |
|
| string |
guess(string $path)
Guesses the mime type of the file with the given path. |
Details
at line 36
public
__construct(string $cmd = 'file -b --mime %s 2>/dev/null')
Constructor.
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.
at line 46
static public Boolean
isSupported()
Returns whether this guesser is supported on the current OS
at line 54
public string
guess(string $path)
Guesses the mime type of the file with the given path.