5use \SimpleSAML_Configuration as Configuration;
 
   22        assert(
$redis === 
null || is_subclass_of(
$redis, 
'Predis\\Client'));
 
   24        if (!class_exists(
'\Predis\Client')) {
 
   25            throw new \SimpleSAML\Error\CriticalConfigurationError(
'predis/predis is not available.');
 
   29            $config = Configuration::getInstance();
 
   31            $host = 
$config->getString(
'store.redis.host', 
'localhost');
 
   32            $port = 
$config->getInteger(
'store.redis.port', 6379);
 
   33            $prefix = 
$config->getString(
'store.redis.prefix', 
'SimpleSAMLphp');
 
   35            $redis = new \Predis\Client(
 
   55        if (method_exists($this->redis, 
'disconnect')) {
 
   56            $this->redis->disconnect();
 
   70        assert(is_string(
$type));
 
   71        assert(is_string(
$key));
 
   73        $result = $this->redis->get(
"{$type}.{$key}");
 
   92        assert(is_string(
$type));
 
   93        assert(is_string(
$key));
 
   96        $serialized = serialize($value);
 
   99            $this->redis->set(
"{$type}.{$key}", $serialized);
 
  102            $this->redis->setex(
"{$type}.{$key}", 
$expire - time(), $serialized);
 
  114        assert(is_string(
$type));
 
  115        assert(is_string(
$key));
 
  117        $this->redis->del(
"{$type}.{$key}");
 
An exception for terminatinating execution or to throw for unit testing.
__construct($redis=null)
Initialize the Redis data store.
__destruct()
Deconstruct the Redis data store.