Skip to content

Commit

Permalink
927 - Fix DebugEngine not using fallback config
Browse files Browse the repository at this point in the history
  • Loading branch information
ajibarra committed May 19, 2023
1 parent facde4d commit 863b4a4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Panel/CachePanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,17 @@ public function initialize()
if (isset($config['className']) && $config['className'] instanceof DebugEngine) {
$instance = $config['className'];
} elseif (isset($config['className'])) {
Cache::drop($name);
$instance = new DebugEngine($config, $name, $this->logger);
/** @var \Cake\Cache\CacheEngine $engine */
$engine = Cache::pool($name);
// Unload from the cache registry so that subsequence calls to
// Cache::pool($name) use the new config with DebugEngine instance set below.
Cache::getRegistry()->unload($name);

$instance = new DebugEngine($engine, $name, $this->logger);
$instance->init();
$config['className'] = $instance;

Cache::drop($name);
Cache::setConfig($name, $config);
}
if (isset($instance)) {
Expand Down

0 comments on commit 863b4a4

Please sign in to comment.