PHP code example of aequasi / cache-bundle

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

    

aequasi / cache-bundle example snippets


$bundles(
    ...
       new Aequasi\Bundle\CacheBundle\AequasiCacheBundle(),
    ...
);

// Change default to the name of your instance
$cache = $container->get( 'aequasi_cache.instance.default' );
// Or
$cache = $container->get( 'aequasi_cache.default' );

$cache = $this->get( 'aequasi_cache.instance.default' );
$item = $cache->getItem('test');
if ($item->isHit()) {
	var_dump($item->get());
	
	return;
}

$cache->saveItem('test', $em->find('AcmeDemoBundle:User', 1), 3600);