-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathModule.php
50 lines (44 loc) · 1.26 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
<?php
/*
* Murilo Amaral (http://muriloamaral.com)
* Édipo Rebouças (http://edipo.com.br).
*
* @link https://github.com/muriloacs/Middleware
*
* @copyright Copyright (c) 2015 Murilo Amaral
* @license The MIT License (MIT)
*
* @since File available since Release 1.0
*/
namespace Middleware;
use Middleware\Listener\MiddlewareListener;
use Zend\EventManager\EventInterface;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
class Module implements
ConfigProviderInterface,
AutoloaderProviderInterface
{
public function onBootstrap(EventInterface $e)
{
$eventManager = $e->getTarget()->getEventManager();
$eventManager->attach(new MiddlewareListener());
}
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__,
),
),
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__.'/autoload_classmap.php',
),
);
}
}