dbCacheDriver

Implements \jICacheDriver

cache driver for data stored in a database Warning : Beware about the time returned by the DBMS of the server and the server PHP client : possible asynchronous time (particulary in case of use of multiple servers, incoherent data can be involved).

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

garbage() : boolean

Response

boolean

false if failure

read a specific data in the cache.

get(mixed $key) : mixed
Throws
\jException

Arguments

$key

mixed

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

Response

mixed

$data 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
Throws
\jException

Arguments

$key

string

key used for storing data

$var

mixed

data to store

$ttl

integer

data time expiration. -1 means no change

Response

boolean

false if failure

Properties

name of the table mapping.

_dao : string
var
access

protected

Type(s)

string

connexion dbprofile

_dbprofile : string
var
access

protected

Type(s)

string

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 0 means disabled, 1 means systematic cache cleaning of expired data (at each set or add call), greater values mean less frequent cleaning

automatic_cleaning_factor : integer
var
access

public

Type(s)

integer

for some sqlite version, it seems it doesn't support very well result of php serialization. This flags indicates to encode values before storing them

base64encoding : 

Type(s)