How could I integrate Zend Cache Factory into Symfony 2 so that I could change my cache adapter easily in my config.yml?
This is the traditional way to get an adapter using the factory.
use Zend\Cache\StorageFactory;
$cache = StorageFactory::factory(array(
'adapter' => array(
'name' => 'apc',
'options' => array('ttl' => 3600),
),
'plugins' => array(
'exception_handler' => array('throw_exceptions' => false),
),
));
Source: http://framework.zend.com/manual/2.2/en/modules/zend.cache.storage.adapter.html
Since the zend cache library is already installed by composer. What's the best approach to integrate it into DI container so I can get my cache configured anywhere in the app?
$this->get('my_cache.blog')