This commit is contained in:
2021-03-24 17:57:08 +08:00
parent 2610267aba
commit 6df0cb4003
11 changed files with 576 additions and 532 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ class File extends Component implements ICache
public function set($key, $val): string|int
{
if (is_array($val) || is_object($val)) {
$val = serialize($val);
$val = swoole_serialize($val);
}
$tmpFile = $this->getCacheKey($key);
if (!$this->exists($tmpFile)) {
@@ -128,7 +128,7 @@ class File extends Component implements ICache
return false;
}
$content = file_get_contents($tmpFile);
return unserialize($content);
return swoole_unserialize($content);
}
/**