PHP code example of truesocialmetrics / cache-storage-adapter-large-items

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

    

truesocialmetrics / cache-storage-adapter-large-items example snippets


$cache = new \Laminas\Cache\Storage\Adapter\Memory();
$packer = new \Twee\Cache\Storage\Adapter\Packer($cache, 1000);

$packer->setItem('large_item', ['data' => str_repeat('a', 100000)]);
$item = $packer->getItem('large_item');
var_dump($item);