Skip to content

Commit 638cdb0

Browse files
authored
Merge pull request #54 from ejegg/memcache
Memcache
2 parents a1208fc + dc8c272 commit 638cdb0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/PHPQueue/Backend/Memcache.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ public function set($key, $data, $expiry=null)
8080
if (empty($expiry)) {
8181
$expiry = $this->expiry;
8282
}
83-
$status = $this->getConnection()->replace($key, $data, $this->use_compression, $expiry);
83+
$status = $this->getConnection()->replace($key, json_encode($data), $this->use_compression, $expiry);
8484
if ($status == false) {
85-
$status = $this->getConnection()->set($key, $data, $this->use_compression, $expiry);
85+
$status = $this->getConnection()->set($key, json_encode($data), $this->use_compression, $expiry);
8686
}
8787
if (!$status) {
8888
throw new BackendException("Unable to save data.");
@@ -97,7 +97,7 @@ public function get($key)
9797
{
9898
$this->beforeGet($key);
9999

100-
return $this->getConnection()->get($key);
100+
return json_decode($this->getConnection()->get($key), true);
101101
}
102102

103103
public function clear($key)

0 commit comments

Comments
 (0)