]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Cache/MemcacheCacheDriver.php
Improve redis configuration
[friendica.git] / src / Core / Cache / MemcacheCacheDriver.php
index 37327ebba92e9d6230b6a5be588682d117f802fa..fd928c6fcc15ed2a5245f2bca27c664a6f696531 100644 (file)
@@ -40,6 +40,30 @@ class MemcacheCacheDriver extends AbstractCacheDriver implements IMemoryCacheDri
                }
        }
 
+       /**
+        * (@inheritdoc)
+        */
+       public function getAllKeys($prefix = null)
+       {
+               $keys = [];
+               $allSlabs = $this->memcache->getExtendedStats('slabs');
+               foreach ($allSlabs as $slabs) {
+                       foreach (array_keys($slabs) as $slabId) {
+                               $cachedump = $this->memcache->getExtendedStats('cachedump', (int)$slabId);
+                               foreach ($cachedump as $key => $arrVal) {
+                                       if (!is_array($arrVal)) {
+                                               continue;
+                                       }
+                                       $keys = array_merge($keys, array_keys($arrVal));
+                               }
+                       }
+               }
+
+               $keys = $this->getOriginalKeys($keys);
+
+               return $this->filterArrayKeysByPrefix($keys, $prefix);
+       }
+
        /**
         * (@inheritdoc)
         */