]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Cache/AbstractCacheDriver.php
Merge pull request #7250 from MrPetovan/bug/6410-normalize-message-button
[friendica.git] / src / Core / Cache / AbstractCacheDriver.php
index c2628551ef47be5dee31908af0b883e0520a37e4..f238a7819cfc2a1d63181e9c78c11838f87ed4f6 100644 (file)
@@ -14,13 +14,25 @@ use Friendica\BaseObject;
 abstract class AbstractCacheDriver extends BaseObject
 {
        /**
-        * @param string $key   The original key
-        * @return string               The cache key used for the cache
+        * Returns the prefix (to avoid namespace conflicts)
+        *
+        * @return string
+        * @throws \Exception
         */
-       protected function getCacheKey($key)
+       protected function getPrefix()
        {
                // We fetch with the hostname as key to avoid problems with other applications
-               return self::getApp()->getHostName() . ":" . $key;
+               return self::getApp()->getHostName();
+       }
+
+       /**
+        * @param string $key The original key
+        * @return string        The cache key used for the cache
+        * @throws \Exception
+        */
+       protected function getCacheKey($key)
+       {
+               return $this->getPrefix() . ":" . $key;
        }
 
        /**