Support for APCu caching

This commit is contained in:
Philipp Holzer 2019-04-20 17:37:57 +02:00
parent e9c230e109
commit 3ca8fa0e00
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
6 changed files with 217 additions and 2 deletions

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