vendor/codeages/plugin-bundle/CodeagesPluginBundle.php line 11

Open in your IDE?
  1. <?php
  2. namespace Codeages\PluginBundle;
  3. use Codeages\PluginBundle\DependencyInjection\Compiler\EventSubscriberPass;
  4. use Codeages\PluginBundle\Event\LazyDispatcher;
  5. use Symfony\Component\HttpKernel\Bundle\Bundle;
  6. use Symfony\Component\DependencyInjection\ContainerBuilder;
  7. use Symfony\Component\EventDispatcher\EventDispatcher;
  8. class CodeagesPluginBundle extends Bundle
  9. {
  10.     public function boot()
  11.     {
  12.         $biz $this->container->get('biz');
  13.         $container $this->container;
  14.         if ($biz->offsetExists('dispatcher') && $biz['dispatcher'] instanceof EventDispatcher) {
  15.             $biz->offsetUnset('dispatcher');
  16.         }
  17.         $biz['dispatcher'] = function () use ($container) {
  18.             return new LazyDispatcher($container);
  19.         };
  20.         $biz['subscribers'] = new \ArrayObject();
  21.         $biz['migration.directories'][] = __DIR__.'/Migrations';
  22.         $biz['autoload.aliases']['CodeagesPluginBundle'] = 'Codeages\PluginBundle\Biz';
  23.     }
  24.     public function build(ContainerBuilder $container)
  25.     {
  26.         $container->addCompilerPass(new EventSubscriberPass());
  27.     }
  28. }