From 2482773b03f6369e727c41efbda087cf355b1ca4 Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Fri, 12 Mar 2010 03:38:03 +0000 Subject: [PATCH] [2.0][DDC-402] Fixed issue with MemcacheCache througing E_WARNINGs if no cache entry is found. --- lib/Doctrine/Common/Cache/MemcacheCache.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/Common/Cache/MemcacheCache.php b/lib/Doctrine/Common/Cache/MemcacheCache.php index f819daf94..c185ed074 100644 --- a/lib/Doctrine/Common/Cache/MemcacheCache.php +++ b/lib/Doctrine/Common/Cache/MemcacheCache.php @@ -71,11 +71,16 @@ class MemcacheCache extends AbstractCache $allSlabs = $this->_memcache->getExtendedStats('slabs'); foreach ($allSlabs as $server => $slabs) { - foreach (array_keys($slabs) as $slabId) { - $dump = $this->_memcache->getExtendedStats('cachedump', (int) $slabId); - foreach ($dump as $entries) { - if ($entries) { - $keys = array_merge($keys, array_keys($entries)); + if (is_array($slabs)) { + foreach (array_keys($slabs) as $slabId) { + $dump = $this->_memcache->getExtendedStats('cachedump', (int) $slabId); + + if ($dump) { + foreach ($dump as $entries) { + if ($entries) { + $keys = array_merge($keys, array_keys($entries)); + } + } } } }