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