CacheManager remove dosen't work #135

Closed
fkrauthan opened this Issue Feb 4, 2013 · 9 comments

Comments

Projects
None yet
3 participants

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.

Owner

lsmith77 commented Feb 8, 2013

does #132 work for you?

Contributor

havvg commented Feb 8, 2013

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 Feb 8, 2013

Owner

lsmith77 commented Feb 8, 2013

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

Contributor

havvg commented Feb 8, 2013

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

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

Contributor

havvg commented Feb 8, 2013

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?

Owner

lsmith77 commented Feb 8, 2013

a lot of this has grown organically. it might indeed make sense to review this all and redactor the API a bit. we can tag a release before any BC breaks

Is there any timeline for that?

Contributor

havvg commented Feb 11, 2013

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