aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-09-10 19:09:55 +0000
committerMario <mario@mariovavti.com>2023-09-10 19:09:55 +0000
commit75e75b93cff5b2fb5d6243a908ee003b3faf010a (patch)
tree6169ce5d7e0857f6ecb32275672c9e7238864700 /Zotlabs/Lib
parent0e8ecbc9fc108b4903eb013ca0a4a1f4beb5fbe1 (diff)
downloadvolse-hubzilla-75e75b93cff5b2fb5d6243a908ee003b3faf010a.tar.gz
volse-hubzilla-75e75b93cff5b2fb5d6243a908ee003b3faf010a.tar.bz2
volse-hubzilla-75e75b93cff5b2fb5d6243a908ee003b3faf010a.zip
an attempt to cache seen item mids for the purpose that we can hide seen pubstream items from the notifications - might revert if it turns out that it does not scale
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Cache.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/Zotlabs/Lib/Cache.php b/Zotlabs/Lib/Cache.php
index a5052a183..60bf64611 100644
--- a/Zotlabs/Lib/Cache.php
+++ b/Zotlabs/Lib/Cache.php
@@ -5,17 +5,17 @@ namespace Zotlabs\Lib;
/**
* cache api
*/
-
+
class Cache {
-
+
/**
* @brief Returns cached content
- *
+ *
* @param string $key
* @param string $age in SQL format, default is '30 DAY'
* @return string
*/
-
+
public static function get($key, $age = '') {
$hash = hash('whirlpool',$key);
@@ -25,12 +25,12 @@ class Cache {
db_utcnow(),
db_quoteinterval(($age ? $age : get_config('system','object_cache_days', '30') . ' DAY'))
);
-
+
if ($r)
return $r[0]['v'];
return null;
}
-
+
public static function set($key,$value) {
$hash = hash('whirlpool',$key);
@@ -45,7 +45,7 @@ class Cache {
dbesc($hash));
}
else {
- q("INSERT INTO cache ( k, v, updated) VALUES ('%s','%s','%s')",
+ q("INSERT INTO cache (k, v, updated) VALUES ('%s', '%s', '%s')",
dbesc($hash),
dbesc($value),
dbesc(datetime_convert()));