Configuration
First of all, lets configure your Rediska instances (eg. app, otherstuff) in app.yml:
All configuration parameters that Rediska offers when setting up a Rediska instance are available here.
Now we can use these instances to configure a great number of things!
In the above example, we are going to use the app instance as the storage for Symfony internal caching, and otherstuff for caching other critical data.
Symfony Caches
Symfony provides the ability to cache critical parts of your application - session storage, routing, and the view cache.
To configure sfRediskaPlugin for session storage:
For routing:
For view cache:
Doctrine Driver
To setup the Rediska Doctrine driver, first you must edit your application configuration file, eg. frontendConfiguration.class.php
<?php public function configureDoctrine(Doctrine_Manager $manager) { $cacheDriver = new Doctrine_Cache_Redis(array('instance' => 'otherstuff', 'prefix' => 'dql:')); $manager->setAttribute(Doctrine_Core::ATTR_RESULT_CACHE, $cacheDriver); } ?>
NOTE: ProjectConfiguration.class.php cannot be used as sfRediskaPlugin depends on configuration variables set at application level.