lithium\storage\cache\adapter\Apc::write()
Implements
lithium\storage\cache\Adapter::write()
Write values to the cache. All items to be cached will receive an
expiration time of $expiry.
Parameters
-
array
$keysKey/value pairs with keys to uniquely identify the to-be-cached item.
-
string|integer
$expiryA
strtotime()compatible cache time or TTL in seconds. To persist an item use\lithium\storage\Cache::PERSIST.
Returns
booleantrue on successful write, false otherwise.
Source
public function write(array $keys, $expiry = null) {
$expiry = $expiry || $expiry === Cache::PERSIST ? $expiry : $this->_config['expiry'];
if (!$expiry || $expiry === Cache::PERSIST) {
$ttl = 0;
} elseif (is_int($expiry)) {
$ttl = $expiry;
} else {
$ttl = strtotime($expiry) - time();
}
if ($this->_config['scope']) {
$keys = $this->_addScopePrefix($this->_config['scope'], $keys);
}
return apc_store($keys, null, $ttl) === [];
}