A fluent cache bundle for Symfony 2.
composer require phpfluent/cachebundle
Update the settings.yml file
services:
cache:
class: Doctrine\Common\Cache\ApcCacheRegister the bundle
<?php//%/app/AppKernel.php$bundles = array(
newSymfony\Bundle\FrameworkBundle\FrameworkBundle(),
newSymfony\Bundle\TwigBundle\TwigBundle(),
newSymfony\Bundle\MonologBundle\MonologBundle(),
newSymfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
/** * Your bundles */newPHPFluent\Bundle\CacheBundle\CacheBundle(),
);Call it from your code
$cache = $this->get('phpfluent_cache');
$cache['foo'] = 'bar'; //Cachingecho$cache['foo'];//Retrieving from the cache