dbCacheDriver
in package
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).
Tags
Interfaces, Classes and Traits
- jICacheDriver
- Interface for cache drivers.
Table of Contents
- $automatic_cleaning_factor : int
- 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.
- $enabled : bool
- active cache ?
- $profil_name : string
- profil name used in the ini file.
- $ttl : bool
- TTL used.
- $_dao : string
- name of the table mapping.
- $_dbprofile : string
- connexion dbprofile.
- $base64encoding : mixed
- 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.
- __construct() : mixed
- constructor.
- decrement() : bool
- decrement a specific data value by $var.
- delete() : bool
- delete a specific data in the cache.
- flush() : bool
- clear all data in the cache.
- garbage() : bool
- remove from the cache data of which TTL was expired.
- get() : mixed
- read a specific data in the cache.
- increment() : bool
- increment a specific data value by $var.
- replace() : bool
- replace a specific data value by $var.
- set() : bool
- set a specific data in the cache.
Properties
$automatic_cleaning_factor
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.
public
int
$automatic_cleaning_factor
= 0
$enabled
active cache ?
public
bool
$enabled
= rue
$profil_name
profil name used in the ini file.
public
string
$profil_name
$ttl
TTL used.
public
bool
$ttl
= 0
$_dao
name of the table mapping.
protected
string
$_dao
= 'jelix~jcache'
$_dbprofile
connexion dbprofile.
protected
string
$_dbprofile
= ''
$base64encoding
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.
protected
mixed
$base64encoding
= alse
Methods
__construct()
constructor.
public
__construct(mixed $params) : mixed
Parameters
- $params : mixed
-
driver parameters, written in the ini file
Return values
mixed —decrement()
decrement a specific data value by $var.
public
decrement(string $key[, mixed $var = 1 ]) : bool
Parameters
- $key : string
-
key used for storing data in the cache
- $var : mixed = 1
-
value used
Return values
bool —false if failure
delete()
delete a specific data in the cache.
public
delete(string $key) : bool
Parameters
- $key : string
-
key used for storing data in the cache
Return values
bool —false if failure
flush()
clear all data in the cache.
public
flush() : bool
Return values
bool —false if failure
garbage()
remove from the cache data of which TTL was expired.
public
garbage() : bool
Return values
bool —false if failure
get()
read a specific data in the cache.
public
get(mixed $key) : mixed
Parameters
- $key : mixed
-
key or array of keys used for storing data in the cache
Tags
Return values
mixed —$data data or false if failure
increment()
increment a specific data value by $var.
public
increment(string $key[, mixed $var = 1 ]) : bool
Parameters
- $key : string
-
key used for storing data in the cache
- $var : mixed = 1
-
value used
Return values
bool —false if failure
replace()
replace a specific data value by $var.
public
replace(string $key, mixed $var, int $ttl) : bool
Parameters
- $key : string
-
key used for storing data in the cache
- $var : mixed
-
data to replace
- $ttl : int
-
data time expiration
Return values
bool —false if failure
set()
set a specific data in the cache.
public
set(string $key, mixed $var, int $ttl) : bool
Parameters
- $key : string
-
key used for storing data
- $var : mixed
-
data to store
- $ttl : int
-
data time expiration. -1 means no change
Tags
Return values
bool —false if failure