Ejemplo n.º 1
0
 private function checkCapabilities(Predis_Client $redisClient)
 {
     if (Predis_Shared_Utils::isCluster($redisClient->getConnection())) {
         throw new Predis_ClientException('Cannot initialize a PUB/SUB context over a cluster of connections');
     }
     $profile = $redisClient->getProfile();
     $commands = array('publish', 'subscribe', 'unsubscribe', 'psubscribe', 'punsubscribe');
     if ($profile->supportsCommands($commands) === false) {
         throw new Predis_ClientException('The current profile does not support PUB/SUB related commands');
     }
 }