1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ZfcUser; |
4
|
|
|
|
5
|
|
|
use Zend\ModuleManager\Feature\AutoloaderProviderInterface; |
6
|
|
|
use Zend\ModuleManager\Feature\ConfigProviderInterface; |
7
|
|
|
use Zend\ModuleManager\Feature\ControllerProviderInterface; |
8
|
|
|
use Zend\ModuleManager\Feature\FormElementProviderInterface; |
9
|
|
|
use Zend\ModuleManager\Feature\ServiceProviderInterface; |
10
|
|
|
use Zend\ModuleManager\Feature\ViewHelperProviderInterface; |
11
|
|
|
|
12
|
|
|
class Module implements |
13
|
|
|
AutoloaderProviderInterface, |
14
|
|
|
ConfigProviderInterface, |
15
|
|
|
ServiceProviderInterface, |
16
|
|
|
ViewHelperProviderInterface, |
17
|
|
|
FormElementProviderInterface, |
18
|
|
|
ControllerProviderInterface |
19
|
|
|
{ |
20
|
|
|
public function getAutoloaderConfig() |
21
|
|
|
{ |
22
|
|
|
return array( |
23
|
|
|
'Zend\Loader\ClassMapAutoloader' => array( |
24
|
|
|
__DIR__ . '/autoload_classmap.php', |
25
|
|
|
), |
26
|
|
|
'Zend\Loader\StandardAutoloader' => array( |
27
|
|
|
'namespaces' => array( |
28
|
|
|
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, |
29
|
|
|
), |
30
|
|
|
), |
31
|
|
|
); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function getConfig($env = null) |
35
|
|
|
{ |
36
|
|
|
return include __DIR__ . '/config/module.config.php'; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function getControllerPluginConfig() |
40
|
|
|
{ |
41
|
|
|
return array( |
42
|
|
|
'factories' => array( |
43
|
|
|
'zfcUserAuthentication' => 'ZfcUser\Factory\Controller\Plugin\ZfcUserAuthentication', |
44
|
|
|
), |
45
|
|
|
); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function getControllerConfig() |
49
|
|
|
{ |
50
|
|
|
return array( |
51
|
|
|
'factories' => array( |
52
|
|
|
'zfcuser' => 'ZfcUser\Factory\Controller\UserControllerFactory', |
53
|
|
|
), |
54
|
|
|
); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function getViewHelperConfig() |
58
|
|
|
{ |
59
|
|
|
return array( |
60
|
|
|
'factories' => array( |
61
|
|
|
'zfcUserDisplayName' => 'ZfcUser\Factory\View\Helper\ZfcUserDisplayName', |
62
|
|
|
'zfcUserIdentity' => 'ZfcUser\Factory\View\Helper\ZfcUserIdentity', |
63
|
|
|
'zfcUserLoginWidget' => 'ZfcUser\Factory\View\Helper\ZfcUserLoginWidget', |
64
|
|
|
), |
65
|
|
|
); |
66
|
|
|
|
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function getServiceConfig() |
70
|
|
|
{ |
71
|
|
|
return array( |
72
|
|
|
'aliases' => array( |
73
|
|
|
'zfcuser_zend_db_adapter' => 'Zend\Db\Adapter\Adapter', |
74
|
|
|
), |
75
|
|
|
'invokables' => array( |
76
|
|
|
'zfcuser_register_form_hydrator' => 'Zend\Stdlib\Hydrator\ClassMethods', |
77
|
|
|
), |
78
|
|
|
'factories' => array( |
79
|
|
|
'ZfcUser\Authentication\Adapter\Db' => 'ZfcUser\Factory\Authentication\Adapter\Db', |
80
|
|
|
'ZfcUser\Authentication\Storage\Db' => 'ZfcUser\Factory\Authentication\Storage\Db', |
81
|
|
|
'zfcuser_user_service' => 'ZfcUser\Factory\Service\User', |
82
|
|
|
'zfcuser_redirect_callback' => 'ZfcUser\Factory\Controller\RedirectCallbackFactory', |
83
|
|
|
'zfcuser_module_options' => 'ZfcUser\Factory\Options\ModuleOptions', |
84
|
|
|
'ZfcUser\Authentication\Adapter\AdapterChain' => 'ZfcUser\Authentication\Adapter\AdapterChainServiceFactory', |
85
|
|
|
|
86
|
|
|
// We alias this one because it's ZfcUser's instance of |
87
|
|
|
// Zend\Authentication\AuthenticationService. We don't want to |
88
|
|
|
// hog the FQCN service alias for a Zend\* class. |
89
|
|
|
'zfcuser_auth_service' => 'ZfcUser\Factory\AuthenticationService', |
90
|
|
|
|
91
|
|
|
'zfcuser_user_hydrator' => 'ZfcUser\Factory\UserHydrator', |
92
|
|
|
'zfcuser_user_mapper' => 'ZfcUser\Factory\Mapper\User', |
93
|
|
|
), |
94
|
|
|
); |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* Expected to return \Zend\ServiceManager\Config object or array to |
99
|
|
|
* seed such an object. |
100
|
|
|
* |
101
|
|
|
* @return array|\Zend\ServiceManager\Config |
102
|
|
|
*/ |
103
|
|
|
public function getFormElementConfig() |
104
|
|
|
{ |
105
|
|
|
return array( |
106
|
|
|
'factories' => array( |
107
|
|
|
'zfcuser_login_form' => 'ZfcUser\Factory\Form\Login', |
108
|
|
|
'zfcuser_register_form' => 'ZfcUser\Factory\Form\Register', |
109
|
|
|
'zfcuser_change_password_form' => 'ZfcUser\Factory\Form\ChangePassword', |
110
|
|
|
'zfcuser_change_email_form' => 'ZfcUser\Factory\Form\ChangeEmail', |
111
|
|
|
), |
112
|
|
|
); |
113
|
|
|
} |
114
|
|
|
} |
115
|
|
|
|