-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCodeagesPluginBundle.php
More file actions
35 lines (28 loc) · 1.08 KB
/
CodeagesPluginBundle.php
File metadata and controls
35 lines (28 loc) · 1.08 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
<?php
namespace Codeages\PluginBundle;
use Codeages\PluginBundle\DependencyInjection\Compiler\EventSubscriberPass;
use Codeages\PluginBundle\Event\LazyDispatcher;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\EventDispatcher\EventDispatcher;
class CodeagesPluginBundle extends Bundle
{
public function boot()
{
$biz = $this->container->get('biz');
$container = $this->container;
if ($biz->offsetExists('dispatcher') && $biz['dispatcher'] instanceof EventDispatcher) {
$biz->offsetUnset('dispatcher');
}
$biz['dispatcher'] = function () use ($container) {
return new LazyDispatcher($container);
};
$biz['subscribers'] = new \ArrayObject();
$biz['migration.directories'][] = __DIR__.'/Migrations';
$biz['autoload.aliases']['CodeagesPluginBundle'] = 'Codeages\PluginBundle\Biz';
}
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new EventSubscriberPass());
}
}