lithium\storage\cache\adapter\XCache::read()
Implements
lithium\storage\cache\Adapter::read()
Read values from the cache. Will attempt to return an array of data containing key/value pairs of the requested data.
Note that this is not an atomic operation when using multiple keys.
Parameters
-
array
$keys
Keys to uniquely identify the cached items.
Returns
arrayCached values keyed by cache keys on successful read, keys which could not be read will not be included in the results array.
Source
public function read(array $keys) {
if ($this->_config['scope']) {
$keys = $this->_addScopePrefix($this->_config['scope'], $keys);
}
$results = [];
foreach ($keys as $key) {
$result = xcache_get($key);
if ($result === null && !xcache_isset($key)) {
continue;
}
$results[$key] = $result;
}
if ($this->_config['scope']) {
$results = $this->_removeScopePrefix($this->_config['scope'], $results);
}
return $results;
}