Retrieve our singleton instance.
32 {
33 if (self::$instance !== null) {
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
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
59 try {
61 } catch (\Exception $e) {
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
74 }
static resolveClass($id, $type, $subclass=null)
Resolve module class.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.