memcacheKVDriver

Extends \jKVDriver Implements \jIKVttl

package

jelix

subpackage

kvdb_plugin

author

Yannick Le Guédart

contributor

Laurent Jouanneau

copyright

2009 Yannick Le Guédart, 2010 Laurent Jouanneau

link

http://www.jelix.org

licence

http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file

see

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

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 specific data with a ttl

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

Arguments

$key

string

key used for storing data

$value

string

the value

$ttl

integer

data time expiration

Response

boolean

false if failure

Properties

Array of StdClass objects that contains host/port attributes for the memcache servers. Used only during _connection.

_servers : array
var

Type(s)

array

Should the data be compressed ? This feature is implemented sometimes in memcached drivers, and works sometimes.

_compress : boolean

..

var

Type(s)

boolean

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