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

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