File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 3131 "php" : " ^5.5|^7.0" ,
3232 "ext-redis" : " *" ,
3333 "psr/cache" : " 1.0.0" ,
34- "cache/adapter-common" : " ^0.1. 2" ,
34+ "cache/adapter-common" : " ^0.2" ,
3535 "cache/taggable-cache" : " ^0.3" ,
36- "cache/hierarchical-cache" : " ^0.1 "
36+ "cache/hierarchical-cache" : " ^0.2 "
3737 },
3838 "require-dev" :
3939 {
4040 "phpunit/phpunit" : " ^5.1|^4.0" ,
41- "cache/integration-tests" : " dev-master "
41+ "cache/integration-tests" : " ^0.7 "
4242 },
4343 "provide" :
4444 {
Original file line number Diff line number Diff line change @@ -38,7 +38,11 @@ public function __construct(\Redis $cache)
3838
3939 protected function fetchObjectFromCache ($ key )
4040 {
41- return unserialize ($ this ->cache ->get ($ this ->getHierarchyKey ($ key )));
41+ if (false === $ result = unserialize ($ this ->cache ->get ($ this ->getHierarchyKey ($ key )))) {
42+ return [false , null ];
43+ }
44+
45+ return $ result ;
4246 }
4347
4448 protected function clearAllObjectsFromCache ()
@@ -58,12 +62,13 @@ protected function clearOneObjectFromCache($key)
5862
5963 protected function storeItemInCache ($ key , CacheItemInterface $ item , $ ttl )
6064 {
61- $ key = $ this ->getHierarchyKey ($ key );
65+ $ key = $ this ->getHierarchyKey ($ key );
66+ $ data = serialize ([true , $ item ->get ()]);
6267 if ($ ttl === null ) {
63- return $ this ->cache ->set ($ key , serialize ( $ item ) );
68+ return $ this ->cache ->set ($ key , $ data );
6469 }
6570
66- return $ this ->cache ->setex ($ key , $ ttl , serialize ( $ item ) );
71+ return $ this ->cache ->setex ($ key , $ ttl , $ data );
6772 }
6873
6974 protected function getValueFormStore ($ key )
You can’t perform that action at this time.
0 commit comments