mirror of
https://github.com/friendica/friendica
synced 2025-04-24 09:50:11 +00: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
|
@ -13,6 +13,9 @@ use Friendica\Util\DateTimeFormat;
|
|||
*/
|
||||
class DatabaseCacheDriver extends AbstractCacheDriver implements ICacheDriver
|
||||
{
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function get($key)
|
||||
{
|
||||
$cache = DBA::selectFirst('cache', ['v'], ['`k` = ? AND `expires` >= ?', $key, DateTimeFormat::utcNow()]);
|
||||
|
@ -32,6 +35,9 @@ class DatabaseCacheDriver extends AbstractCacheDriver implements ICacheDriver
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function set($key, $value, $ttl = Cache::FIVE_MINUTES)
|
||||
{
|
||||
$fields = [
|
||||
|
@ -43,11 +49,17 @@ class DatabaseCacheDriver extends AbstractCacheDriver implements ICacheDriver
|
|||
return DBA::update('cache', $fields, ['k' => $key], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
return DBA::delete('cache', ['k' => $key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function clear($outdated = true)
|
||||
{
|
||||
if ($outdated) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue