forked from LM-Commons/LmcUser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.php
116 lines (102 loc) · 4.03 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
declare(strict_types=1);
namespace LmcUser;
use Laminas\Hydrator\ClassMethodsHydrator;
use Laminas\ModuleManager\Feature\ConfigProviderInterface;
use Laminas\ModuleManager\Feature\ControllerPluginProviderInterface;
use Laminas\ModuleManager\Feature\ControllerProviderInterface;
use Laminas\ModuleManager\Feature\ServiceProviderInterface;
use Laminas\ModuleManager\Feature\ViewHelperProviderInterface;
/**
* Class Module
*/
class Module implements
ConfigProviderInterface,
ControllerPluginProviderInterface,
ControllerProviderInterface,
ServiceProviderInterface,
ViewHelperProviderInterface
{
public const LMC_USER_SESSION_STORAGE_NAMESPACE = 'LmcUserNamespace';
/**
* {@inheritDoc}
* @see \Laminas\ModuleManager\Feature\ConfigProviderInterface::getConfig()
*/
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
/**
* {@inheritDoc}
* @see \Laminas\ModuleManager\Feature\ControllerPluginProviderInterface::getControllerPluginConfig()
*/
public function getControllerPluginConfig()
{
return [
'factories' => [
'lmcUserAuthentication' => Factory\Controller\Plugin\LmcUserAuthentication::class,
],
];
}
/**
* {@inheritDoc}
* @see \Laminas\ModuleManager\Feature\ControllerProviderInterface::getControllerConfig()
*/
public function getControllerConfig()
{
return [
'factories' => [
'lmcuser' => Factory\Controller\UserControllerFactory::class,
],
];
}
/**
* {@inheritDoc}
* @see \Laminas\ModuleManager\Feature\ViewHelperProviderInterface::getViewHelperConfig()
*/
public function getViewHelperConfig()
{
return [
'factories' => [
'lmcUserDisplayName' => Factory\View\Helper\LmcUserDisplayName::class,
'lmcUserIdentity' => Factory\View\Helper\LmcUserIdentity::class,
'lmcUserLoginWidget' => Factory\View\Helper\LmcUserLoginWidget::class,
],
];
}
/**
* {@inheritDoc}
* @see \Laminas\ModuleManager\Feature\ServiceProviderInterface::getServiceConfig()
*/
public function getServiceConfig()
{
return [
'aliases' => [
'lmcuser_laminas_db_adapter' => \Laminas\Db\Adapter\Adapter::class,
'lmcuser_register_form_hydrator' => 'lmcuser_user_hydrator',
'lmcuser_base_hydrator' => 'lmcuser_default_hydrator',
],
'invokables' => [
'lmcuser_default_hydrator' => ClassMethodsHydrator::class,
],
'factories' => [
'lmcuser_redirect_callback' => Factory\Controller\RedirectCallbackFactory::class,
'lmcuser_module_options' => Factory\Options\ModuleOptions::class,
Authentication\Adapter\AdapterChain::class => Authentication\Adapter\AdapterChainServiceFactory::class,
// We alias this one because it's LmcUser's instance of
// Laminas\Authentication\AuthenticationService. We don't want to
// hog the FQCN service alias for a Laminas\* class.
'lmcuser_auth_service' => Factory\AuthenticationService::class,
'lmcuser_user_hydrator' => Factory\UserHydrator::class,
'lmcuser_user_mapper' => Factory\Mapper\User::class,
'lmcuser_login_form' => Factory\Form\Login::class,
'lmcuser_register_form' => Factory\Form\Register::class,
'lmcuser_change_password_form' => Factory\Form\ChangePassword::class,
'lmcuser_change_email_form' => Factory\Form\ChangeEmail::class,
Authentication\Adapter\Db::class => Factory\Authentication\Adapter\DbFactory::class,
Authentication\Storage\Db::class => Factory\Authentication\Storage\DbFactory::class,
'lmcuser_user_service' => Factory\Service\UserFactory::class,
],
];
}
}