Snc\RedisBundle\Session\Storage\Handler\RedisSessionHandler::__construct PHP Method

__construct() public method

Redis session storage constructor.
public __construct ( Client | Redis $redis, array $options = [], string $prefix = 'session', $locking = true, $spinLockWait = 150000 )
$redis Predis\Client | Redis Redis database connection
$options array Session options
$prefix string Prefix to use when writing session data
    public function __construct($redis, array $options = array(), $prefix = 'session', $locking = true, $spinLockWait = 150000)
    {
        $this->redis = $redis;
        $this->ttl = isset($options['gc_maxlifetime']) ? (int) $options['gc_maxlifetime'] : 0;
        if (isset($options['cookie_lifetime']) && $options['cookie_lifetime'] > $this->ttl) {
            $this->ttl = (int) $options['cookie_lifetime'];
        }
        $this->prefix = $prefix;
        $this->locking = $locking;
        $this->locked = false;
        $this->lockKey = null;
        $this->spinLockWait = $spinLockWait;
        $this->lockMaxWait = ini_get('max_execution_time');
        if (!$this->lockMaxWait) {
            $this->lockMaxWait = self::DEFAULT_MAX_EXECUTION_TIME;
        }
    }