vendor/pimcore/admin-ui-classic-bundle/src/PimcoreAdminBundle.php line 31

  1. <?php
  2. declare(strict_types=1);
  3. /**
  4.  * Pimcore
  5.  *
  6.  * This source file is available under two different licenses:
  7.  * - GNU General Public License version 3 (GPLv3)
  8.  * - Pimcore Commercial License (PCL)
  9.  * Full copyright and license information is available in
  10.  * LICENSE.md which is distributed with this source code.
  11.  *
  12.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  13.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  14.  */
  15. namespace Pimcore\Bundle\AdminBundle;
  16. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\ContentSecurityPolicyUrlsPass;
  17. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\GDPRDataProviderPass;
  18. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\ImportExportLocatorsPass;
  19. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\SerializerPass;
  20. use Pimcore\Bundle\AdminBundle\DependencyInjection\Compiler\TranslatorPass;
  21. use Pimcore\Bundle\AdminBundle\GDPR\DataProvider\DataProviderInterface;
  22. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  23. use Pimcore\HttpKernel\Bundle\DependentBundleInterface;
  24. use Pimcore\HttpKernel\BundleCollection\BundleCollection;
  25. use Symfony\Component\DependencyInjection\ContainerBuilder;
  26. use Symfony\WebpackEncoreBundle\WebpackEncoreBundle;
  27. class PimcoreAdminBundle extends AbstractPimcoreBundle implements DependentBundleInterface
  28. {
  29.     /**
  30.      * {@inheritdoc}
  31.      */
  32.     public function build(ContainerBuilder $container): void
  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 TranslatorPass());
  42.         $container->addCompilerPass(new ContentSecurityPolicyUrlsPass());
  43.     }
  44.     public function getPath(): string
  45.     {
  46.         return \dirname(__DIR__);
  47.     }
  48.     public static function registerDependentBundles(BundleCollection $collection): void
  49.     {
  50.         $collection->addBundle(new WebpackEncoreBundle());
  51.     }
  52.     public function getInstaller(): ?Installer
  53.     {
  54.         return $this->container->get(Installer::class);
  55.     }
  56. }