vendor/shopware/storefront/Storefront.php line 23

  1. <?php declare(strict_types=1);
  2. namespace Shopware\Storefront;
  3. use Shopware\Core\Framework\Bundle;
  4. use Shopware\Core\Framework\Feature;
  5. use Shopware\Core\Framework\Log\Package;
  6. use Shopware\Storefront\DependencyInjection\DisableTemplateCachePass;
  7. use Shopware\Storefront\DependencyInjection\StorefrontMigrationReplacementCompilerPass;
  8. use Shopware\Storefront\Framework\ThemeInterface;
  9. use Symfony\Component\Config\FileLocator;
  10. use Symfony\Component\DependencyInjection\ContainerBuilder;
  11. use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  12. /**
  13.  * @internal
  14.  */
  15. #[Package('storefront')]
  16. class Storefront extends Bundle implements ThemeInterface
  17. {
  18.     /**
  19.      * {@inheritdoc}
  20.      */
  21.     public function build(ContainerBuilder $container): void
  22.     {
  23.         parent::build($container);
  24.         $this->buildDefaultConfig($container);
  25.         $loader = new XmlFileLoader($container, new FileLocator(__DIR__ '/DependencyInjection'));
  26.         $loader->load('services.xml');
  27.         $loader->load('seo.xml');
  28.         $loader->load('controller.xml');
  29.         $loader->load('theme.xml');
  30.         if (!Feature::isActive('v6.7.0.0')) {
  31.             $loader->load('theme_6_6_0.xml');
  32.         }
  33.         $container->setParameter('storefrontRoot'$this->getPath());
  34.         $container->addCompilerPass(new DisableTemplateCachePass());
  35.         $container->addCompilerPass(new StorefrontMigrationReplacementCompilerPass());
  36.     }
  37. }