ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SimpleSAML\Store Class Reference
+ Inheritance diagram for SimpleSAML\Store:
+ Collaboration diagram for SimpleSAML\Store:

Public Member Functions

 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...
 

Static Public Member Functions

static getInstance ()
 Retrieve our singleton instance. More...
 

Static Private Attributes

static $instance
 

Detailed Description

Definition at line 12 of file Store.php.

Member Function Documentation

◆ delete()

SimpleSAML\Store::delete (   $type,
  $key 
)
abstract

Delete a value from the data store.

Parameters
string$typeThe data type.
string$keyThe key.

Reimplemented in SimpleSAML\Store\Memcache, SimpleSAML\Store\Redis, SimpleSAML\Store\SQL, and sspmod_riak_Store_Store.

◆ get()

SimpleSAML\Store::get (   $type,
  $key 
)
abstract

Retrieve a value from the data store.

Parameters
string$typeThe data type.
string$keyThe key.
Returns
mixed|null The value.

Reimplemented in SimpleSAML\Store\Memcache, SimpleSAML\Store\Redis, SimpleSAML\Store\SQL, and sspmod_riak_Store_Store.

◆ getInstance()

static SimpleSAML\Store::getInstance ( )
static

Retrieve our singleton instance.

Returns
false|\SimpleSAML\Store The data store, or false if it isn't enabled.
Exceptions

SimpleSAML\Error\CriticalConfigurationError

Definition at line 31 of file Store.php.

32 {
33 if (self::$instance !== null) {
34 return self::$instance;
35 }
36
38 $storeType = $config->getString('store.type', null);
39 if ($storeType === null) {
40 $storeType = $config->getString('session.handler', 'phpsession');
41 }
42
43 switch ($storeType) {
44 case 'phpsession':
45 // we cannot support advanced features with the PHP session store
46 self::$instance = false;
47 break;
48 case 'memcache':
49 self::$instance = new Store\Memcache();
50 break;
51 case 'sql':
52 self::$instance = new Store\SQL();
53 break;
54 case 'redis':
55 self::$instance = new Store\Redis();
56 break;
57 default:
58 // datastore from module
59 try {
60 $className = Module::resolveClass($storeType, 'Store', '\SimpleSAML\Store');
61 } catch (\Exception $e) {
62 $c = $config->toArray();
63 $c['store.type'] = 'phpsession';
64 throw new CriticalConfigurationError(
65 "Invalid 'store.type' configuration option. Cannot find store '$storeType'.",
66 null,
67 $c
68 );
69 }
70 self::$instance = new $className();
71 }
72
73 return self::$instance;
74 }
static resolveClass($id, $type, $subclass=null)
Resolve module class.
Definition: Module.php:252
static $instance
Definition: Store.php:21
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.

References $config, and SimpleSAML_Configuration\getInstance().

Referenced by sspmod_saml_SP_LogoutStore\addSession(), and sspmod_saml_IdP_SQLNameID\getStore().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set()

SimpleSAML\Store::set (   $type,
  $key,
  $value,
  $expire = null 
)
abstract

Save a value to the data store.

Parameters
string$typeThe data type.
string$keyThe key.
mixed$valueThe value.
int | null$expireThe expiration time (unix timestamp), or null if it never expires.

Reimplemented in SimpleSAML\Store\Memcache, SimpleSAML\Store\Redis, SimpleSAML\Store\SQL, and sspmod_riak_Store_Store.

Field Documentation

◆ $instance

SimpleSAML\Store::$instance
staticprivate

Definition at line 21 of file Store.php.


The documentation for this class was generated from the following file: