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.         return null;
  59.     }
  60.     /**
  61.      * {@inheritdoc}
  62.      */
  63.     public function build(ContainerBuilder $container)
  64.     {
  65.         $container->addCompilerPass(new PhpTemplatingPass());
  66.         $container->addCompilerPass(new AreabrickPass());
  67.         $container->addCompilerPass(new NavigationRendererPass());
  68.         $container->addCompilerPass(new CacheCollectorPass());
  69.         $container->addCompilerPass(new PimcoreGlobalTemplatingVariablesPass());
  70.         $container->addCompilerPass(new TemplatingEngineAwareHelperPass());
  71.         $container->addCompilerPass(new TemplateVarsProviderPass());
  72.         $container->addCompilerPass(new ServiceControllersPass());
  73.         $container->addCompilerPass(new SessionConfiguratorPass());
  74.         $container->addCompilerPass(new WebDebugToolbarListenerPass());
  75.         $container->addCompilerPass(new TargetingOverrideHandlersPass());
  76.         $container->addCompilerPass(new DoctrineMigrationsParametersPass());
  77.         $container->addCompilerPass(new MonologPublicLoggerPass());
  78.         $container->addCompilerPass(new MonologPsrLogMessageProcessorPass());
  79.         $container->addCompilerPass(new DebugStopwatchPass());
  80.         $container->addCompilerPass(new LongRunningHelperPass());
  81.         $container->addCompilerPass(new WorkflowPass());
  82.         $container->addCompilerPass(new RegisterImageOptimizersPass());
  83.         $container->addCompilerPass(new RegisterMaintenanceTaskPass());
  84.         $container->addCompilerPass(new RoutingLoaderPass());
  85.         $container->addCompilerPass(new ProfilerAliasPass());
  86.         $container->addCompilerPass(new LegacyTemplatePass());
  87.     }
  88. }