From c8438e8c43474b5102a3258b0ff6b7b42039c8a3 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Fri, 28 Jun 2024 11:27:28 +0800 Subject: [PATCH] + [task#121999] Add the redis cache driver. --- lib/cache/cache.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/cache/cache.class.php b/lib/cache/cache.class.php index 153f9cccf1..4cea47d51f 100644 --- a/lib/cache/cache.class.php +++ b/lib/cache/cache.class.php @@ -13,6 +13,7 @@ helper::import(dirname(__FILE__) . DS . 'simple-cache' . DS . 'CacheInterface.ph helper::import(dirname(__FILE__) . DS . 'simple-cache' . DS . 'CacheException.php'); helper::import(dirname(__FILE__) . DS . 'simple-cache' . DS . 'InvalidArgumentException.php'); helper::import(dirname(__FILE__) . DS . 'driver' . DS . 'ApcuDriver.php'); +helper::import(dirname(__FILE__) . DS . 'driver' . DS . 'RedisDriver.php'); helper::import(dirname(__FILE__) . DS . 'driver' . DS . 'YacDriver.php'); helper::import(dirname(__FILE__) . DS . 'driver' . DS . 'FileDriver.php'); @@ -26,6 +27,8 @@ class cache const DRIVER_YAC = 'Yac'; + const DRIVER_REDIS = 'Redis'; + /** * @var ZenTao\Cache\SimpleCache\CacheInterface */ @@ -45,6 +48,9 @@ class cache case self::DRIVER_FILE: $className = 'ZenTao\Cache\Driver\FileDriver'; break; + case self::DRIVER_REDIS: + $className = 'ZenTao\Cache\Driver\RedisDriver'; + break; default: throw new InvalidArgumentException("Driver {$driver} is not supported."); }