add bool type support for LightCache (#325)

This commit is contained in:
Wang
2023-03-03 21:58:40 +08:00
committed by GitHub
parent 6543574695
commit 9d1952f5f8

View File

@@ -188,6 +188,9 @@ class LightCache
$data_type = ''; $data_type = '';
} elseif (is_int($value)) { } elseif (is_int($value)) {
$data_type = 'int'; $data_type = 'int';
} elseif (is_bool($value)) {
$data_type = 'bool';
$value = json_encode($value);
} else { } else {
throw new LightCacheException('E00048', 'Only can set string, array and int'); throw new LightCacheException('E00048', 'Only can set string, array and int');
} }