Write/read inconsistence
mrceperka opened this issue Β· comments
Mr Ceperka commented
Hello π,
I've got a problem..
$x = ['foo' => 'bar'];
$cache->write('x', $x);
$cache->read('x') === $x; // false, because $cache->read will return \stdClass
- Write uses
json_encode
, read usesjson_decode
. - Found that thanks to nextras/orm, CachedPlatform::getColumns, which failed because
\stdClass
was obtained from storage insted of andarray
.
Why are data encoded and decoded?
Could it be just passed to redis (so it would be handler by redis serialization thing...)
Thanks π