You are here

public function FileStorage::read in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::read()

Implements Drupal\Core\Config\StorageInterface::read().

Throws

\Drupal\Core\Config\UnsupportedDataTypeConfigException

Overrides StorageInterface::read

1 call to FileStorage::read()
FileStorage::readMultiple in core/lib/Drupal/Core/Config/FileStorage.php
Reads configuration data from the storage.

File

core/lib/Drupal/Core/Config/FileStorage.php, line 94
Contains \Drupal\Core\Config\FileStorage.

Class

FileStorage
Defines the file storage.

Namespace

Drupal\Core\Config

Code

public function read($name) {
  if (!$this
    ->exists($name)) {
    return FALSE;
  }
  $data = file_get_contents($this
    ->getFilePath($name));
  try {
    $data = $this
      ->decode($data);
  } catch (InvalidDataTypeException $e) {
    throw new UnsupportedDataTypeConfigException("Invalid data type in config {$name}: {$e->getMessage()}");
  }
  return $data;
}