PHP code example of cache / doctrine-adapter

1. Go to this page and download the library: Download cache/doctrine-adapter 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/ */

    

cache / doctrine-adapter example snippets


use Doctrine\Common\Cache\MemcachedCache;
use Cache\Adapter\Doctrine\DoctrineCachePool;


$memcached = new \Memcached();
$memcached->addServer('localhost', 11211);

// Create a instance of Doctrine's MemcachedCache
$doctrineCache = new MemcachedCache();
$doctrineCache->setMemcached($memcached);

// Wrap Doctrine's cache with the PSR-6 adapter
$pool = new DoctrineCachePool($doctrineCache);