file2KVDriver
extends jKVDriver
in package
Tags
Table of Contents
- $_connection : object|resource
- Name of the driver.
- $_driverName : string
- Name of the driver.
- $_profile : array<string|int, mixed>
- Profile for the connection in the kvdb INIfile.
- $_profileName : string
- name of the profile
- $dir : mixed
- __construct() : void
- Class constructor
- __destruct() : void
- Class destructor
- append() : string
- append a string to an existing key value
- decrement() : int
- decrement a value by $decr. the key should exist and should be an integer.
- delete() : bool
- Deletes a key from the KVdb.
- flush() : bool
- Flush the KVDb. Deletes all keys.
- get() : string
- Gets one or several values;
- increment() : int
- increment a value by $incr. the key should exist and should be an integer.
- insert() : bool
- Store a key/value. If the key already exist : error
- prepend() : string
- prepend a string to an existing key value
- replace() : bool
- Store a key/value. The key should exists
- set() : bool
- Store a key/value.
- _connect() : fileServer
- "Connects" to the fileServer
- _disconnect() : mixed
- isResource() : mixed
Properties
$_connection
Name of the driver.
protected
object|resource
$_connection
=
ull
$_driverName
Name of the driver.
protected
string
$_driverName
$_profile
Profile for the connection in the kvdb INIfile.
protected
array<string|int, mixed>
$_profile
$_profileName
name of the profile
protected
string
$_profileName
$dir
protected
mixed
$dir
Methods
__construct()
Class constructor
public
__construct(array<string|int, mixed> $profile) : void
Initialise profile data and create the main object
Parameters
- $profile : array<string|int, mixed>
Return values
void —__destruct()
Class destructor
public
__destruct() : void
Return values
void —append()
append a string to an existing key value
public
append(mixed $key, mixed $value) : string
Parameters
- $key : mixed
-
the key of the value to modify
- $value : mixed
-
the value to append to the current key value
Return values
string —the new value or false if failure
decrement()
decrement a value by $decr. the key should exist and should be an integer.
public
decrement(mixed $key[, mixed $decr = 1 ]) : int
Parameters
- $key : mixed
-
the key of the value
- $decr : mixed = 1
-
the value to substract to the current value
Return values
int —the result, or false if failure
delete()
Deletes a key from the KVdb.
public
delete(mixed $key) : bool
Parameters
- $key : mixed
-
the key
Return values
bool —false if failure
flush()
Flush the KVDb. Deletes all keys.
public
flush() : bool
Return values
bool —true if it is a success
get()
Gets one or several values;
public
get(mixed $key) : string
Parameters
- $key : mixed
-
a key or an array of keys
Return values
string —or null if the key doesn't exist
increment()
increment a value by $incr. the key should exist and should be an integer.
public
increment(mixed $key[, mixed $incr = 1 ]) : int
Parameters
- $key : mixed
-
the key of the value
- $incr : mixed = 1
-
the value to add to the current value
Return values
int —the result, or false if failure
insert()
Store a key/value. If the key already exist : error
public
insert(mixed $key, mixed $value) : bool
Parameters
- $key : mixed
-
the key
- $value : mixed
Return values
bool —false if failure
prepend()
prepend a string to an existing key value
public
prepend(mixed $key, mixed $value) : string
Parameters
- $key : mixed
-
the key of the value to modify
- $value : mixed
-
the value to prepend to the current key value
Return values
string —the new value or false if failure
replace()
Store a key/value. The key should exists
public
replace(mixed $key, mixed $value) : bool
Parameters
- $key : mixed
-
the key
- $value : mixed
Return values
bool —false if failure
set()
Store a key/value.
public
set(mixed $key, mixed $value) : bool
Parameters
- $key : mixed
-
the key
- $value : mixed
Return values
bool —false if failure, if the value is a resource...
_connect()
"Connects" to the fileServer
protected
_connect() : fileServer
Tags
Return values
fileServer —object
_disconnect()
protected
_disconnect() : mixed
Return values
mixed —isResource()
protected
isResource(mixed $value) : mixed
Parameters
- $value : mixed