vendor/pimcore/php-templating-engine-bundle/src/PimcorePhpTemplatingEngineBundle.php line 27

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under following license:
  6.  * - Pimcore Commercial License (PCL)
  7.  *
  8.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  9.  *  @license    http://www.pimcore.org/license     PCL
  10.  */
  11. namespace Pimcore\Bundle\PhpTemplatingEngineBundle;
  12. use Pimcore\Bundle\EnterpriseSubscriptionToolsBundle\Bundle\EnterpriseBundleInterface;
  13. use Pimcore\Bundle\EnterpriseSubscriptionToolsBundle\PimcoreEnterpriseSubscriptionToolsBundle;
  14. use Pimcore\Bundle\PhpTemplatingEngineBundle\DependencyInjection\Compiler\LegacyTemplatePass;
  15. use Pimcore\Bundle\PhpTemplatingEngineBundle\DependencyInjection\Compiler\PimcoreGlobalTemplatingVariablesPass;
  16. use Pimcore\Bundle\PhpTemplatingEngineBundle\DependencyInjection\Compiler\TemplateVarsProviderPass;
  17. use Pimcore\Bundle\PhpTemplatingEngineBundle\DependencyInjection\Compiler\TemplatingEngineAwareHelperPass;
  18. use Pimcore\Bundle\PhpTemplatingEngineBundle\DependencyInjection\Compiler\TemplatingPass;
  19. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  20. use Pimcore\HttpKernel\BundleCollection\BundleCollection;
  21. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  22. use Symfony\Component\DependencyInjection\ContainerBuilder;
  23. class PimcorePhpTemplatingEngineBundle extends AbstractPimcoreBundle implements EnterpriseBundleInterface
  24. {
  25.     public function getJsPaths()
  26.     {
  27.         return [];
  28.     }
  29.     /**
  30.      * @param BundleCollection $collection
  31.      */
  32.     public static function registerDependentBundles(BundleCollection $collection)
  33.     {
  34.         $collection->addBundle(new PimcoreEnterpriseSubscriptionToolsBundle());
  35.     }
  36.     public function getBundleLicenseId(): string
  37.     {
  38.         return 'PTE';
  39.     }
  40.     /**
  41.      * {@inheritdoc}
  42.      */
  43.     protected function getComposerPackageName()
  44.     {
  45.         return 'pimcore/php-templating-engine-bundle';
  46.     }
  47.     public function build(ContainerBuilder $container)
  48.     {
  49.         $container->addCompilerPass(new TemplatingPass());
  50.         $container->addCompilerPass(new LegacyTemplatePass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -50);
  51.         $container->addCompilerPass(new TemplatingEngineAwareHelperPass());
  52.         $container->addCompilerPass(new TemplateVarsProviderPass());
  53.         $container->addCompilerPass(new PimcoreGlobalTemplatingVariablesPass());
  54.     }
  55. }