Drupal 8  8.0.2
ExtensionMimeTypeGuesser Class Reference
Inheritance diagram for ExtensionMimeTypeGuesser:

Public Member Functions

 __construct (ModuleHandlerInterface $module_handler)
 
 guess ($path)
 
 setMapping (array $mapping=NULL)
 

Protected Attributes

 $defaultMapping
 
 $mapping
 
 $moduleHandler
 

Detailed Description

Makes possible to guess the MIME type of a file using its extension.

Constructor & Destructor Documentation

__construct ( ModuleHandlerInterface  $module_handler)

Constructs a new ExtensionMimeTypeGuesser.

Parameters
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.

References Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

guess (   $path)

{}

References drupal_basename(), and Drupal\moduleHandler().

Here is the call graph for this function:

setMapping ( array  $mapping = NULL)

Sets the mimetypes/extension mapping to use when guessing mimetype.

Parameters
array | null$mappingPassing a NULL mapping will cause guess() to use self::$defaultMapping.

The documentation for this class was generated from the following file: