PHP code example of cache / encryption-cache

1. Go to this page and download the library: Download cache/encryption-cache 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 / encryption-cache example snippets


use Cache\Adapter\PHPArray\ArrayCachePool;
use Cache\Encryption\EncryptedCachePool;
use Defuse\Crypto\Key;

$key = Key::createNewRandomKey();
$pool = new EncryptedCachePool(new ArrayCachePool(), $key);

$item = $pool->getItem('account.42');
$item->set(['email' => '[email protected]']);
$pool->save($item);