-
Notifications
You must be signed in to change notification settings - Fork 7
/
Module.php
57 lines (50 loc) · 1.88 KB
/
Module.php
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
<?php
namespace HtSession;
use Zend\Mvc\MvcEvent;
use Zend\Http\Request as HttpRequest;
class Module
{
public function onBootstrap(MvcEvent $e)
{
$serviceManager = $e->getApplication()->getServiceManager();
$request = $serviceManager->get('Request');
if ($request instanceof HttpRequest) {
$sessionManager = $serviceManager->get('HtSession\Session\Manager');
$sessionBootstraper = new Session\BootstrapSession($sessionManager);
$sessionBootstraper->bootstrap();
}
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getAutoloaderConfig()
{
return array(
"Zend\Loader\ClassMapAutoloader" => array(
__DIR__ . "/autoload_classmap.php",
),
"Zend\Loader\StandardAutoloader" => array(
"namespaces" => array(
__NAMESPACE__ => __DIR__ . "/src",
),
),
);
}
public function getServiceConfig()
{
return array(
'factories' => array(
'HtSession\Session\Manager' => 'HtSession\Factory\SessionManagerFactory',
'HtSession\ModuleOptions' => 'HtSession\Factory\ModuleOptionsFactory',
'HtSession\DefaultSessionSetSaveHandler' => 'HtSession\Factory\SessionSetSaveHandlerFactory',
'HtSession\DoctrineDbalSessionSetSaveHandler' => 'HtSession\Factory\DoctrineDbalSessionSetSaveHandlerFactory',
'HtSession\Service\ValidatorPluginManager' => 'HtSession\Factory\ValidatorPluginManagerFactory',
),
'aliases' => array(
'HtSession\SessionSetSaveHandler' => 'HtSession\DefaultSessionSetSaveHandler',
'HtSessionDbAdapter' => 'Zend\Db\Adapter\Adapter',
)
);
}
}