当前位置: 首页>>代码示例>>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;未经允许,请勿转载。