vendor/ibexa/design-engine/src/bundle/DependencyInjection/IbexaDesignEngineExtension.php line 24

Open in your IDE?
  1. <?php
  2. /**
  3. * @copyright Copyright (C) Ibexa AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace Ibexa\Bundle\DesignEngine\DependencyInjection;
  7. use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessor;
  8. use Symfony\Component\Config\FileLocator;
  9. use Symfony\Component\DependencyInjection\ContainerBuilder;
  10. use Symfony\Component\DependencyInjection\Loader;
  11. use Symfony\Component\HttpKernel\DependencyInjection\Extension;
  12. class IbexaDesignEngineExtension extends Extension
  13. {
  14. public const EXTENSION_NAME = 'ibexa_design_engine';
  15. public function getAlias()
  16. {
  17. return self::EXTENSION_NAME;
  18. }
  19. public function getConfiguration(array $config, ContainerBuilder $container)
  20. {
  21. return new Configuration();
  22. }
  23. public function load(array $configs, ContainerBuilder $container)
  24. {
  25. $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
  26. $loader->load('services.yaml');
  27. $loader->load('default_settings.yaml');
  28. $configuration = $this->getConfiguration($configs, $container);
  29. $config = $this->processConfiguration($configuration, $configs);
  30. $processor = new ConfigurationProcessor($container, 'ezdesign');
  31. $this->configureDesigns($config, $processor, $container);
  32. }
  33. private function configureDesigns(array $config, ConfigurationProcessor $processor, ContainerBuilder $container)
  34. {
  35. // Always add "standard" design to the list (defaults to application level & override paths only)
  36. $config['design_list'] += ['standard' => []];
  37. $container->setParameter('ibexa.design.list', $config['design_list']);
  38. $container->setParameter('ibexa.design.templates.override_paths', $config['templates_override_paths']);
  39. $container->setParameter('ibexa.design.templates.path_map', $config['templates_theme_paths']);
  40. $container->setParameter('ibexa.design.assets.resolution.disabled', $config['disable_assets_pre_resolution']);
  41. }
  42. }
  43. class_alias(IbexaDesignEngineExtension::class, 'EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\EzPlatformDesignEngineExtension');