PHP code example of corollarium / psr6-profilecachepool

1. Go to this page and download the library: Download corollarium/psr6-profilecachepool 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/ */

    

corollarium / psr6-profilecachepool example snippets


$pool = new \Cache\Wrapper\ProfileCachePool(new MyRealAdapterPool());

// use normally
$pool->getItem('foo');

// print cute statistics in the end
$pool->reportHTML();

$pool1 = new \Cache\Wrapper\ProfileCachePool(new MyRealAdapterPool());
$pool2 = new \Cache\Wrapper\ProfileCachePool(new MyOtherAdapterPool());

// use normally
$pool1->getItem('foo');
$pool2->getItem('bar');

// merge statistics from several pools together
$mergedStatistics = \Cache\Wrapper\ProfileCachePool::mergeProfileSummaries([$pool1, $pool2]);

// print cute statistics in the end
\Cache\Wrapper\ProfileCachePool::summaryHTML($mergedStatistics);