Implements Drupal\Core\Config\StorageInterface::read().
Overrides StorageInterface::read
public function read($name) {
if ($cache = $this->cache
->get($name)) {
// The cache backend supports primitive data types, but only an array
// represents valid config object data.
if (is_array($cache->data)) {
return $cache->data;
}
}
// Read from the storage on a cache miss and cache the data, if any.
$data = $this->storage
->read($name);
if ($data !== FALSE) {
$this->cache
->set($name, $data, CacheBackendInterface::CACHE_PERMANENT);
}
elseif ($cache) {
$this->cache
->delete($name);
}
return $data;
}