for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Drupal\controller_annotations\Cache;
use Doctrine\Common\Cache\CacheProvider;
use Drupal\Core\Cache\CacheBackendInterface;
class DrupalCache extends CacheProvider
{
/**
* @var CacheBackendInterface
*/
private $cache;
* @param CacheBackendInterface $cache
public function __construct(CacheBackendInterface $cache)
$this->cache = $cache;
}
* @inheritdoc
protected function doFetch($id)
return $this->cache->get($id);
protected function doContains($id)
return $this->doFetch($id) !== false;
protected function doSave($id, $data, $lifeTime = 0)
if ($lifeTime === 0) {
$this->cache->set($id, $data);
else {
$this->cache->set($id, $data, time() + $lifeTime);
return true;
protected function doDelete($id)
$this->cache->delete($id);
protected function doFlush()
$this->cache->deleteAll();
protected function doGetStats()
return;