Skip to content

Commit 063aadf

Browse files
authored
Merge pull request #938 from CakeDC/issue/927
927 - Fix DebugEngine not using fallback config
2 parents facde4d + 863b4a4 commit 063aadf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Panel/CachePanel.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,17 @@ public function initialize()
5555
if (isset($config['className']) && $config['className'] instanceof DebugEngine) {
5656
$instance = $config['className'];
5757
} elseif (isset($config['className'])) {
58-
Cache::drop($name);
59-
$instance = new DebugEngine($config, $name, $this->logger);
58+
/** @var \Cake\Cache\CacheEngine $engine */
59+
$engine = Cache::pool($name);
60+
// Unload from the cache registry so that subsequence calls to
61+
// Cache::pool($name) use the new config with DebugEngine instance set below.
62+
Cache::getRegistry()->unload($name);
63+
64+
$instance = new DebugEngine($engine, $name, $this->logger);
65+
$instance->init();
6066
$config['className'] = $instance;
67+
68+
Cache::drop($name);
6169
Cache::setConfig($name, $config);
6270
}
6371
if (isset($instance)) {

0 commit comments

Comments
 (0)