vendor/pimcore/pimcore/bundles/CoreBundle/PimcoreCoreBundle.php line 43

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Bundle\CoreBundle;
  15. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\AreabrickPass;
  16. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\CacheFallbackPass;
  17. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\DebugStopwatchPass;
  18. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\LongRunningHelperPass;
  19. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\MessageBusPublicPass;
  20. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\MonologPsrLogMessageProcessorPass;
  21. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\MonologPublicLoggerPass;
  22. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\NavigationRendererPass;
  23. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\PasswordFactoryDecoratorPass;
  24. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\ProfilerAliasPass;
  25. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\RegisterImageOptimizersPass;
  26. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\RegisterMaintenanceTaskPass;
  27. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\RoutingLoaderPass;
  28. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\SerializerPass;
  29. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\ServiceControllersPass;
  30. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\SessionConfiguratorPass;
  31. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\TargetingOverrideHandlersPass;
  32. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\WorkflowPass;
  33. use Symfony\Component\DependencyInjection\ContainerBuilder;
  34. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  35. use Symfony\Component\HttpKernel\Bundle\Bundle;
  36. /**
  37.  * @internal
  38.  */
  39. class PimcoreCoreBundle extends Bundle
  40. {
  41.     public function getContainerExtension(): ?ExtensionInterface
  42.     {
  43.         if (null === $this->extension) {
  44.             $extension $this->createContainerExtension();
  45.             if (null !== $extension) {
  46.                 if (!$extension instanceof ExtensionInterface) {
  47.                     throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.'get_class($extension)));
  48.                 }
  49.                 $this->extension $extension;
  50.             } else {
  51.                 $this->extension false;
  52.             }
  53.         }
  54.         if ($this->extension) {
  55.             return $this->extension;
  56.         }
  57.         return null;
  58.     }
  59.     /**
  60.      * {@inheritdoc}
  61.      */
  62.     public function build(ContainerBuilder $container)
  63.     {
  64.         $container->addCompilerPass(new AreabrickPass());
  65.         $container->addCompilerPass(new NavigationRendererPass());
  66.         $container->addCompilerPass(new ServiceControllersPass());
  67.         $container->addCompilerPass(new SessionConfiguratorPass());
  68.         $container->addCompilerPass(new TargetingOverrideHandlersPass());
  69.         $container->addCompilerPass(new MonologPublicLoggerPass());
  70.         $container->addCompilerPass(new MonologPsrLogMessageProcessorPass());
  71.         $container->addCompilerPass(new DebugStopwatchPass());
  72.         $container->addCompilerPass(new LongRunningHelperPass());
  73.         $container->addCompilerPass(new WorkflowPass());
  74.         $container->addCompilerPass(new RegisterImageOptimizersPass());
  75.         $container->addCompilerPass(new RegisterMaintenanceTaskPass());
  76.         $container->addCompilerPass(new RoutingLoaderPass());
  77.         $container->addCompilerPass(new ProfilerAliasPass());
  78.         $container->addCompilerPass(new CacheFallbackPass());
  79.         $container->addCompilerPass(new PasswordFactoryDecoratorPass());
  80.         $container->addCompilerPass(new MessageBusPublicPass());
  81.         $container->addCompilerPass(new SerializerPass());
  82.     }
  83. }