-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.php
More file actions
86 lines (78 loc) · 3.52 KB
/
Module.php
File metadata and controls
86 lines (78 loc) · 3.52 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
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
<?php
namespace FdlGatewayManager;
class Module
{
public function init($moduleManager)
{
$config = $this->getConfig();
$listener = $moduleManager->getEvent()->getParam('ServiceManager')->get('ServiceListener');
$listener->addServiceManager(
$config['fdl_service_listener_options']['service_manager'],
$config['fdl_service_listener_options']['config_key'],
$config['fdl_service_listener_options']['interface'],
$config['fdl_service_listener_options']['method']
);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
public function getServiceConfig()
{
return array(
'invokables' => array(
'FdlAdapterPreparerUtility' => 'FdlGatewayManager\Utils\AdapterPreparerUtility',
'FdlGatewayFactoryUtilities' => 'FdlGatewayManager\Utils\GatewayFactoryUtilities',
'FdlAdapterManager' => 'FdlGatewayManager\AdapterManager',
'FdlGatewayFactory' => 'FdlGatewayManager\GatewayFactory',
'FdlGatewayWorkerEvent' => 'FdlGatewayManager\GatewayWorkerEvent',
'FdlGatewayFactoryEvent' => 'FdlGatewayManager\GatewayFactoryEvent',
'FdlGatewayWorkerEventListeners' => 'FdlGatewayManager\GatewayWorkerEventListeners',
),
'factories' => array(
'FdlGatewayPlugin' => 'FdlGatewayManager\Service\FdlGatewayPluginFactory',
'FdlEntityFactory' => 'FdlGatewayManager\Factory\EntityServiceFactory',
'FdlTableServiceFactory' => 'FdlGatewayManager\Factory\TableServiceFactory',
'FdlTableGatewayServiceFactory' => 'FdlGatewayManager\Factory\TableGatewayServiceFactory',
'FdlGatewayManager' => function ($sm) {
return new GatewayManager($sm);
},
),
'abstract_factories' => array(
'FdlGatewayManager\AbstractFactory\AdapterServiceAbstractFactory',
'FdlGatewayManager\AbstractFactory\FeaturesServiceAbstractFactory',
'FdlGatewayManager\AbstractFactory\ResultSetPrototypeServiceAbstractFactory',
),
'shared' => array(
// worker factories
'FdlGatewayWorkerEvent' => false,
'FdlGatewayWorkerEventListeners' => false,
// event factories
'FdlTableServiceFactory' => false,
'FdlEntityFactory' => false,
'FdlTableGatewayServiceFactory' => false,
// abstract factories
'FdlTableGateway\Adapter' => false,
'FdlTableGateway\Features' => false,
'FdlTableGateway\ResultSetPrototype' => false,
),
'initializers' => array(
function ($instance, $sm) {
if ($instance instanceof GatewayPluginAwareInterface) {
$instance->setGatewayPlugin($sm->get('FdlGatewayPlugin'));
}
},
),
);
}
}