From c7dacb05e70fe14472663535e5734872a795daa4 Mon Sep 17 00:00:00 2001 From: Kamisama Date: Mon, 26 Aug 2013 21:27:08 -0400 Subject: [PATCH] Add support for Amazon ElastiCache --- lib/Cake/Cache/Engine/MemcachedEngine.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Cake/Cache/Engine/MemcachedEngine.php b/lib/Cake/Cache/Engine/MemcachedEngine.php index 4814b066f..2155318c9 100755 --- a/lib/Cake/Cache/Engine/MemcachedEngine.php +++ b/lib/Cake/Cache/Engine/MemcachedEngine.php @@ -117,6 +117,11 @@ class MemcachedEngine extends CacheEngine { $this->_Memcached->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_IGBINARY); } + // Check for Amazon ElastiCache instance + if (defined('Memcached::OPT_CLIENT_MODE') && defined('Memcached::DYNAMIC_CLIENT_MODE')) { + $this->_Memcached->setOption(Memcached::OPT_CLIENT_MODE, Memcached::DYNAMIC_CLIENT_MODE); + } + $this->_Memcached->setOption(Memcached::OPT_COMPRESSION, (bool)$this->settings['compress']); }