Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added cache-invalidator-listener service #42

Merged
merged 5 commits into from
Mar 14, 2013
Merged

added cache-invalidator-listener service #42

merged 5 commits into from
Mar 14, 2013

Conversation

dbu
Copy link
Member

@dbu dbu commented Mar 12, 2013

we started with a listener service to go with the image document. whenever the image changes, the imagine cache should be invalidated.

if ($document instanceof Image) {
// TODO: this does not work, what do we need to pass to manager->remove?
// TODO: can we invalidate all caches? otherwise inject filter name(s)? by config
$this->manager->remove($document->getId(), 'image_upload_thumbnail');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@havvg @lsmith77 is the phpcr support in LiipImagineBundle incomplete? or what do i need to pass to the cache manager? and is there a way to clear all cached images for a specific document or do i need to know a specific filter name?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 0.9.x you need to resolve the name first, see liip/LiipImagineBundle#135 (comment)

@dbu
Copy link
Member Author

dbu commented Mar 13, 2013

ok, this would be ready to merge. i will wait until tomorrow if you want to give some feedback /cc @rryter @lsmith77

$path = $this->manager->resolve($this->container->get('request'), $document->getId(), 'image_upload_thumbnail')->getTargetUrl();
// TODO: this might not be needed https://github.com/liip/LiipImagineBundle/issues/162
if (false !== strpos($path, $filter)) {
$path = substr($path, strpos($path, $filter) + strlen($filter));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i get a reply on that issue today, i will clean this up if possible.

dbu added a commit that referenced this pull request Mar 14, 2013
…ener

added cache-invalidator-listener service
@dbu dbu merged commit d12d8d8 into doctrine:master Mar 14, 2013
@dbu dbu deleted the imagine-cache-invalidator-listener branch March 14, 2013 09:39
@dbu
Copy link
Member Author

dbu commented Mar 14, 2013

also cleaned up the configuration. you now need to explicitly enable imagine to have this block.

the full config options for imagine are now

doctrine_phpcr:
    ...
    imagine:
        enabled: true
        filter: preview_filter_name
        extra_filters:
            - imagine_filter_name1
            - imagine_filter_name2

guess i have to update the doc as well...

/cc @rryter @elHornair

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants