当前位置: 首页>>代码示例>>PHP>>正文


PHP SimpleSAML_Session::instance方法代码示例

本文整理汇总了PHP中SimpleSAML_Session::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Session::instance方法的具体用法?PHP SimpleSAML_Session::instance怎么用?PHP SimpleSAML_Session::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleSAML_Session的用法示例。


在下文中一共展示了SimpleSAML_Session::instance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: useTransientSession

 /**
  * Use a transient session.
  *
  * Create a session that should not be saved at the end of the request.
  * Subsequent calls to getInstance() will return this transient session.
  */
 public static function useTransientSession()
 {
     if (isset(self::$instance)) {
         /* We already have a session. Don't bother with a transient session. */
         return;
     }
     self::$instance = new SimpleSAML_Session(TRUE);
 }
开发者ID:jerrcs,项目名称:simplesamlphp,代码行数:14,代码来源:Session.php

示例2: load

 /**
  * Load a given session as the current one.
  *
  * This method will also set the track ID in the logger to the one in the given session.
  *
  * Warning: never set self::$instance yourself, call this method instead.
  *
  * @param SimpleSAML_Session $session The session to load.
  * @return SimpleSAML_Session The session we just loaded, just for convenience.
  */
 private static function load(SimpleSAML_Session $session)
 {
     SimpleSAML\Logger::setTrackId($session->getTrackID());
     self::$instance = $session;
     return self::$instance;
 }
开发者ID:simplesamlphp,项目名称:simplesamlphp,代码行数:16,代码来源:Session.php

示例3: getInstance

 /**
  * Retrieves the current session. Will create a new session if there isn't a session.
  *
  * @return The current session.
  */
 public static function getInstance()
 {
     /* Check if we already have initialized the session. */
     if (isset(self::$instance)) {
         return self::$instance;
     }
     /* Check if we have stored a session stored with the session
      * handler.
      */
     self::$instance = self::loadSession();
     if (self::$instance !== NULL) {
         //print "FOUND AND IS USING A SESSION INSTANCE<br>"; // TODO remove
         return self::$instance;
     }
     //print "DID NOT FIND A SESSION INSTANCE<br>"; // TODO Remove
     /* Create a new session. */
     self::$instance = new SimpleSAML_Session();
     /* Save the new session with the session handler. */
     $sh = SimpleSAML_SessionHandler::getSessionHandler();
     $sh->set('SimpleSAMLphp_SESSION', self::$instance);
     return self::$instance;
 }
开发者ID:stefanotirati,项目名称:moodle-google-apps,代码行数:27,代码来源:Session.php

示例4: useTransientSession

 /**
  * Use a transient session.
  *
  * Create a session that should not be saved at the end of the request.
  * Subsequent calls to getInstance() will return this transient session.
  */
 public static function useTransientSession()
 {
     if (isset(self::$instance)) {
         // we already have a session, don't bother with a transient session
         return;
     }
     self::$instance = new SimpleSAML_Session(true);
 }
开发者ID:jstormes,项目名称:simplesamlphp,代码行数:14,代码来源:Session.php


注:本文中的SimpleSAML_Session::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。