forked from n0v3xx/MQRedisSessionStorage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.php
More file actions
58 lines (50 loc) · 1.45 KB
/
Copy pathModule.php
File metadata and controls
58 lines (50 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* This file is part of the MQRedisSessionStorage Module (https://github.com/milqmedia/MQRedisSessionStorage.git)
*
* Copyright (c) 2013 Milq Media (https://github.com/milqmedia/MQRedisSessionStorage.git)
*
* For the full copyright and license information, please view
* the file LICENSE.txt that was distributed with this source code.
*/
namespace MQRedisSessionStorage;
/**
* Class Module
* @package MQRedisSessionStorage
*/
class Module
{
/**
* @param \Zend\Mvc\MvcEvent $e
*/
public function onBootstrap(\Zend\Mvc\MvcEvent $e)
{
$config = $e->getApplication()->getConfig();
if($config['mq-redis-session']['set_storage_on_boot'] === true) {
$storage = $e->getApplication()->getServiceManager()->get('MQRedisSessionStorage\Storage\RedisStorage');
try {
$storage->setSessionStorage();
} catch(\Zend\Cache\Exception\InvalidArgumentException $e) {
// Todo: Need to do some logging one time over here
}
}
}
/**
* @return mixed
*/
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
/**
* @return array
*/
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
);
}
}