mirror of
https://github.com/friendica/friendica
synced 2025-04-25 03:50:12 +00:00
Support for APCu caching
This commit is contained in:
parent
e9c230e109
commit
3ca8fa0e00
6 changed files with 217 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue