Skip to content

Commit 606c28d

Browse files
authored
Merge pull request #12 from byjg/4.9
Serialize Object to Array
2 parents fb2981a + 70bee4e commit 606c28d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Psr16/ArrayCacheEngine.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function get($key, $default = null)
5858
if ($this->has($key)) {
5959
$key = $this->getKeyFromContainer($key);
6060
$this->logger->info("[Array cache] Get '$key' from L1 Cache");
61-
return $this->cache[$key];
61+
return unserialize($this->cache[$key]);
6262
} else {
6363
$this->logger->info("[Array cache] Not found '$key'");
6464
return $default;
@@ -84,7 +84,7 @@ public function set($key, $value, $ttl = null)
8484

8585
$this->logger->info("[Array cache] Set '$key' in L1 Cache");
8686

87-
$this->cache[$key] = $value;
87+
$this->cache[$key] = serialize($value);
8888
if (!empty($ttl)) {
8989
$this->cache["$key.ttl"] = $this->addToNow($ttl);
9090
}

0 commit comments

Comments
 (0)