aboutsummaryrefslogtreecommitdiffstats
path: root/include/cache.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-28 19:58:05 -0700
committerredmatrix <git@macgirvin.com>2016-07-28 19:58:05 -0700
commitae5c10a71cd29722f63b379b62801dea52a9ab8f (patch)
tree5c9c0c6668369f5ffbd4f5c7b635c9c1ec96b996 /include/cache.php
parent2d4b75428a87038b9a637bf49fc0a91c91b392fb (diff)
parent4d5202353fbce12f19fbe578205259d2a7bd3f04 (diff)
downloadvolse-hubzilla-1.10.tar.gz
volse-hubzilla-1.10.tar.bz2
volse-hubzilla-1.10.zip
Merge branch '1.10RC'1.10
Diffstat (limited to 'include/cache.php')
-rw-r--r--include/cache.php44
1 files changed, 0 insertions, 44 deletions
diff --git a/include/cache.php b/include/cache.php
deleted file mode 100644
index 4a3f453e1..000000000
--- a/include/cache.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php /** @file */
-
- /**
- * cache api
- */
-
- class Cache {
- public static function get($key){
- $r = q("SELECT v FROM cache WHERE k = '%s' limit 1",
- dbesc($key)
- );
-
- if ($r)
- return $r[0]['v'];
- return null;
- }
-
- public static function set($key,$value) {
-
- $r = q("SELECT * FROM cache WHERE k = '%s' limit 1",
- dbesc($key)
- );
- if($r) {
- q("UPDATE cache SET v = '%s', updated = '%s' WHERE k = '%s'",
- dbesc($value),
- dbesc(datetime_convert()),
- dbesc($key));
- }
- else {
- q("INSERT INTO cache ( k, v, updated) VALUES ('%s','%s','%s')",
- dbesc($key),
- dbesc($value),
- dbesc(datetime_convert()));
- }
- }
-
-
- public static function clear(){
- q("DELETE FROM cache WHERE updated < '%s'",
- dbesc(datetime_convert('UTC','UTC',"now - 30 days")));
- }
-
- }
-