Skip to content

Commit

Permalink
Merge pull request #12 from byjg/4.9
Browse files Browse the repository at this point in the history
Serialize Object to Array
  • Loading branch information
byjg authored Aug 27, 2024
2 parents fb2981a + 70bee4e commit 606c28d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Psr16/ArrayCacheEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function get($key, $default = null)
if ($this->has($key)) {
$key = $this->getKeyFromContainer($key);
$this->logger->info("[Array cache] Get '$key' from L1 Cache");
return $this->cache[$key];
return unserialize($this->cache[$key]);
} else {
$this->logger->info("[Array cache] Not found '$key'");
return $default;
Expand All @@ -84,7 +84,7 @@ public function set($key, $value, $ttl = null)

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

$this->cache[$key] = $value;
$this->cache[$key] = serialize($value);
if (!empty($ttl)) {
$this->cache["$key.ttl"] = $this->addToNow($ttl);
}
Expand Down

0 comments on commit 606c28d

Please sign in to comment.