diff --git a/Model/RedisInfo.php b/Model/RedisInfo.php index 4f452dc..30109f0 100644 --- a/Model/RedisInfo.php +++ b/Model/RedisInfo.php @@ -39,7 +39,9 @@ public function __construct( public function get(): array { - $redisInfo = $this->getAllRedisInfo(); + if (!($redisInfo = $this->getAllRedisInfo())) { + return []; + } return [ 'version' => $redisInfo['redis_version'], @@ -186,6 +188,8 @@ public function getHistoricRedisReportData(): array */ public function getAllRedisInfo(): array { - return $this->redis->getInfo(); + return $this->redis instanceof Cm_Cache_Backend_Redis && method_exists($this->redis, 'getInfo') + ? $this->redis->getInfo() + : []; } }