2017 © Pedro Peláez
 

symfony-bundle cache-flush-bundle

Symfony cache flusher

image

mmoreram/cache-flush-bundle

Symfony cache flusher

  • Wednesday, December 28, 2016
  • by mmoreram
  • Repository
  • 2 Watchers
  • 1 Stars
  • 13,747 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 2 % Grown

The README.md

Cache Flush Bundle

Build Status, (*1)


Flush all your kernel content with a simple Symfony service., (*2)

``` php $this ->container ->get('cache_flusher') ->flushCache(), (*3)


by default the service will flush the cache of the kernel loaded in the framework, but you can explicitly flush one kernel's cache by passing the kernel as the first and unique method's parameter. ``` php $myOtherKernel = // $this ->container ->get('cache_flusher') ->flushCache($myOtherKernel)

You can inject the service as well., (*4)

``` yaml my_service: class: MyService\Namespace arguments: '@cache_flusher', (*5)


The service dispatches as well two events, one just before flush the kernel's cache, and another one just after. In both cases, an instance of `CacheFlushEvent` is dispatched, with the used kernel inside.

my_event_listener: class: MyEventListener\Namespace tags: - { name: kernel.event_listener, event: cache.pre_flush } - { name: kernel.event_listener, event: cache.on_flush } ```, (*6)

The Versions