for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Class APCUCache
*
* @filesource APCUCache.php
* @created 27.05.2017
* @package chillerlan\SimpleCache
* @author Smiley <[email protected]>
* @copyright 2017 Smiley
* @license MIT
*/
namespace chillerlan\SimpleCache;
class APCUCache extends CacheDriverAbstract{
/** @inheritdoc */
public function get($key, $default = null){
$this->checkKey($key);
$value = apcu_fetch($key);
if($value !== false){
return $value;
}
return $default;
public function set($key, $value, $ttl = null):bool{
return (bool)apcu_store($key, $value, $this->getTTL($ttl));
public function delete($key):bool{
return (bool)apcu_delete($key);
public function clear():bool{
return apcu_clear_cache();