for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Krenor\Prometheus\Storage\Repositories;
class ApcWrapper
{
/**
* @var bool
*/
protected $apcu = false;
* Create a new APC wrapper instance.
*
* @return void
public function __construct()
$this->apcu = function_exists('apcu_fetch');
}
* @param string $key
* @return mixed
public function get(string $key)
return $this->apcu
? apcu_fetch($key)
: apc_fetch($key);
* @param mixed $value
* @return bool
public function store(string $key, $value): bool
? apcu_store($key, $value)
: apc_store($key, $value);
public function flush(): bool
? apcu_clear_cache()
: apc_clear_cache('user');