dbKVDriver

Extends \jKVDriver Implements \jIKVttl, \jIKVPersistent

Driver for jKVDB, that uses an SQL table to store key/value data.

package

jelix

Methods

Class constructor

__construct(array $profile) : void
inherited

Initialise profile data and create the main object

Arguments

$profile

array

Class destructor

__destruct() : void
inherited

_connect

_connect() 
inherited abstract

_disconnect

_disconnect() 
inherited abstract

_set

_set( $key,  $value,  $expire) 

Arguments

$key

$value

$expire

append a string to an existing key value

append(string $key, string $value) : string
inherited abstract

Arguments

$key

string

the key of the value to modify

$value

string

the value to append to the current key value

Response

string

the new value or false if failure

decrement a value by $decr. the key should exist and should be an integer.

decrement(string $key, mixed $decr = 1) : integer
inherited abstract

Arguments

$key

string

the key of the value

$decr

mixed

the value to substract to the current value

Response

integer

the result, or false if failure

Deletes a key from the KVdb.

delete(string $key) : boolean
inherited abstract

Arguments

$key

string

the key

Response

boolean

false if failure

Flush the KVDb. Deletes all keys.

flush() : boolean
inherited abstract

Response

boolean

true if it is a success

delete all keys which are not any more valid

garbage() : boolean

Response

boolean

false if failure

Gets one or several values;

get(string|array $key) : string
inherited abstract

Arguments

$key

string|array

a key or an array of keys

Response

string

or null if the key doesn't exist

increment a value by $incr. the key should exist and should be an integer.

increment(string $key, mixed $incr = 1) : integer
inherited abstract

Arguments

$key

string

the key of the value

$incr

mixed

the value to add to the current value

Response

integer

the result, or false if failure

Store a key/value. If the key already exist : error

insert(string $key, string $value) : boolean
inherited abstract

Arguments

$key

string

the key

$value

string

Response

boolean

false if failure

prepend a string to an existing key value

prepend(string $key, string $value) : string
inherited abstract

Arguments

$key

string

the key of the value to modify

$value

string

the value to prepend to the current key value

Response

string

the new value or false if failure

Store a key/value. The key should exists

replace(string $key, string $value) : boolean
inherited abstract

Arguments

$key

string

the key

$value

string

Response

boolean

false if failure

Store a key/value.

set(string $key, string $value) : boolean
inherited abstract

Arguments

$key

string

the key

$value

string

Response

boolean

false if failure, if the value is a resource...

set a key/value with a ttl value

setWithTtl(string $key, string $value, integer $ttl) : boolean

Arguments

$key

string

the key

$value

string

the value

$ttl

integer

the time to live in seconds...

Response

boolean

false if failure, if the value is a resource...

synchronize the memory content with the persistent storage

sync() 

Properties

table

table : 

Type(s)

Profile for the connection in the kvdb INIfile.

_profile : array
inherited
var

Type(s)

array

Name of the driver.

_driverName : string
inherited
var

Type(s)

string

name of the profile

_profileName : string
inherited
var

Type(s)

string

Name of the driver.

_connection : object|resource
inherited
var

Type(s)

object|resource