Skip to content

Commit

Permalink
Return Empty Dataset for Unsupported Redis Classes
Browse files Browse the repository at this point in the history
  • Loading branch information
pykettk committed Sep 28, 2024
1 parent 4e59e10 commit 5a1146c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Model/RedisInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public function __construct(

public function get(): array
{
$redisInfo = $this->getAllRedisInfo();
if (!($redisInfo = $this->getAllRedisInfo())) {
return [];
}

return [
'version' => $redisInfo['redis_version'],
Expand Down Expand Up @@ -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()
: [];
}
}

0 comments on commit 5a1146c

Please sign in to comment.