Author: bicou
Date: 2010-04-01 14:50:29 +0200 (Thu, 01 Apr 2010)
New Revision: 28957
Modified:
plugins/sfRedisPlugin/trunk/README
Log:
[sfRedisPlugin] README: update doctrine cache section
Modified: plugins/sfRedisPlugin/trunk/README
===================================================================
--- plugins/sfRedisPlugin/trunk/README 2010-04-01 12:50:07 UTC (rev 28956)
+++ plugins/sfRedisPlugin/trunk/README 2010-04-01 12:50:29 UTC (rev 28957)
@@ -3,6 +3,7 @@
The sfRedis plugin provides redis support to symfony (through Predis).
+
Installation
------------
@@ -13,6 +14,7 @@
Then activate the plugin in the `config/ProjectConfiguration.class.php` file.
+
Configuration
-------------
@@ -56,6 +58,7 @@
- redis://192.168.0.1:6379
- redis://192.168.0.2:6379
+
Get a predis client
-------------------
@@ -75,6 +78,7 @@
$redis->set('name', 'value');
$value = $redis->get('name');
+
Symfony cache
-------------
@@ -93,6 +97,7 @@
The parameter "connection" is the key defined in `config/redis.yml`.
The parameter "prefix" is adjusted in this example.
+
Doctrine cache
--------------
@@ -113,11 +118,21 @@
$cacheDriver = new Doctrine_Cache_Redis(array('redis' => $redis));
$manager->setAttribute(Doctrine::ATTR_QUERY_CACHE, $cacheDriver);
+Since `sfRedis::getClient` returns a `Predis_Client`, you can use
configuration from your `config/redis.yml`:
+
+ [php]
+ $cacheDriver = new Doctrine_Cache_Redis(array('redis' =>
sfRedis::getClient('local'), 'prefix' => 'dql:'));
+ $manager->setAttribute(Doctrine::ATTR_QUERY_CACHE, $cacheDriver);
+
+Please note, you need to enable the `sfRedisPlugin` *before* the
`sfDoctrinePlugin` to make the previous snippet work.
+
+
TODO
----
* work with nginx HTTP redis module
+
LINKS
-----
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.