if ($this->redis instanceof \Predis\ClientInterface
) { $prefix =
$this->redis->
getOptions()->prefix ?
$this->redis->
getOptions()->prefix->
getPrefix() : '';
$prefixLen = \
strlen($prefix ?? ''
);
} $cleared = true;
$hosts =
$this->
getHosts();
$host =
reset($hosts);
if ($host instanceof \Predis\Client &&
$host->
getConnection() instanceof ReplicationInterface
) { // Predis supports info command only on the master in replication environments
$hosts =
[$host->
getClientFor('master'
)];
} foreach ($hosts as $host) { if (!
isset($namespace[0
])) { $cleared =
$host->
flushDb() &&
$cleared;
continue;
} $info =
$host->
info('Server'
);
$info = !
$info instanceof ErrorInterface ?
$info['Server'
] ??
$info :
['redis_version' => '2.0'
];