Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

CacheManager remove dosen't work #135

Closed
fkrauthan opened this Issue · 9 comments

3 participants

@fkrauthan

If I have the following code:

$uploadPath = $this->getUploadedWebPath($entry->getGallery());
$uploadPath.= '/'.$entry->getFileName();

$liipCacheManager = $this->get('liip_imagine.cache.manager');
$liipCacheManager->remove($uploadPath, 'gallery_small_thumb');

the thumbnail for the filter gallery_small_thumb doesn't get deleted. The $uploadPath is the same I was using within the templates where the thumb was correctly generated.

@lsmith77
Owner

does #132 work for you?

@havvg
Collaborator

This behavior is correct. You have to pass the resolved path (as created by CacheManager::resolve).

$liipCacheManager = $this->get('liip_imagine.cache.manager');
$liipCacheManager->remove($liipCacheManager->resolve($uploadPath, 'gallery_small_thumb'), 'gallery_small_thumb');
@havvg havvg closed this
@lsmith77
Owner

i guess we should either improve the error handling or document this somewhere.

@havvg
Collaborator

It's already documented (in the phpDoc :D), but yes you are right! I'll create an issue for that.

@fkrauthan

But I think the CacheManager should do the resolving by itself. That's a more nature way.

@havvg
Collaborator

I'm currently writing tests for all of this. I agree with you, that it would make sense to have the user pass the same values, when interacting with the bundle. Let's see why it's the way it currently is, and if there is no valid reason to it, the first release version may introduce such a BC break, imho. What do you think @lsmith77?

@lsmith77
Owner
@fkrauthan

Is there any timeline for that?

@havvg
Collaborator

First we want to get a release version out of the door: https://github.com/liip/LiipImagineBundle/issues?milestone=1&state=open
It's past due, but that's not a huge problem, the core functionality is tested and some minor parts have been fixed.
I won't make it today, but if all goes well, tomorrow will be fine. I'm on vacations starting friday, so I want this to be done by wednesday at the latest. After this, we can focus on re-factoring "not that nice" parts. As Lukas said, it grew by needs and it's pretty good the way it is right now, with some minor flaws (like this one).

If you want to speed things up, add test cases :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.