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

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