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


PHP SessionManager::getStorage方法代碼示例

本文整理匯總了PHP中Zend\Session\SessionManager::getStorage方法的典型用法代碼示例。如果您正苦於以下問題:PHP SessionManager::getStorage方法的具體用法?PHP SessionManager::getStorage怎麽用?PHP SessionManager::getStorage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Session\SessionManager的用法示例。


在下文中一共展示了SessionManager::getStorage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testCanPassStorageToConstructor

 public function testCanPassStorageToConstructor()
 {
     $storage = new Session\Storage\ArrayStorage();
     $manager = new SessionManager(null, $storage);
     $this->assertSame($storage, $manager->getStorage());
 }
開發者ID:navassouza,項目名稱:zf2,代碼行數:6,代碼來源:SessionManagerTest.php

示例2: aggregateImpactInSession

 /**
  * If configured aggregate the impact from the report in the session and return the updated value.
  * @param IDS_Report $report
  * @return int
  */
 protected function aggregateImpactInSession(IDS_Report $report)
 {
     if ($this->config['aggregate_in_session']) {
         $sessionManager = new SessionManager();
         $sessionManager->start();
         $session = $sessionManager->getStorage();
         if (!isset($session->ZeSecurityIDS)) {
             $session->ZeSecurityIDS = array('impact' => 0);
         }
         $impact = $session->ZeSecurityIDS['impact'];
         $impact += $report->getImpact();
         $session->ZeSecurityIDS['impact'] = $impact;
     } else {
         $impact = $report->getImpact();
     }
     return $impact;
 }
開發者ID:ColdSmoke627,項目名稱:ZeSecurity,代碼行數:22,代碼來源:Monitor.php

示例3: getSession

 /**
  * return a session storage instance
  * @return \Zend\Session\Storage\StorageInterface
  */
 protected function getSession()
 {
     $sessionManager = new SessionManager();
     $sessionManager->start();
     return $sessionManager->getStorage();
 }
開發者ID:bb-drummer,項目名稱:ZeTheme,代碼行數:10,代碼來源:Session.php

示例4: testCanPassStorageClassToConfigurationOptions

 public function testCanPassStorageClassToConfigurationOptions()
 {
     $manager = new SessionManager(array('storage' => 'Zend\\Session\\Storage\\ArrayStorage'));
     $storage = $manager->getStorage();
     $this->assertTrue($storage instanceof Session\Storage\ArrayStorage);
 }
開發者ID:alab1001101,項目名稱:zf2,代碼行數:6,代碼來源:SessionManagerTest.php

示例5: registerShutdownFunction

 /**
  * According to the PHP manual, session_write_close should always be
  * registered as a shutdown function when using an object as a session
  * handler: http://us.php.net/manual/en/function.session-set-save-handler.php
  *
  * This method sets that up.
  *
  * @param SessionManager $sessionManager Session manager instance
  *
  * @return void
  */
 protected function registerShutdownFunction(SessionManager $sessionManager)
 {
     register_shutdown_function(function () use($sessionManager) {
         // If storage is immutable, the session is already closed:
         if (!$sessionManager->getStorage()->isImmutable()) {
             $sessionManager->writeClose();
         }
     });
 }
開發者ID:bbeckman,項目名稱:NDL-VuFind2,代碼行數:20,代碼來源:ManagerFactory.php


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