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

read() public method

public read ( $sessionId )
    public function read($sessionId)
    {
        if ($this->locking) {
            if (!$this->locked) {
                if (!$this->lockSession($sessionId)) {
                    return false;
                }
            }
        }
        return $this->redis->get($this->getRedisKey($sessionId)) ?: '';
    }

Usage Example

コード例 #1
0
 public function testSessionLocking()
 {
     $lockMaxWait = 2;
     ini_set('max_execution_time', $lockMaxWait);
     $this->redis->expects($this->exactly($lockMaxWait))->method('setnx')->with($this->equalTo('session_symfony.lock'), $this->equalTo('1'));
     $handler = new RedisSessionHandler($this->redis, array(), 'session', true, 1000000);
     $handler->read('_symfony');
 }
All Usage Examples Of Snc\RedisBundle\Session\Storage\Handler\RedisSessionHandler::read