PHP code example of rollerworks / cache

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

    

rollerworks / cache example snippets



use Symfony\Component\HttpFoundation\Session\Session;
use Rollerworks\Component\Cache\SessionCache;

$session = new Session();
$session->start();

// ...

// The first parameter of the SessionCache must be a `Symfony\Component\HttpFoundation\Session\Session` object.
// The second parameter is an optional session storageKey that used for storing the session, default is '_rollerworks_cache'.
// The third parameter is an optional SessionCacheBag object

// When a SessionCacheBag is provided, it must be registered at the session by calling registerBag() on the $session object.
$sessionCacheDriver = new SessionCache($session, '_my_cache');

// Now you can use the $sessionCacheDriver object for any Doctrine Caching.
// See the resources below for more information.
bash
$ php composer.phar update rollerworks/cache