當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SessionHandler::write方法代碼示例

本文整理匯總了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);
 }
開發者ID:gleamingthecube,項目名稱:php,代碼行數:9,代碼來源:ext_session_tests_session_set_save_handler_class_001.php

示例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);
 }
開發者ID:badlamer,項目名稱:hhvm,代碼行數:9,代碼來源:session_set_save_handler_class_011.php

示例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');
 }
開發者ID:blablacar,項目名稱:redis-client,代碼行數:11,代碼來源:SessionHandlerTest.php

示例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'));
 }
開發者ID:blablacar,項目名稱:memcached-client,代碼行數:12,代碼來源:SessionHandlerTest.php

示例5: write

 public function write($id, $data)
 {
     echo "(#{$this->num}) writing {$id} = {$data}\n";
     return parent::write($id, $data);
 }
開發者ID:badlamer,項目名稱:hhvm,代碼行數:5,代碼來源:session_set_save_handler_class_007.php

示例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));
 }
開發者ID:ahmedash95,項目名稱:Lily,代碼行數:12,代碼來源:sessionmanager.php

示例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);
 }
開發者ID:,項目名稱:,代碼行數:11,代碼來源:

示例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);
 }
開發者ID:dulinriley,項目名稱:classmatches,代碼行數:5,代碼來源:encryptedsession.php

示例9: write

 public function write($id, $data)
 {
     return parent::write($id, mcrypt_encrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB));
 }
開發者ID:sam25,項目名稱:website,代碼行數:4,代碼來源:SecureSessionHandler.php

示例10: write

 /**
  * {@inheritdoc}
  */
 public function write($sessionId, $data)
 {
     return (bool) $this->handler->write($sessionId, $data);
 }
開發者ID:vectrex,項目名稱:vxphp,代碼行數:7,代碼來源:NativeSessionWrapper.php

示例11: write

 public function write($session_id, $session_data)
 {
     $session_id = base64_decode($session_id);
     return parent::write($session_id, $session_data);
 }
開發者ID:TDA,項目名稱:ictf2015-syperservice,代碼行數:5,代碼來源:config.php

示例12: write

 public function write($session_id, $session_data)
 {
     return parent::write($session_id, mcrypt_encrypt(self::$cipher, \Config::$encryptionKey, $session_data, self::$mode));
 }
開發者ID:rlaskey,項目名稱:dm-track,代碼行數:4,代碼來源:session_handler.php

示例13: write

 public function write($id, $data)
 {
     $data = encrypt($data, $this->key);
     return parent::write($id, $data);
 }
開發者ID:simplified-framework,項目名稱:framework,代碼行數:5,代碼來源:EncryptedSessionHandler.php

示例14: write

 public function write($session_id, $data)
 {
     return parent::write($session_id, $data);
 }
開發者ID:brunoxu,項目名稱:mycncart,代碼行數:4,代碼來源:native.php


注:本文中的SessionHandler::write方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。