-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.php
53 lines (47 loc) · 1.41 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
<?php
namespace Reliv\SymfonizeZF;
use Reliv\SymfonizeZF\Loader\BundleLoader;
use Zend\Mvc\MvcEvent;
class Module
{
protected $appConfigPath = 'config/application.config.php';
public static $symfonizeConfig = [];
/**
* Constructor
*/
public function __construct()
{
//Ignore if no file to keep ZF controller unit tests working
if (file_exists($this->appConfigPath)) {
$appConfig = require($this->appConfigPath);
self::$symfonizeConfig = $appConfig['symfonize_zf'];
}
$bundleLoader = new BundleLoader();
$bundleLoader->loadBundles(self::$symfonizeConfig);
}
/**
* getConfig() is a requirement for all Modules in ZF2. This
* function is included as part of that standard. See Docs on ZF2 for more
* information.
*
* @return array Returns array to be used by the ZF2 Module Manager
*/
public function getConfig()
{
return [
'router' => [
'routes' => [
'symfonize_zf.route_bridge' => [
'type' => 'symfonize_zf.route_bridge',
],
]
],
'route_manager' => [
'invokables' => [
'symfonize_zf.route_bridge' =>
'Reliv\SymfonizeZF\RouteBridge\RouteBridge'
]
]
];
}
}