本文整理匯總了PHP中SessionHandler::read方法的典型用法代碼示例。如果您正苦於以下問題:PHP SessionHandler::read方法的具體用法?PHP SessionHandler::read怎麽用?PHP SessionHandler::read使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SessionHandler
的用法示例。
在下文中一共展示了SessionHandler::read方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: read
public function read($id)
{
$data = parent::read($id);
if (!$data) {
return "";
} else {
return decrypt($data, $this->key);
}
}
示例2: read
/**
* This function is automatically called after the "open" function
* Use the PHP default "read" function, then save the data and close the session if the session has not to be locked
*
* @param string $session_id
*
* @return string
*/
public function read($session_id)
{
$data = parent::read($session_id);
$this->session = $this->unserialize_session_data($data);
if (!$this->lock) {
$_SESSION = $this->session;
session_write_close();
}
return $data;
}
開發者ID:xhuberty,項目名稱:utils.session.optimistic-session-handler,代碼行數:18,代碼來源:OptimisticSessionHandler.php
示例3: 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'));
}
示例4: read
/**
* Workaround for php7 session_regenerate_id error
* @see https://bugs.php.net/bug.php?id=71187
*
* @param string $sessionId
* @return string
*/
public function read($sessionId)
{
return (string) parent::read($sessionId);
}
示例5: read
public function read($key)
{
++$this->i;
echo 'Read ', session_id(), "\n";
return parent::read($key);
}
示例6: read
/**
* Read session data
*
* @param string $sessionId
* @return string
*/
public function read($sessionId)
{
return $this->saveHandlerAdapter->read($sessionId);
}
示例7: read
public function read($session_id)
{
$data = parent::read($session_id);
return mcrypt_decrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB);
}
示例8: read
public function read($id)
{
return mcrypt_decrypt(MCRYPT_3DES, $this->key, parent::read($id), MCRYPT_MODE_ECB);
}
示例9: read
/**
* {@inheritdoc }
*/
public function read($sessionId)
{
return (string) $this->handler->read($sessionId);
}
示例10: read
public function read($key)
{
++$this->i;
return parent::read($key);
}
示例11: read
public function read($id)
{
$data = parent::read($id);
$data = mcrypt_decrypt(MCRYPT_3DES, $this->s_session_key, $data, MCRYPT_MODE_ECB);
return $data;
}
示例12: read
public function read($session_id)
{
return mcrypt_decrypt(self::$cipher, \Config::$encryptionKey, parent::read($session_id), self::$mode);
}
示例13: read
public function read($id)
{
// should error because parent::open hasn't been called
return parent::read($id);
}
示例14: read
public function read($session_id)
{
return parent::read($session_id);
}
示例15: read
/**
* Reads data from session.
*
* @param string $id The session id
*
* @return string session data
*/
public function read($id)
{
return mcrypt_decrypt($this->sessionCipherAlgorithm, $this->sessionCipherKey, parent::read($id), $this->sessionCipherMode);
}