From 488914a4acfa3470a2c5895469c02998db004faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Osman=20U=CC=88ngu=CC=88r?= Date: Thu, 19 Apr 2012 11:33:26 +0300 Subject: [PATCH 1/2] Added section about cache driver --- en/reference/caching.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/en/reference/caching.rst b/en/reference/caching.rst index 1da48f2ee..52545d842 100644 --- a/en/reference/caching.rst +++ b/en/reference/caching.rst @@ -100,6 +100,28 @@ driver by itself. $cacheDriver = new \Doctrine\Common\Cache\XcacheCache(); $cacheDriver->save('cache_id', 'my_data'); +Redis +~~~~~ + +In order to use the Redis cache driver you must have it compiled +and enabled in your php.ini. You can read about what is Redis +`from here `_. Also check +`here `_ for how you can use +and install Redis PHP extension. + +Below is a simple example of how you could use the Redis cache +driver by itself. + +.. code-block:: php + + connect('redis_host', 6379); + + $cacheDriver = new \Doctrine\Common\Cache\RedisCache(); + $cacheDriver->setRedis($redis); + $cacheDriver->save('cache_id', 'my_data'); + Using Cache Drivers ------------------- From 022298116164322fc5eb4c8eb6c7f32394399cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Osman=20U=CC=88ngu=CC=88r?= Date: Thu, 19 Apr 2012 11:34:12 +0300 Subject: [PATCH 2/2] Added notes about configuration --- en/reference/configuration.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/en/reference/configuration.rst b/en/reference/configuration.rst index 1724886cb..fe0b7bb0c 100644 --- a/en/reference/configuration.rst +++ b/en/reference/configuration.rst @@ -177,7 +177,7 @@ setup methods: These setup commands make several assumptions: - If `$devMode` is true always use an ``ArrayCache`` and set ``setAutoGenerateProxyClasses(true)``. -- If `$devMode` is false, check for Caches in the order APC, Xcache, Memcache (127.0.0.1:11211) unless `$cache` is passed as fourth argument. +- If `$devMode` is false, check for Caches in the order APC, Xcache, Memcache (127.0.0.1:11211), Redis (127.0.0.1:6379) unless `$cache` is passed as fourth argument. - If `$devMode` is false, set ``setAutoGenerateProxyClasses(false)`` - If third argument `$proxyDir` is not set, use the systems temporary directory. @@ -280,6 +280,7 @@ The recommended implementations for production are: - ``Doctrine\Common\Cache\ApcCache`` - ``Doctrine\Common\Cache\MemcacheCache`` - ``Doctrine\Common\Cache\XcacheCache`` +- ``Doctrine\Common\Cache\RedisCache`` For development you should use the ``Doctrine\Common\Cache\ArrayCache`` which only caches data on a @@ -310,6 +311,7 @@ The recommended implementations for production are: - ``Doctrine\Common\Cache\ApcCache`` - ``Doctrine\Common\Cache\MemcacheCache`` - ``Doctrine\Common\Cache\XcacheCache`` +- ``Doctrine\Common\Cache\RedisCache`` For development you should use the ``Doctrine\Common\Cache\ArrayCache`` which only caches data on a