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

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\SerializerPass;
  19. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\TranslationServicesPass;
  20. use Pimcore\Bundle\AdminBundle\GDPR\DataProvider\DataProviderInterface;
  21. use Pimcore\Bundle\AdminBundle\Security\Factory\PreAuthenticatedAdminSessionFactory;
  22. use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
  23. use Symfony\Component\DependencyInjection\ContainerBuilder;
  24. use Symfony\Component\HttpKernel\Bundle\Bundle;
  25. /**
  26.  * @internal
  27.  */
  28. class PimcoreAdminBundle extends Bundle
  29. {
  30.     /**
  31.      * {@inheritdoc}
  32.      */
  33.     public function build(ContainerBuilder $container)
  34.     {
  35.         // auto-tag GDPR data providers
  36.         $container
  37.             ->registerForAutoconfiguration(DataProviderInterface::class)
  38.             ->addTag('pimcore.gdpr.data-provider');
  39.         $container->addCompilerPass(new SerializerPass());
  40.         $container->addCompilerPass(new GDPRDataProviderPass());
  41.         $container->addCompilerPass(new ImportExportLocatorsPass());
  42.         $container->addCompilerPass(new TranslationServicesPass());
  43.         $container->addCompilerPass(new ContentSecurityPolicyUrlsPass());
  44.         /** @var SecurityExtension $extension */
  45.         $extension $container->getExtension('security');
  46.         $extension->addSecurityListenerFactory(new PreAuthenticatedAdminSessionFactory());
  47.     }
  48. }