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

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\ServiceControllersPass;
  29. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\SessionConfiguratorPass;
  30. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\TargetingOverrideHandlersPass;
  31. use Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler\WorkflowPass;
  32. use Symfony\Component\DependencyInjection\ContainerBuilder;
  33. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  34. use Symfony\Component\HttpKernel\Bundle\Bundle;
  35. /**
  36.  * @internal
  37.  */
  38. class PimcoreCoreBundle extends Bundle
  39. {
  40.     public function getContainerExtension(): ?ExtensionInterface
  41.     {
  42.         if (null === $this->extension) {
  43.             $extension $this->createContainerExtension();
  44.             if (null !== $extension) {
  45.                 if (!$extension instanceof ExtensionInterface) {
  46.                     throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.'get_class($extension)));
  47.                 }
  48.                 $this->extension $extension;
  49.             } else {
  50.                 $this->extension false;
  51.             }
  52.         }
  53.         if ($this->extension) {
  54.             return $this->extension;
  55.         }
  56.         return null;
  57.     }
  58.     /**
  59.      * {@inheritdoc}
  60.      */
  61.     public function build(ContainerBuilder $container)
  62.     {
  63.         $container->addCompilerPass(new AreabrickPass());
  64.         $container->addCompilerPass(new NavigationRendererPass());
  65.         $container->addCompilerPass(new ServiceControllersPass());
  66.         $container->addCompilerPass(new SessionConfiguratorPass());
  67.         $container->addCompilerPass(new TargetingOverrideHandlersPass());
  68.         $container->addCompilerPass(new MonologPublicLoggerPass());
  69.         $container->addCompilerPass(new MonologPsrLogMessageProcessorPass());
  70.         $container->addCompilerPass(new DebugStopwatchPass());
  71.         $container->addCompilerPass(new LongRunningHelperPass());
  72.         $container->addCompilerPass(new WorkflowPass());
  73.         $container->addCompilerPass(new RegisterImageOptimizersPass());
  74.         $container->addCompilerPass(new RegisterMaintenanceTaskPass());
  75.         $container->addCompilerPass(new RoutingLoaderPass());
  76.         $container->addCompilerPass(new ProfilerAliasPass());
  77.         $container->addCompilerPass(new CacheFallbackPass());
  78.         $container->addCompilerPass(new PasswordFactoryDecoratorPass());
  79.         $container->addCompilerPass(new MessageBusPublicPass());
  80.     }
  81. }