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;
}
/**