lundi 16 janvier 2017

Check if redis with password is running

I have Laravel 5.1 and I have a redis server. But I would, before launching an event on redis, check if it is running. But my problem is that I'have put a password on redis and know my code for check doesn't work. Before insert password my code was:

$redis = Redis::connection();
        $host = $redis->getConnection()->getParameters()->host;
        $port = $redis->getConnection()->getParameters()->port;
        $fp = @fsockopen($host, $port);

        if (!$fp){
            return false;
        }else{
            return true;
        };

How Can I add password for ping redis?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2jqkMKD
via IFTTT

Aucun commentaire:

Enregistrer un commentaire