vendor/pimcore/pimcore/bundles/AdminBundle/PimcoreAdminBundle.php line 33

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Bundle\AdminBundle;
  15. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\ContentSecurityPolicyUrlsPass;
  16. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\GDPRDataProviderPass;
  17. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\ImportExportLocatorsPass;
  18. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\LegacyAuthenticationSecurityPass;
  19. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\SerializerPass;
  20. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\TranslationServicesPass;
  21. use Pimcore\Bundle\AdminBundle\GDPR\DataProvider\DataProviderInterface;
  22. use Pimcore\Bundle\AdminBundle\Security\Factory\PreAuthenticatedAdminSessionFactory;
  23. use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
  24. use Symfony\Component\DependencyInjection\ContainerBuilder;
  25. use Symfony\Component\HttpKernel\Bundle\Bundle;
  26. /**
  27.  * @internal
  28.  */
  29. class PimcoreAdminBundle extends Bundle
  30. {
  31.     /**
  32.      * {@inheritdoc}
  33.      */
  34.     public function build(ContainerBuilder $container)
  35.     {
  36.         // auto-tag GDPR data providers
  37.         $container
  38.             ->registerForAutoconfiguration(DataProviderInterface::class)
  39.             ->addTag('pimcore.gdpr.data-provider');
  40.         $container->addCompilerPass(new SerializerPass());
  41.         $container->addCompilerPass(new GDPRDataProviderPass());
  42.         $container->addCompilerPass(new ImportExportLocatorsPass());
  43.         $container->addCompilerPass(new TranslationServicesPass());
  44.         $container->addCompilerPass(new ContentSecurityPolicyUrlsPass());
  45.         $container->addCompilerPass(new LegacyAuthenticationSecurityPass());
  46.         /** @var SecurityExtension $extension */
  47.         $extension $container->getExtension('security');
  48.         $extension->addAuthenticatorFactory(new PreAuthenticatedAdminSessionFactory());
  49.     }
  50. }