PHP code example of samuelnogueira / cache-datastore-newrelic

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

    

samuelnogueira / cache-datastore-newrelic example snippets


use Psr\Cache\CacheItemPoolInterface;
use Samuelnogueira\CacheDatastoreNewrelic\CacheItemPoolDecorator;
use Samuelnogueira\CacheDatastoreNewrelic\DatastoreParams;

/** @var CacheItemPoolInterface $cache */

return new CacheItemPoolDecorator(
    $cache, // your cache adapter
    new DatastoreParams('My Database Product'),
);

use Psr\SimpleCache\CacheInterface;
use Samuelnogueira\CacheDatastoreNewrelic\SimpleCacheDecorator;
use Samuelnogueira\CacheDatastoreNewrelic\DatastoreParams;

/** @var CacheInterface $cache */

return new SimpleCacheDecorator(
    $cache, // your cache adapter
    new DatastoreParams('My Database Product'),
);