Skip to content

Commit 5866c77

Browse files
committed
Fixed SF exception
1 parent 3408cdb commit 5866c77

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/phpFastCache/Cache/ItemBaseTrait.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,10 @@ public function getRemovedTags()
382382
*/
383383
final public function __sleep()
384384
{
385-
throw new \RuntimeException('phpFastCache Item entities cannot be serialized. Use CacheItemPoolInterface::saved() instead.');
385+
$info = get_object_vars($this);
386+
$info[ 'driver' ] = 'object(' . get_class($info[ 'driver' ]) . ')';
387+
388+
return (array) $info;
386389
}
387390

388391
/**

0 commit comments

Comments
 (0)