Skip to content

Commit

Permalink
Serialize object to array
Browse files Browse the repository at this point in the history
  • Loading branch information
byjg committed Aug 27, 2024
1 parent 5b0d358 commit 70bee4e
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 70bee4e

Please sign in to comment.