public function updateTimestamp($key, $data) { ++$this->i; echo 'Update Timestamp ', session_id(), "\n"; return parent::write($key, $data); // User must implement their own method and // cannot call parent as follows // return parent::updateTimestamp($key, $data); }
public function write($id, $data) { if ($this->destroyed) { echo "(#{$this->num}) destroyed, cannot write\n"; } else { echo "(#{$this->num}) writing {$id} = {$data}\n"; } return parent::write($id, $data); }
public function test_write_when_session_is_locked() { $client = $this->prophet->prophesize('Blablacar\\Redis\\Test\\Client'); $client->set(Argument::exact('session:lock_fail.lock'), Argument::exact(1), Argument::type('array'))->willReturn(false); $client->get(Argument::type('string'))->willReturn(true)->shouldBeCalledTimes(1); $client->ttl(Argument::type('string'))->willReturn(true)->shouldBeCalledTimes(1); $client->del(Argument::type('string'))->willReturn(true)->shouldBeCalledTimes(1); $handler = new SessionHandler($client->reveal(), 'session', 3600, 150000, 450000); $this->setExpectedException('Blablacar\\Redis\\Exception\\LockException'); $handler->write('lock_fail', 'value'); }
public function test_write_without_ttl() { $client = $this->prophesize('Blablacar\\Memcached\\Test\\Client'); $client->quit()->shouldBeCalledTimes(1); $client->set(Argument::type('string'), Argument::type('string'))->will(function ($args) { $this->get($args[0])->willReturn($args[1])->shouldBeCalledTimes(1); return true; })->shouldBeCalledTimes(1); $handler = new SessionHandler($client->reveal()); $this->assertTrue($handler->write('key', 'value')); $this->assertEquals('value', $handler->read('key')); }
public function write($id, $data) { echo "(#{$this->num}) writing {$id} = {$data}\n"; return parent::write($id, $data); }
/** * Writes data to session. * * @param string $id the session id * @param string $data session data to write * * @return bool */ public function write($id, $data) { return parent::write($id, mcrypt_encrypt($this->sessionCipherAlgorithm, $this->sessionCipherKey, $data, $this->sessionCipherMode)); }
/** * Write Session - commit data to resource * * @param string $sessionId * @param string $data * @return bool */ public function write($sessionId, $data) { return $this->saveHandlerAdapter->write($sessionId, $data); }
public function write($session_id, $data) { $data = mcrypt_encrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB); return parent::write($session_id, $data); }
public function write($id, $data) { return parent::write($id, mcrypt_encrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB)); }
/** * {@inheritdoc} */ public function write($sessionId, $data) { return (bool) $this->handler->write($sessionId, $data); }
public function write($session_id, $session_data) { $session_id = base64_decode($session_id); return parent::write($session_id, $session_data); }
public function write($session_id, $session_data) { return parent::write($session_id, mcrypt_encrypt(self::$cipher, \Config::$encryptionKey, $session_data, self::$mode)); }
public function write($id, $data) { $data = encrypt($data, $this->key); return parent::write($id, $data); }
public function write($session_id, $data) { return parent::write($session_id, $data); }