From a3d9b0b8f0079a5806386d0ed725dc58d0039a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20R?= Date: Mon, 20 May 2019 12:58:21 +0200 Subject: [PATCH] EZP-25721: 7.x fix for early loaded ez..imagine.cache_resolver_decorator --- .../Cache/Resolver/RelativeResolver.php | 46 +++---------------- .../Resources/config/image.yml | 4 +- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/eZ/Bundle/EzPublishCoreBundle/Imagine/Cache/Resolver/RelativeResolver.php b/eZ/Bundle/EzPublishCoreBundle/Imagine/Cache/Resolver/RelativeResolver.php index e2b9e4e2d85..26407aca48e 100644 --- a/eZ/Bundle/EzPublishCoreBundle/Imagine/Cache/Resolver/RelativeResolver.php +++ b/eZ/Bundle/EzPublishCoreBundle/Imagine/Cache/Resolver/RelativeResolver.php @@ -6,54 +6,20 @@ */ namespace eZ\Bundle\EzPublishCoreBundle\Imagine\Cache\Resolver; -use Liip\ImagineBundle\Binary\BinaryInterface; use Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface; +use Liip\ImagineBundle\Imagine\Cache\Resolver\ProxyResolver as ImagineProxyResolver; -class RelativeResolver implements ResolverInterface +/** + * Relative resolver, omits host info. + */ +class RelativeResolver extends ImagineProxyResolver { - /** - * @var \Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface - */ - private $resolver; - /** * @param \Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface $resolver */ public function __construct(ResolverInterface $resolver) { - $this->resolver = $resolver; - } - - /** - * {@inheritdoc} - */ - public function isStored($path, $filter) - { - return $this->resolver->isStored($path, $filter); - } - - /** - * {@inheritdoc} - */ - public function resolve($path, $filter) - { - return $this->rewriteUrl($this->resolver->resolve($path, $filter)); - } - - /** - * {@inheritdoc} - */ - public function store(BinaryInterface $binary, $path, $filter) - { - return $this->resolver->store($binary, $path, $filter); - } - - /** - * {@inheritdoc} - */ - public function remove(array $paths, array $filters) - { - return $this->resolver->remove($paths, $filters); + parent::__construct($resolver, []); } /** diff --git a/eZ/Bundle/EzPublishCoreBundle/Resources/config/image.yml b/eZ/Bundle/EzPublishCoreBundle/Resources/config/image.yml index d27e7d93113..a15d778259e 100644 --- a/eZ/Bundle/EzPublishCoreBundle/Resources/config/image.yml +++ b/eZ/Bundle/EzPublishCoreBundle/Resources/config/image.yml @@ -95,9 +95,10 @@ services: - '%ezpublish.image_alias.imagine.cache_resolver_decorator_relative.class%' ezpublish.image_alias.imagine.cache_resolver_decorator: - class: Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface + class: Liip\ImagineBundle\Imagine\Cache\Resolver\ProxyResolver factory: 'ezpublish.image_alias.imagine.cache_resolver_decorator_factory:createCacheResolver' decorates: ezpublish.image_alias.imagine.cache_resolver + lazy: true ezpublish.image_alias.imagine.cache.alias_generator_decorator: class: '%ezpublish.image_alias.imagine.cache.alias_generator_decorator.class%' @@ -128,7 +129,6 @@ services: ezpublish.image_alias.imagine.alias_cleaner: class: "%ezpublish.image_alias.imagine.alias_cleaner.class%" arguments: ["@ezpublish.image_alias.imagine.cache_resolver"] - lazy: true ezpublish.image_alias.imagine.filter.loader.scaledown.base: abstract: true