vendor/liip/imagine-bundle/LiipImagineBundle.php line 33

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the `liip/LiipImagineBundle` project.
  4.  *
  5.  * (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE.md
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Liip\ImagineBundle;
  11. use Enqueue\Bundle\DependencyInjection\Compiler\AddTopicMetaPass;
  12. use Liip\ImagineBundle\Async\Topics;
  13. use Liip\ImagineBundle\DependencyInjection\Compiler\DriverCompilerPass;
  14. use Liip\ImagineBundle\DependencyInjection\Compiler\FiltersCompilerPass;
  15. use Liip\ImagineBundle\DependencyInjection\Compiler\LoadersCompilerPass;
  16. use Liip\ImagineBundle\DependencyInjection\Compiler\MetadataReaderCompilerPass;
  17. use Liip\ImagineBundle\DependencyInjection\Compiler\PostProcessorsCompilerPass;
  18. use Liip\ImagineBundle\DependencyInjection\Compiler\ResolversCompilerPass;
  19. use Liip\ImagineBundle\DependencyInjection\Factory\Loader\ChainLoaderFactory;
  20. use Liip\ImagineBundle\DependencyInjection\Factory\Loader\FileSystemLoaderFactory;
  21. use Liip\ImagineBundle\DependencyInjection\Factory\Loader\FlysystemLoaderFactory;
  22. use Liip\ImagineBundle\DependencyInjection\Factory\Loader\StreamLoaderFactory;
  23. use Liip\ImagineBundle\DependencyInjection\Factory\Resolver\AwsS3ResolverFactory;
  24. use Liip\ImagineBundle\DependencyInjection\Factory\Resolver\FlysystemResolverFactory;
  25. use Liip\ImagineBundle\DependencyInjection\Factory\Resolver\WebPathResolverFactory;
  26. use Liip\ImagineBundle\DependencyInjection\LiipImagineExtension;
  27. use Symfony\Component\DependencyInjection\ContainerBuilder;
  28. use Symfony\Component\HttpKernel\Bundle\Bundle;
  29. class LiipImagineBundle extends Bundle
  30. {
  31.     /**
  32.      * {@inheritdoc}
  33.      */
  34.     public function build(ContainerBuilder $container)
  35.     {
  36.         parent::build($container);
  37.         $container->addCompilerPass(new DriverCompilerPass());
  38.         $container->addCompilerPass(new LoadersCompilerPass());
  39.         $container->addCompilerPass(new FiltersCompilerPass());
  40.         $container->addCompilerPass(new PostProcessorsCompilerPass());
  41.         $container->addCompilerPass(new ResolversCompilerPass());
  42.         $container->addCompilerPass(new MetadataReaderCompilerPass());
  43.         if (class_exists(AddTopicMetaPass::class)) {
  44.             $container->addCompilerPass(AddTopicMetaPass::create()
  45.                 ->add(Topics::CACHE_RESOLVED'The topic contains messages about resolved image\'s caches')
  46.             );
  47.         }
  48.         /** @var $extension LiipImagineExtension */
  49.         $extension $container->getExtension('liip_imagine');
  50.         $extension->addResolverFactory(new WebPathResolverFactory());
  51.         $extension->addResolverFactory(new AwsS3ResolverFactory());
  52.         $extension->addResolverFactory(new FlysystemResolverFactory());
  53.         $extension->addLoaderFactory(new StreamLoaderFactory());
  54.         $extension->addLoaderFactory(new FileSystemLoaderFactory());
  55.         $extension->addLoaderFactory(new FlysystemLoaderFactory());
  56.         $extension->addLoaderFactory(new ChainLoaderFactory());
  57.     }
  58. }