enabled() public static method

Determines if the Redis extension has been installed and that there is a Redis server available.
public static enabled ( ) : boolean
return boolean Returns `true` if the Redis extension is enabled, `false` otherwise.
Esempio n. 1
0
 /**
  * Skip the test if the Redis extension is unavailable.
  *
  * @return void
  */
 public function skip()
 {
     $this->skipIf(!Redis::enabled(), 'The redis extension is not installed.');
     $redis = new RedisCore();
     $cfg = $this->_config;
     try {
         $redis->connect($cfg['host'], $cfg['port']);
     } catch (Exception $e) {
         $info = $redis->info();
         $msg = "redis-server does not appear to be running on {$cfg['host']}:{$cfg['port']}";
         $this->skipIf(!$info, $msg);
     }
     unset($redis);
 }