yf_cache_driver_memcache class| File | plugins/cache/classes/cache/yf_cache_driver_memcache.class.php |
|---|---|
| Use | _class('cache_driver_memcache', 'classes/cache/') |
| Extends | yf_cache_driver |
A site sets them in its config with $PROJECT_CONF['cache_driver_memcache']['NAME'] = ...;
| Property | Default | Description |
|---|---|---|
$_connectionobject |
null |
internal @conf_skip |
from yf_cache_driver: $_parent, $implemented
public function del($name)
public function del($name)
{
if ( ! $this->is_ready()) {
return null;
}
return $this->_connection->del($name) ?: null;
}
public function flush()
public function flush()
{
if ( ! $this->is_ready()) {
return null;
}
return $this->_connection->flush() ?: null;
}
public function get($name, $ttl = 0, $params = [])
public function get($name, $ttl = 0, $params = [])
{
if ( ! $this->is_ready()) {
return null;
}
return $this->_connection->get($name, $ttl, $params);
}
public function is_ready()
public function is_ready()
{
return $this->_connection && $this->_connection->is_ready();
}
public function set($name, $data, $ttl = 0)
public function set($name, $data, $ttl = 0)
{
if ( ! $this->is_ready()) {
return null;
}
return $this->_connection->set($name, $data, $ttl);
}
public function stats()
public function stats()
{
if ( ! $this->is_ready()) {
return null;
}
return $this->_connection->stats() ?: null;
}
_ hooks and helpers; not routable as page actionspublic function __call($name, $args)
Catch missing method call.
public function __call($name, $args)
{
// Support for driver-specific methods
if (is_object($this->_connection) && method_exists($this->_connection, $name)) {
return call_user_func_array([$this->_connection, $name], $args);
}
return main()->extend_call($this, $name, $args);
}
public function _init()
public function _init()
{
$this->_connection = memcached();
$this->_connection->connect();
}