pedroborges / kirby-autogit

⬢ Saves every change made via Kirby Panel to a Git repository
149 stars 23 forks source link

Clear Cache after Pull #46

Closed tobiasfabian closed 6 years ago

pedroborges commented 6 years ago

When pulling either via webhook or widget, the plugin triggers an autogit.pull event which you can hook into to do things like clearing the cache.

kirby()->hook('autogit.pull', function ($source) {
   kirby()->cache()->flush();
});

The $source variable value can be "widget" or "webhook".

There's also a autogit.push event in case you need it.

I prefer to leave post event actions like clearing the cache for the developer to decide based on their app needs. Thank you!