Skip to content

Adding Support for cache-plugins cache_listeners #361

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

Merged
merged 13 commits into from
Jan 20, 2020

Conversation

schroedingerskatze42
Copy link
Contributor

@schroedingerskatze42 schroedingerskatze42 commented Nov 28, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets -
Documentation -
License MIT

What's in this PR?

Wraps cache_listeners option of cache plugin, to enable its configuration.

Why?

Cache listeners could not have been configured using this bundle. (or - which is absolutely possible - I did not get the usage)

Example Usage

httplug: 
    cache:
        config:
            cache_listeners: ['\Http\Client\Common\Plugin\Cache\Listener\AddHeaderCacheListener']

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

Till Hildebrandt added 5 commits November 21, 2019 13:51
 - fixed tests, extended by cache_listeners
 - list of classes to match plugins documentation
 - added to config
 - added tests
@schroedingerskatze42
Copy link
Contributor Author

Not quite sure, how to handle the travis ci fails. It seems this is due to other dependencies. an composer install is not possible right now due to conflicts of SymfonyDependencyInjectionTest and phpunit.

Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks for this one. as far as i can see, this is indeed missing. however, we should base this on services, not on class names.

we could also support a tag for listeners and auto-tagging for all services implementing the listener class, to autoconfigure all cache plugins with the listeners. which is nice when there is only one instance of cache plugin, but becomes rather weird when there are serveral instances. i propose that at least for now, we only do the config option (but with services instead of class names), and maybe add autoconfigure later - if at all.

Till Hildebrandt added 4 commits December 16, 2019 09:03
…ers"

 - switched from list of classes to list of services
 - removed class implementation validation in configuration
…ers"

 - Reverted unwanted style changes (even though a additional space at
   string concat is really nice ;))
@schroedingerskatze42
Copy link
Contributor Author

Travis CI failed in one case due to timeout of 300ms

Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

i have some suggestions to simplify the code, but like where we are going with this!

weird failure in travisci, can't see how this would be related to your changes. i restarted the latest master coverage ci build to see if that now fails too: https://travis-ci.org/php-http/HttplugBundle/jobs/625545203

do you plan on also adding the documentation?

@dbu dbu mentioned this pull request Dec 25, 2019
1 task
 - eased expression to configure cache listeners in dependency injection
 - added array node for cache listeners
 - fixed xml config
Till Hildebrandt added 2 commits January 9, 2020 12:20
 - removed duplicated cache_listeners node from src/DependencyInjection/Configuration.php
 - TESTS: added multiple cache_listeners
Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks for the update!
i am still confused by the unset thing. and a small tweak for xml configuration, otherwise this is ready.

 - fixed cache listener configuration
 - proper usage of xml configuration
@dbu dbu merged commit eabb68e into php-http:master Jan 20, 2020
@dbu
Copy link
Collaborator

dbu commented Jan 20, 2020

thank you!

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