From 9d1952f5f856e32f11b7e7c36bd15ba837804ac4 Mon Sep 17 00:00:00 2001 From: Wang <69124377+YiwanGi@users.noreply.github.com> Date: Fri, 3 Mar 2023 21:58:40 +0800 Subject: [PATCH] add bool type support for LightCache (#325) --- src/ZM/Store/LightCache.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ZM/Store/LightCache.php b/src/ZM/Store/LightCache.php index d5d56a7d..64b5a545 100644 --- a/src/ZM/Store/LightCache.php +++ b/src/ZM/Store/LightCache.php @@ -188,7 +188,10 @@ class LightCache $data_type = ''; } elseif (is_int($value)) { $data_type = 'int'; - } else { + } elseif (is_bool($value)) { + $data_type = 'bool'; + $value = json_encode($value); + } else { throw new LightCacheException('E00048', 'Only can set string, array and int'); } try {