Skip to content

Commit

Permalink
EZP-25721: 7.x fix for early loaded ez..imagine.cache_resolver_decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed May 20, 2019
1 parent 5001128 commit a3d9b0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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, []);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions eZ/Bundle/EzPublishCoreBundle/Resources/config/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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%'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a3d9b0b

Please # to comment.