mirror of
https://github.com/friendica/friendica
synced 2025-05-19 01:04:13 +02:00
Improve doc blocks in cache drivers
This commit is contained in:
parent
d1148f61ea
commit
640f76b05a
4 changed files with 48 additions and 6 deletions
|
@ -20,6 +20,11 @@ class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
|
|||
*/
|
||||
private $redis;
|
||||
|
||||
/**
|
||||
* @param string $redis_host
|
||||
* @param int $redis_port
|
||||
* @throws Exception
|
||||
*/
|
||||
public function __construct($redis_host, $redis_port)
|
||||
{
|
||||
if (!class_exists('Redis', false)) {
|
||||
|
@ -33,6 +38,9 @@ class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function get($key)
|
||||
{
|
||||
$return = null;
|
||||
|
@ -55,6 +63,9 @@ class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
|
|||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function set($key, $value, $ttl = Cache::FIVE_MINUTES)
|
||||
{
|
||||
$cachekey = $this->getCacheKey($key);
|
||||
|
@ -75,12 +86,18 @@ class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
$cachekey = $this->getCacheKey($key);
|
||||
return ($this->redis->delete($cachekey) > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function clear($outdated = true)
|
||||
{
|
||||
if ($outdated) {
|
||||
|
@ -127,6 +144,7 @@ class RedisCacheDriver extends AbstractCacheDriver implements IMemoryCacheDriver
|
|||
$this->redis->unwatch();
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue