vendor/ekino/newrelic-bundle/EkinoNewRelicBundle.php line 21

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of Ekino New Relic bundle.
  5.  *
  6.  * (c) Ekino - Thomas Rabaix <thomas.rabaix@ekino.com>
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace Ekino\NewRelicBundle;
  12. use Ekino\NewRelicBundle\DependencyInjection\Compiler\MonologHandlerPass;
  13. use Ekino\NewRelicBundle\Listener\DeprecationListener;
  14. use Symfony\Component\DependencyInjection\ContainerBuilder;
  15. use Symfony\Component\HttpKernel\Bundle\Bundle;
  16. class EkinoNewRelicBundle extends Bundle
  17. {
  18.     public function build(ContainerBuilder $container)
  19.     {
  20.         parent::build($container);
  21.         $container->addCompilerPass(new MonologHandlerPass());
  22.     }
  23.     public function boot()
  24.     {
  25.         parent::boot();
  26.         if ($this->container->has(DeprecationListener::class)) {
  27.             $this->container->get(DeprecationListener::class)->register();
  28.         }
  29.     }
  30.     public function shutdown()
  31.     {
  32.         if ($this->container->has(DeprecationListener::class)) {
  33.             $this->container->get(DeprecationListener::class)->unregister();
  34.         }
  35.         parent::shutdown();
  36.     }
  37. }