Skip to content

Commit 73bac35

Browse files
authored
Merge pull request #12 from Traackr/Patch-writeWithParent-FallbackEngine
Bug fix: Wrong cache prefix used in writeWithParent with FallbackEngine
2 parents 74534b3 + 010a06c commit 73bac35

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/CacheEnginesHelper.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ public static function writeWithParent(
8080
$config = 'default',
8181
$parentKey = ''
8282
) {
83-
$settings = Cache::settings($config);
83+
84+
if (method_exists(Cache::engine($config), 'getActiveCacheSettings')) {
85+
$settings = Cache::engine($config)->getActiveCacheSettings();
86+
} else {
87+
$settings = Cache::settings($config);
88+
}
8489

8590
if (empty($settings)) {
8691
return false;

src/FallbackEngine.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,9 @@ public function key($key)
150150
{
151151
return Cache::engine($this->activeCache)->key($key);
152152
}
153+
154+
public function getActiveCacheSettings()
155+
{
156+
return Cache::engine($this->activeCache)->settings();
157+
}
153158
}

0 commit comments

Comments
 (0)