|
| 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 30 of file Store.php.
References $bucket, $config, $path, and SimpleSAML_Configuration\getConfig().
34 $path =
$config->getString(
'path',
'riak-php-client/riak.php');
35 $host =
$config->getString(
'host',
'localhost');
36 $port =
$config->getString(
'port', 8098);
40 $this->client = new \RiakClient($host, $port);
41 $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 99 of file Store.php.
References $type.
101 assert(is_string(
$type));
102 assert(is_string(
$key));
104 $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 51 of file Store.php.
References $key, and $type.
53 assert(is_string(
$type));
54 assert(is_string(
$key));
56 $v = $this->bucket->getBinary(
"$type.$key");
61 $expires = $v->getIndex(
'Expires',
'int');
62 if (
sizeof($expires) && (
int)array_shift($expires) <= time()) {
67 return (unserialize($v->getData()));
◆ 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 79 of file Store.php.
References $type.
81 assert(is_string(
$type));
82 assert(is_string(
$key));
85 $v = $this->bucket->newBinary(
"$type.$key", serialize($value),
'application/php');
87 $v->addIndex(
"Expires",
"int",
$expire);
◆ $bucket
sspmod_riak_Store_Store::$bucket |
◆ $client
sspmod_riak_Store_Store::$client |
The documentation for this class was generated from the following file:
- libs/composer/vendor/simplesamlphp/simplesamlphp/modules/riak/lib/Store/Store.php