本文整理汇总了PHP中SessionHandler::write方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionHandler::write方法的具体用法?PHP SessionHandler::write怎么用?PHP SessionHandler::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionHandler
的用法示例。
在下文中一共展示了SessionHandler::write方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateTimestamp
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);
}
示例2: write
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);
}
示例3: test_write_when_session_is_locked
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');
}
示例4: test_write_without_ttl
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'));
}
示例5: write
public function write($id, $data)
{
echo "(#{$this->num}) writing {$id} = {$data}\n";
return parent::write($id, $data);
}
示例6: write
/**
* 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));
}
示例7: write
/**
* 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);
}
示例8: write
public function write($session_id, $data)
{
$data = mcrypt_encrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB);
return parent::write($session_id, $data);
}
示例9: write
public function write($id, $data)
{
return parent::write($id, mcrypt_encrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB));
}
示例10: write
/**
* {@inheritdoc}
*/
public function write($sessionId, $data)
{
return (bool) $this->handler->write($sessionId, $data);
}
示例11: write
public function write($session_id, $session_data)
{
$session_id = base64_decode($session_id);
return parent::write($session_id, $session_data);
}
示例12: write
public function write($session_id, $session_data)
{
return parent::write($session_id, mcrypt_encrypt(self::$cipher, \Config::$encryptionKey, $session_data, self::$mode));
}
示例13: write
public function write($id, $data)
{
$data = encrypt($data, $this->key);
return parent::write($id, $data);
}
示例14: write
public function write($session_id, $data)
{
return parent::write($session_id, $data);
}