You are here

protected function CoreExtensionMimeTypeGuesserExtended::getMapping in Sophron 8

Ensures Drupal's core MIME type mapping is altered by modules.

File

src/CoreExtensionMimeTypeGuesserExtended.php, line 46

Class

CoreExtensionMimeTypeGuesserExtended
Extends the class that Drupal core uses to guess the MIME type of a file.

Namespace

Drupal\sophron

Code

protected function getMapping() {
  if ($this->mapping === NULL) {
    $mapping = $this->defaultMapping;

    // Allow modules to alter the default mapping.
    $this->moduleHandler
      ->alter('file_mimetype_mapping', $mapping);
    $this->mapping = $mapping;
  }
  return $this->mapping;
}