Property | Type | Description | |
---|---|---|---|
$config | Config class. | ||
$database | Database class. |
Method | Description | |
---|---|---|
__construct ( |
Constructor. | |
delete ( string $key ) | Delete a key from the database. | |
flush ( ) | Flush the database. | |
get ( string $key ) : mixed | Get a key from the database. | |
getAll ( ) : array | Get all data from the database. | |
getConfig ( ) : |
Get the config. | |
getDatabase ( ) : |
Get the database. | |
getKeys ( ) : array | Get all keys from the database. | |
set ( string $key, mixed $data ) | Set a key in the database. | |
setConfig ( |
Set the config. | |
setDatabase ( |
Set the database. |
Method | Description | |
---|---|---|
decodeData ( string $data ) : mixed | Decode a string into data. | |
encodeData ( mixed $data ) : string | Encode data into a string. | |
getDataFromLine ( string $line, string $key ) : string | boolean | Retrieve data from a given line for a specific key. | |
getKeyFromLine ( string $line ) : string | Retrieve key from a given line. | |
getLinePieces ( string $line ) : array | Retrieve the pieces from a given line. | |
getLineString ( string $key, mixed $data ) : string | Get the line string to write. | |
replace ( string $key, mixed $data ) | Replace a key in the database. | |
validateData ( mixed $data ) | Check the data type is valid. | |
validateKey ( string $key ) | Validate the key. |
public __construct ( |
||
$database | ||
$config |
protected decodeData ( string $data ) : mixed | ||
$data | string | |
return | mixed |
protected encodeData ( mixed $data ) : string | ||
$data | mixed | |
return | string |
protected getKeyFromLine ( string $line ) : string | ||
$line | string | |
return | string |
protected getLinePieces ( string $line ) : array | ||
$line | string | |
return | array |
public setDatabase ( |
||
$database |
protected validateData ( mixed $data ) | ||
$data | mixed | the data |