diff options
| author | Horus3 | 2014-09-25 10:33:47 +0200 |
|---|---|---|
| committer | Horus3 | 2014-09-25 10:33:47 +0200 |
| commit | 1fe76ba743a3418da9a0883b29756d442384d0bc (patch) | |
| tree | 091910ffd183d94c0f8b70a8f4c362f733033b03 /bootstrap/class/cache.php | |
| parent | 2036626b560f22efd59673187a2de3b1319fcf8a (diff) | |
| download | jungegemeinde-1fe76ba743a3418da9a0883b29756d442384d0bc.tar.gz | |
init
Diffstat (limited to 'bootstrap/class/cache.php')
| -rw-r--r-- | bootstrap/class/cache.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/bootstrap/class/cache.php b/bootstrap/class/cache.php deleted file mode 100644 index 8005484..0000000 --- a/bootstrap/class/cache.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -class cache { - public $token = ""; - - private $db; - - public function __construct($rconnect, $rdb){ - $this->db = new Redis(); - - try { - $this->db->connect($rconnect); - } catch (Exception $e) { - return $e->getMessage(); - } - try { - $this->db->ping(); - } catch (Exception $e) { - return $e->getMessage(); - } - try { - $this->db->select($rdb); - } catch (Exception $e) { - return $e->getMessage(); - } - } - - public function check(){ - try { - return $this->db->ping(); - } catch (Exception $e) { - return $e->getMessage(); - } - } - - public function setKey($key, $value, $ttl = null){ - $this->db->set($key, $value, $ttl); - } - - public function getValue($key){ - return $this->db->get($key); - } - - public function getToken($data, $append = ""){ - $this->token = CACHEPREFIX . $append . md5(strtolower($data)); - return $this->token; - } - - public function exists($key){ - return $this->db->exists($key); - } - - public function delete($key){ - return $this->db->delete($key); - } - - public function del($key){ - return $this->db->delete($key); - } - - public function flush($token = null){ - if ( is_null($token) ) - return $this->db->flushDB(); - else - return $this->db->delete($token); - } -} - - |
