File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 31
31
"php" : " ^5.5|^7.0" ,
32
32
"ext-redis" : " *" ,
33
33
"psr/cache" : " 1.0.0" ,
34
- "cache/adapter-common" : " ^0.1. 2" ,
34
+ "cache/adapter-common" : " ^0.2" ,
35
35
"cache/taggable-cache" : " ^0.3" ,
36
- "cache/hierarchical-cache" : " ^0.1 "
36
+ "cache/hierarchical-cache" : " ^0.2 "
37
37
},
38
38
"require-dev" :
39
39
{
40
40
"phpunit/phpunit" : " ^5.1|^4.0" ,
41
- "cache/integration-tests" : " dev-master "
41
+ "cache/integration-tests" : " ^0.7 "
42
42
},
43
43
"provide" :
44
44
{
Original file line number Diff line number Diff line change @@ -38,7 +38,11 @@ public function __construct(\Redis $cache)
38
38
39
39
protected function fetchObjectFromCache ($ key )
40
40
{
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 ;
42
46
}
43
47
44
48
protected function clearAllObjectsFromCache ()
@@ -58,12 +62,13 @@ protected function clearOneObjectFromCache($key)
58
62
59
63
protected function storeItemInCache ($ key , CacheItemInterface $ item , $ ttl )
60
64
{
61
- $ key = $ this ->getHierarchyKey ($ key );
65
+ $ key = $ this ->getHierarchyKey ($ key );
66
+ $ data = serialize ([true , $ item ->get ()]);
62
67
if ($ ttl === null ) {
63
- return $ this ->cache ->set ($ key , serialize ( $ item ) );
68
+ return $ this ->cache ->set ($ key , $ data );
64
69
}
65
70
66
- return $ this ->cache ->setex ($ key , $ ttl , serialize ( $ item ) );
71
+ return $ this ->cache ->setex ($ key , $ ttl , $ data );
67
72
}
68
73
69
74
protected function getValueFormStore ($ key )
You can’t perform that action at this time.
0 commit comments