This repository was archived by the owner on Jul 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.php
More file actions
55 lines (48 loc) · 1.44 KB
/
Module.php
File metadata and controls
55 lines (48 loc) · 1.44 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
<?php
namespace HrPhp\Meetup;
use HrPhp\Meetup\Adapter\DMSClientAdapter;
use Zend\Mvc\MvcEvent;
use DMS\Service\Meetup\MeetupKeyAuthClient;
class Module
{
public function getConfig()
{
return include __DIR__.'/config/module.config.php';
}
public function onBootstrap(MvcEvent $mvcEvent)
{
}
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
public function getServiceConfig()
{
return array(
'factories' => array(
'DMSClient' => function ($sm) {
$settings = array(
'key' => $sm->get('config')['meetup']['api_key'],
);
return MeetupKeyAuthClient::factory($settings);
},
'DMSClientAdapter' => function ($sm) {
$adaptee = $sm->get('DMSClient');
return new DMSClientAdapter($adaptee);
},
'HrPhpMeetupClient' => function ($sm) {
$adapter = $sm->get('DMSClientAdapter');
$service = new Client();
$service->setAdapter($adapter);
return $service;
}
)
);
}
}