-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModule.php
40 lines (34 loc) · 1 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
<?php
/**
* Shoplift\RouteFilter - Easy per-route input filtering for ZF2 / Apigility apps
*
* @copyright (c) 2015 Shoppimon LTD
*/
namespace Shoplift\RouteFilter;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\Mvc\MvcEvent;
class Module implements AutoloaderProviderInterface
{
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/',
),
),
);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function onBootstrap(MvcEvent $e)
{
$app = $e->getApplication();
$services = $app->getServiceManager();
$events = $app->getEventManager();
$listener = $services->get('Shoplift\RouteFilter\RouteListener'); /* */
$events->attach(MvcEvent::EVENT_ROUTE, $listener, -1000);
}
}