PHP code example of pextras / psr16-namespaced-cache

1. Go to this page and download the library: Download pextras/psr16-namespaced-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/ */

    

pextras / psr16-namespaced-cache example snippets


// Your PSR-16 cache pool implementing Psr\SimpleCache\CacheInterface 
$cache = new SimpleCache();

$namespaced = new \Pextras\NamespacedCache\NamespacedCache($cache, 'foo');

// NamespacedCache implements Psr\SimpleCache\CacheInterface
$namespaced->get('bar');
$namespaced->set('baz', 123);