PHP code example of roave / doctrine-simplecache

1. Go to this page and download the library: Download roave/doctrine-simplecache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

roave / doctrine-simplecache example snippets




namespace App;

use Psr\Container\ContainerInterface;
use Psr\SimpleCache\CacheInterface as PsrCacheInterface;
use Roave\DoctrineSimpleCache\SimpleCacheAdapter;
use Doctrine\Common\Cache\RedisCache;

final class MyCacheFactory
{
    public function __invoke(ContainerInterface $container) : PsrCacheInterface
    {
        return new SimpleCacheAdapter(new RedisCache());
    }
}