]> 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 13993385ad992d9dd7863630179a27a0e7dfad1c..f238a7819cfc2a1d63181e9c78c11838f87ed4f6 100644 (file)
@@ -13,6 +13,18 @@ use Friendica\BaseObject;
  */
 abstract class AbstractCacheDriver extends BaseObject
 {
+       /**
+        * Returns the prefix (to avoid namespace conflicts)
+        *
+        * @return string
+        * @throws \Exception
+        */
+       protected function getPrefix()
+       {
+               // We fetch with the hostname as key to avoid problems with other applications
+               return self::getApp()->getHostName();
+       }
+
        /**
         * @param string $key The original key
         * @return string        The cache key used for the cache
@@ -20,8 +32,7 @@ abstract class AbstractCacheDriver extends BaseObject
         */
        protected function getCacheKey($key)
        {
-               // We fetch with the hostname as key to avoid problems with other applications
-               return self::getApp()->getHostName() . ":" . $key;
+               return $this->getPrefix() . ":" . $key;
        }
 
        /**