SymfonyComponentHttpFoundationFileMimeTypeFileBinaryMimeTypeGuesser

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

Summary

No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
N/A
File
vendorSymfonyComponentHttpFoundationFileMimeTypeFileBinaryMimeTypeGuesser.php
Package
Default
Class hierarchy
SymfonyComponentHttpFoundationFileMimeTypeFileBinaryMimeTypeGuesser
Implements
SymfonyComponentHttpFoundationFileMimeTypeMimeTypeGuesserInterface

Tags

author

Bernhard Schussek bschussek@gmail.com

Properties

$cmd

$cmd : 

Type

Tags

None found

Methods

__construct()

__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.

Parameters

string $cmd

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

Tags

None found

isSupported()

isSupported() : Boolean

Returns whether this guesser is supported on the current OS

Returns

Boolean

static

Tags

None found

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

Tags

None found