fix for cache blowing up

Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
Andy Miller
2025-09-20 19:16:12 -06:00
parent cb0bbcdb8b
commit c172964025
2 changed files with 12 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
1. [](#bugfix)
* Deferred Extension support in Forked version of Twig 3
* Fix for cache blowing up when upgrading from 1.7 to 1.8
# v1.8.0-beta.4
## 01/27/2025

View File

@@ -537,8 +537,17 @@ class Cache extends Getters
// Delete entries in the doctrine cache if required
if (in_array($remove, ['all', 'standard'])) {
$cache = Grav::instance()['cache'];
$cache->driver->deleteAll();
try {
$grav = Grav::instance();
if ($grav->offsetExists('cache')) {
$cache = $grav['cache'];
if (isset($cache->driver)) {
$cache->driver->deleteAll();
}
}
} catch (\Throwable $e) {
$output[] = 'cache: ' . $e->getMessage();
}
}
// Clearing cache event to add paths to clear