vendor/ibexa/taxonomy/src/bundle/IbexaTaxonomyBundle.php line 18

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. declare(strict_types=1);
  7. namespace Ibexa\Bundle\Taxonomy;
  8. use Ibexa\Bundle\Taxonomy\DependencyInjection\Configuration\Parser\Taxonomy;
  9. use Ibexa\Taxonomy\Security\TaxonomyPolicyProvider;
  10. use Symfony\Component\Config\FileLocator;
  11. use Symfony\Component\DependencyInjection\ContainerBuilder;
  12. use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
  13. use Symfony\Component\HttpKernel\Bundle\Bundle;
  14. final class IbexaTaxonomyBundle extends Bundle
  15. {
  16.     public function build(ContainerBuilder $container): void
  17.     {
  18.         /** @var \Ibexa\Bundle\Core\DependencyInjection\IbexaCoreExtension $core */
  19.         $core $container->getExtension('ibexa');
  20.         $core->addConfigParser(new Taxonomy());
  21.         $core->addDefaultSettings(__DIR__ '/Resources/config', ['ibexa_default_settings.yaml']);
  22.         $core->addPolicyProvider(new TaxonomyPolicyProvider());
  23.         $loader = new YamlFileLoader(
  24.             $container,
  25.             new FileLocator(__DIR__ '/Resources/config')
  26.         );
  27.         if ($container->hasExtension('ibexa_solr')) {
  28.             $loader->load('services/search/solr.yaml');
  29.         }
  30.         if ($container->hasExtension('ibexa_elasticsearch')) {
  31.             $loader->load('services/search/elasticsearch.yaml');
  32.         }
  33.         if ($container->hasExtension('ibexa_cdp')) {
  34.             $loader->load('services/cdp.yaml');
  35.         }
  36.     }
  37. }