src/Core/System/System.php line 19

  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\System;
  3. use Shopware\Core\Framework\Bundle;
  4. use Shopware\Core\Framework\Log\Package;
  5. use Shopware\Core\System\CustomEntity\CustomEntityRegistrar;
  6. use Shopware\Core\System\DependencyInjection\CompilerPass\RedisNumberRangeIncrementerCompilerPass;
  7. use Shopware\Core\System\DependencyInjection\CompilerPass\SalesChannelEntityCompilerPass;
  8. use Symfony\Component\Config\FileLocator;
  9. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  10. use Symfony\Component\DependencyInjection\ContainerBuilder;
  11. use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  12. /**
  13.  * @internal
  14.  */
  15. #[Package('core')]
  16. class System extends Bundle
  17. {
  18.     public function getTemplatePriority(): int
  19.     {
  20.         return -1;
  21.     }
  22.     /**
  23.      * {@inheritdoc}
  24.      */
  25.     public function build(ContainerBuilder $container): void
  26.     {
  27.         parent::build($container);
  28.         $loader = new XmlFileLoader($container, new FileLocator(__DIR__ '/DependencyInjection/'));
  29.         $loader->load('sales_channel.xml');
  30.         $loader->load('country.xml');
  31.         $loader->load('currency.xml');
  32.         $loader->load('custom_entity.xml');
  33.         $loader->load('locale.xml');
  34.         $loader->load('snippet.xml');
  35.         $loader->load('salutation.xml');
  36.         $loader->load('tax.xml');
  37.         $loader->load('tax_provider.xml');
  38.         $loader->load('unit.xml');
  39.         $loader->load('user.xml');
  40.         $loader->load('integration.xml');
  41.         $loader->load('state_machine.xml');
  42.         $loader->load('configuration.xml');
  43.         $loader->load('number_range.xml');
  44.         $loader->load('tag.xml');
  45.         $container->addCompilerPass(new SalesChannelEntityCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION0);
  46.         $container->addCompilerPass(new RedisNumberRangeIncrementerCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION0);
  47.     }
  48.     public function boot(): void
  49.     {
  50.         parent::boot();
  51.         $this->container->get(CustomEntityRegistrar::class)->register();
  52.     }
  53. }