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


PHP SessionHandler::read方法代碼示例

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

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

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

示例5: read

 public function read($key)
 {
     ++$this->i;
     echo 'Read ', session_id(), "\n";
     return parent::read($key);
 }
開發者ID:gleamingthecube,項目名稱:php,代碼行數:6,代碼來源:ext_session_tests_session_set_save_handler_class_001.php

示例6: read

 /**
  * Read session data
  *
  * @param string $sessionId
  * @return string
  */
 public function read($sessionId)
 {
     return $this->saveHandlerAdapter->read($sessionId);
 }
開發者ID:,項目名稱:,代碼行數:10,代碼來源:

示例7: read

 public function read($session_id)
 {
     $data = parent::read($session_id);
     return mcrypt_decrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB);
 }
開發者ID:dulinriley,項目名稱:classmatches,代碼行數:5,代碼來源:encryptedsession.php

示例8: read

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

示例9: read

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

示例10: read

 public function read($key)
 {
     ++$this->i;
     return parent::read($key);
 }
開發者ID:clifton98,項目名稱:hhvm,代碼行數:5,代碼來源:session_set_save_handler_class_003.php

示例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;
 }
開發者ID:nedron92,項目名稱:logd-oop,代碼行數:6,代碼來源:securesessionhandler.php

示例12: read

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

示例13: read

 public function read($id)
 {
     // should error because parent::open hasn't been called
     return parent::read($id);
 }
開發者ID:badlamer,項目名稱:hhvm,代碼行數:5,代碼來源:session_set_save_handler_class_005.php

示例14: read

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

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


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