public function exists($name) { // The cache would read in the entire data (instead of only checking whether
// any data exists), and on a potential cache miss, an additional storage
// lookup would have to happen, so check the storage directly.
return $this->storage->
exists($name);
} /**
* {@inheritdoc}
*/
public function read($name) { $cache_key =
$this->
getCacheKey($name);
if ($cache =
$this->cache->
get($cache_key)) { // The cache contains either the cached configuration data or FALSE
// if the configuration file does not exist.
return $cache->data;
} // Read from the storage on a cache miss and cache the data. Also cache
// information about missing configuration objects.
$data =
$this->storage->
read($name);
$this->cache->
set($cache_key,
$data);
return $data;
}