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