vendor/sonata-project/media-bundle/src/SonataMediaBundle.php line 24

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of the Sonata Project package.
  5.  *
  6.  * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace Sonata\MediaBundle;
  12. use Sonata\MediaBundle\DependencyInjection\Compiler\AddProviderCompilerPass;
  13. use Sonata\MediaBundle\DependencyInjection\Compiler\GlobalVariablesCompilerPass;
  14. use Sonata\MediaBundle\DependencyInjection\Compiler\ThumbnailCompilerPass;
  15. use Sonata\MediaBundle\DependencyInjection\Compiler\TwigStringExtensionCompilerPass;
  16. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  17. use Symfony\Component\DependencyInjection\ContainerBuilder;
  18. use Symfony\Component\HttpKernel\Bundle\Bundle;
  19. final class SonataMediaBundle extends Bundle
  20. {
  21.     public function build(ContainerBuilder $container): void
  22.     {
  23.         $container->addCompilerPass(new AddProviderCompilerPass());
  24.         $container->addCompilerPass(new GlobalVariablesCompilerPass());
  25.         $container->addCompilerPass(new ThumbnailCompilerPass());
  26.         $container->addCompilerPass(new TwigStringExtensionCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION1);
  27.     }
  28.     public function boot(): void
  29.     {
  30.         // this is required by the AWS SDK (see: https://github.com/knplabs/Gaufrette)
  31.         if (!\defined('AWS_CERTIFICATE_AUTHORITY')) {
  32.             \define('AWS_CERTIFICATE_AUTHORITY'true);
  33.         }
  34.     }
  35. }