debug reverse value for replace

This commit is contained in:
Dennis Eichhorn 2019-12-08 10:00:37 +01:00
parent d96798b6b3
commit b3186cce3a

View File

@ -133,7 +133,7 @@ class RedisCache extends ConnectionAbstract
*/ */
public function get($key, int $expire = -1) public function get($key, int $expire = -1)
{ {
if ($this->status !== CacheStatus::OK || !$this->con->exists($key)) { if ($this->status !== CacheStatus::OK || $this->con->exists($key) < 1) {
return null; return null;
} }
@ -197,8 +197,6 @@ class RedisCache extends ConnectionAbstract
return false; return false;
} }
// todo: parse value
if ($this->con->exists($key) > 0) { if ($this->con->exists($key) > 0) {
$this->set($key, $this->build($value), $expire); $this->set($key, $this->build($value), $expire);
@ -306,6 +304,7 @@ class RedisCache extends ConnectionAbstract
*/ */
private function reverseValue(int $type, $raw, int $start) private function reverseValue(int $type, $raw, int $start)
{ {
var_dump($raw);
switch ($type) { switch ($type) {
case CacheValueType::_INT: case CacheValueType::_INT:
return (int) \substr($raw, $start + 1); return (int) \substr($raw, $start + 1);