Added new onBeforeCacheClear event

This commit is contained in:
Andy Miller 2016-12-07 14:48:00 -07:00
parent 7b2716dab1
commit 74c005d39c
No known key found for this signature in database
GPG Key ID: EC184FEE178C8ACB
2 changed files with 5 additions and 1 deletions

View File

@ -8,11 +8,13 @@
* New retina Media image derivatives array support (`![](image.jpg?derivatives=[640,1024,1440])`) [#1147](https://github.com/getgrav/grav/pull/1147)
* Added stream support for images (`![Sepia Image](image://image.jpg?sepia)`)
* Added stream support for links (`[Download PDF](user://data/pdf/my.pdf)`)
* Added new `onBeforeCacheClear` event to add custom paths to cache clearing process
1. [](#improved)
* Added alias `selfupdate` to the `self-upgrade` `bin/gpm` CLI command
* Synced `webserver-configs/htaccess.txt` with `.htaccess`
* Use permissions field in group details.
* Updated vendor libraries
* Added a warning on GPM update to update Grav first if needed [#1194](https://github.com/getgrav/grav/pull/1194)
1. [](#bugfix)
* Fix page collections problem with `@page.modular` [#1178](https://github.com/getgrav/grav/pull/1178)
* Fix issue with using a multiple taxonomy filter of which one had no results, thanks to @hughbris [#1184](https://github.com/getgrav/grav/issues/1184)

View File

@ -11,7 +11,7 @@ namespace Grav\Common;
use \Doctrine\Common\Cache as DoctrineCache;
use Grav\Common\Config\Config;
use Grav\Common\Filesystem\Folder;
use Grav\Common\Grav;
use RocketTheme\Toolbox\Event\Event;
/**
* The GravCache object is used throughout Grav to store and retrieve cached data.
@ -356,6 +356,8 @@ class Cache extends Getters
$remove_paths = self::$standard_remove;
}
// Clearing cache event to add paths to clear
Grav::instance()->fireEvent('onBeforeCacheClear', new Event(['paths' => &$remove_paths]));
foreach ($remove_paths as $stream) {