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

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