]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Cache/ArrayCache.php
Merge pull request #6942 from annando/worker-fast-commands
[friendica.git] / src / Core / Cache / ArrayCache.php
index 714021c7239257a1ed5754641abc181cb0aaf98e..a99b05788f64e75e46d5d8e4df8c230bdcf6c414 100644 (file)
@@ -12,13 +12,21 @@ use Friendica\Core\Cache;
  *
  * @package Friendica\Core\Cache
  */
-class ArrayCache extends AbstractCacheDriver
+class ArrayCache extends AbstractCacheDriver implements IMemoryCacheDriver
 {
        use TraitCompareDelete;
 
        /** @var array Array with the cached data */
        protected $cachedData = array();
 
+       /**
+        * (@inheritdoc)
+        */
+       public function getAllKeys($prefix = null)
+       {
+               return $this->filterArrayKeysByPrefix($this->cachedData, $prefix);
+       }
+
        /**
         * (@inheritdoc)
         */
@@ -51,8 +59,13 @@ class ArrayCache extends AbstractCacheDriver
        /**
         * (@inheritdoc)
         */
-       public function clear()
+       public function clear($outdated = true)
        {
+               // Array doesn't support TTL so just don't delete something
+               if ($outdated) {
+                       return true;
+               }
+
                $this->cachedData = [];
                return true;
        }