-
Notifications
You must be signed in to change notification settings - Fork 61
/
Module.php
executable file
·58 lines (52 loc) · 1.48 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
51
52
53
54
55
56
57
58
<?php
namespace AsseticBundle;
use Zend\EventManager\EventInterface;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\BootstrapListenerInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
class Module implements
AutoloaderProviderInterface,
ConfigProviderInterface,
BootstrapListenerInterface
{
/**
* Listen to the bootstrap event
*
* @param \Zend\EventManager\EventInterface $e
*
* @return array
*/
public function onBootstrap(EventInterface $e)
{
/** @var $e \Zend\Mvc\MvcEvent */
// Only attach the Listener if the request came in through http(s)
if (PHP_SAPI !== 'cli') {
$app = $e->getApplication();
$app->getServiceManager()->get('AsseticBundle\Listener')->attach($app->getEventManager());
}
}
/**
* Returns configuration to merge with application configuration
*
* @return array|\Traversable
*/
public function getConfig()
{
return require __DIR__ . '/configs/module.config.php';
}
/**
* Return an array for passing to Zend\Loader\AutoloaderFactory.
*
* @return array
*/
public function getAutoloaderConfig()
{
return [
'Zend\Loader\StandardAutoloader' => [
'namespaces' => [
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__ . '/'
],
],
];
}
}