|
| get ($type, $key) |
| Retrieve a value from the datastore. More...
|
|
| set ($type, $key, $value, $expire=NULL) |
| Save a value to the datastore. More...
|
|
| delete ($type, $key) |
| Delete a value from the datastore. More...
|
|
| get ($type, $key) |
| Retrieve a value from the data store. More...
|
|
| set ($type, $key, $value, $expire=null) |
| Save a value to the data store. More...
|
|
| delete ($type, $key) |
| Delete a value from the data store. More...
|
|
Definition at line 25 of file Store.php.
◆ __construct()
sspmod_riak_Store_Store::__construct |
( |
| ) |
|
|
protected |
Definition at line 26 of file Store.php.
References $config, $path, and SimpleSAML_Configuration\getConfig().
29 $path =
$config->getString(
'path',
'riak-php-client/riak.php');
30 $host =
$config->getString(
'host',
'localhost');
31 $port =
$config->getString(
'port', 8098);
32 $bucket =
$config->getString(
'bucket',
'simpleSAMLphp');
35 $this->client = new \RiakClient($host, $port);
36 $this->bucket = $this->client->bucket($bucket);
static getConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
◆ delete()
sspmod_riak_Store_Store::delete |
( |
|
$type, |
|
|
|
$key |
|
) |
| |
Delete a value from the datastore.
- Parameters
-
string | $type | The datatype. |
string | $key | The key. |
Definition at line 92 of file Store.php.
93 assert(
'is_string($type)');
94 assert(
'is_string($key)');
96 $v = $this->bucket->getBinary(
"$type.$key");
◆ get()
sspmod_riak_Store_Store::get |
( |
|
$type, |
|
|
|
$key |
|
) |
| |
Retrieve a value from the datastore.
- Parameters
-
string | $type | The datatype. |
string | $key | The key. |
- Returns
- mixed|NULL The value.
Definition at line 46 of file Store.php.
References time.
47 assert(
'is_string($type)');
48 assert(
'is_string($key)');
50 $v = $this->bucket->getBinary(
"$type.$key");
55 $expires = $v->getIndex(
'Expires',
'int');
56 if (
sizeof($expires) && (
int)array_shift($expires) <=
time()) {
61 return (unserialize($v->getData()));
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
◆ set()
sspmod_riak_Store_Store::set |
( |
|
$type, |
|
|
|
$key, |
|
|
|
$value, |
|
|
|
$expire = NULL |
|
) |
| |
Save a value to the datastore.
- Parameters
-
string | $type | The datatype. |
string | $key | The key. |
mixed | $value | The value. |
int | NULL | $expire | The expiration time (unix timestamp), or NULL if it never expires. |
Definition at line 73 of file Store.php.
74 assert(
'is_string($type)');
75 assert(
'is_string($key)');
76 assert(
'is_null($expire) || (is_int($expire) && $expire > 2592000)');
78 $v = $this->bucket->newBinary(
"$type.$key", serialize($value),
'application/php');
80 $v->addIndex(
"Expires",
"int",
$expire);
The documentation for this class was generated from the following file:
- libs/composer/vendor/simplesamlphp/simplesamlphp/modules/riak/lib/Store/Store.php