PHP Class dbCacheDriver

Inheritance: implements jICacheDriver
Show file Open project: jelix/jelix

Public Properties

Property Type Description
$automatic_cleaning_factor integer 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 boolean active cache ?
$profil_name string profil name used in the ini file
$ttl boolean TTL used

Protected Properties

Property Type Description
$_dao string name of the table mapping.
$_dbprofile string connexion 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

Public Methods

Method Description
__construct ( $params )
decrement ( string $key, mixed $var = 1 ) : boolean decrement a specific data value by $var
delete ( string $key ) : boolean delete a specific data in the cache
flush ( ) : boolean clear all data in the cache
garbage ( ) : boolean remove from the cache data of which TTL was expired
get ( mixed $key ) : mixed read a specific data in the cache.
increment ( string $key, mixed $var = 1 ) : boolean increment a specific data value by $var
replace ( string $key, mixed $var, integer $ttl ) : boolean replace a specific data value by $var
set ( string $key, mixed $var, integer $ttl ) : boolean set a specific data in the cache

Method Details

__construct() public method

public __construct ( $params )

decrement() public method

decrement a specific data value by $var
public decrement ( string $key, mixed $var = 1 ) : boolean
$key string key used for storing data in the cache
$var mixed value used
return boolean false if failure

delete() public method

delete a specific data in the cache
public delete ( string $key ) : boolean
$key string key used for storing data in the cache
return boolean false if failure

flush() public method

clear all data in the cache
public flush ( ) : boolean
return boolean false if failure

garbage() public method

remove from the cache data of which TTL was expired
public garbage ( ) : boolean
return boolean false if failure

get() public method

read a specific data in the cache.
public get ( mixed $key ) : mixed
$key mixed key or array of keys used for storing data in the cache
return mixed $data data or false if failure

increment() public method

increment a specific data value by $var
public increment ( string $key, mixed $var = 1 ) : boolean
$key string key used for storing data in the cache
$var mixed value used
return boolean false if failure

replace() public method

replace a specific data value by $var
public replace ( string $key, mixed $var, integer $ttl ) : boolean
$key string key used for storing data in the cache
$var mixed data to replace
$ttl integer data time expiration
return boolean false if failure

set() public method

set a specific data in the cache
public set ( string $key, mixed $var, integer $ttl ) : boolean
$key string key used for storing data
$var mixed data to store
$ttl integer data time expiration. -1 means no change
return boolean false if failure

Property Details

$_dao protected property

name of the table mapping.
protected string $_dao
return string

$_dbprofile protected property

connexion dbprofile
protected string $_dbprofile
return string

$automatic_cleaning_factor public property

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
return integer

$base64encoding protected property

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 $base64encoding

$enabled public property

active cache ?
public bool $enabled
return boolean

$profil_name public property

profil name used in the ini file
public string $profil_name
return string

$ttl public property

TTL used
public bool $ttl
return boolean