memcache22CacheDriver

Implements \jICacheDriver

cache driver for data stored in Memcached. Use the memcache extension of PHP.

This plugin should be used with a version of the memcache extension, lower than 3.0.1

package

jelix

subpackage

cache_plugin

Methods

constructor

__construct(array $params) 

Arguments

$params

array

driver parameters, written in the ini file

decrement a specific data value by $var

decrement(string $key, mixed $var = 1) : boolean

Arguments

$key

string

key used for storing data in the cache

$var

mixed

value used

Response

boolean

false if failure

delete a specific data in the cache

delete(string $key) : boolean

Arguments

$key

string

key used for storing data in the cache

Response

boolean

false if failure

clear all data in the cache

flush() : boolean

Response

boolean

false if failure

remove from the cache data of which TTL was expired element with TTL expired already removed => Nothing to do because memcache have an internal garbage mechanism

garbage() : boolean

Response

boolean

read a specific data in the cache.

get(mixed $key) : mixed

Arguments

$key

mixed

key or array of keys used for storing data in the cache

Response

mixed

$data array of data or false if failure

increment a specific data value by $var

increment(string $key, mixed $var = 1) : boolean

Arguments

$key

string

key used for storing data in the cache

$var

mixed

value used

Response

boolean

false if failure

replace a specific data value by $var

replace(string $key, mixed $var, integer $ttl) : boolean

Arguments

$key

string

key used for storing data in the cache

$var

mixed

data to replace

$ttl

integer

data time expiration

Response

boolean

false if failure

set a specific data in the cache

set(string $key, mixed $var, integer $ttl) : boolean

Arguments

$key

string

key used for storing data

$var

mixed

data to store

$ttl

integer

data time expiration

Response

boolean

false if failure

Properties

Memcached servers list

_servers : string
var
access

protected

Type(s)

string

Memcache API

_memcache : object
var

Memcache

access

protected

Type(s)

object

profil name used in the ini file

profil_name : string
var
access

public

Type(s)

string

active cache ?

enabled : boolean
var
access

public

Type(s)

boolean

TTL used

ttl : boolean
var
access

public

Type(s)

boolean

automatic cleaning process always disabled. This driver don't need automatic cleaning because Memcache have an internal cleaning mechanism

automatic_cleaning_factor : integer
var
access

public

Type(s)

integer