File "memcached.php"
Full path: /home/cakedeco/retaildirectonline.co.uk/system/library/cache/memcached.php
File
size: 599 B (599 B bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor &nnbsp; Back
<?php
namespace Cache;
class Memcached {
private $expire;
private $memcached;
const CACHEDUMP_LIMIT = 9999;
public function __construct($expire) {
$this->expire = $expire;
$this->memcached = new \Memcached();
$this->memcached->addServer(CACHE_HOSTNAME, CACHE_PORT);
}
public function get($key) {
return $this->memcached->get(CACHE_PREFIX . $key);
}
public function set($key, $value) {
return $this->memcached->set(CACHE_PREFIX . $key, $value, $this->expire);
}
public function delete($key) {
$this->memcached->delete(CACHE_PREFIX . $key);
}
}