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


PHP ilSession::_exists方法代码示例

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


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

示例1: testBasicSessionBehaviour

 /**
  * @group IL_Init
  */
 public function testBasicSessionBehaviour()
 {
     global $ilUser;
     include_once "./Services/Authentication/classes/class.ilSession.php";
     $result = "";
     ilSession::_writeData("123456", "Testdata");
     if (ilSession::_exists("123456")) {
         $result .= "exists-";
     }
     if (ilSession::_getData("123456") == "Testdata") {
         $result .= "write-get-";
     }
     $duplicate = ilSession::_duplicate("123456");
     if (ilSession::_getData($duplicate) == "Testdata") {
         $result .= "duplicate-";
     }
     ilSession::_destroy("123456");
     if (!ilSession::_exists("123456")) {
         $result .= "destroy-";
     }
     ilSession::_destroyExpiredSessions();
     if (ilSession::_exists($duplicate)) {
         $result .= "destroyExp-";
     }
     ilSession::_destroyByUserId($ilUser->getId());
     if (!ilSession::_exists($duplicate)) {
         $result .= "destroyByUser-";
     }
     $this->assertEquals("exists-write-get-duplicate-destroy-destroyExp-destroyByUser-", $result);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:33,代码来源:ilSessionTest.php

示例2: setSessionHandler

 /**
  * set session handler to db
  * 
  * Used in Soap/CAS
  */
 public static function setSessionHandler()
 {
     if (ini_get('session.save_handler') != 'user') {
         ini_set("session.save_handler", "user");
     }
     require_once "Services/Authentication/classes/class.ilSessionDBHandler.php";
     $db_session_handler = new ilSessionDBHandler();
     if (!$db_session_handler->setSaveHandler()) {
         self::abortAndDie("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
     }
     // Do not accept external session ids
     if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST')) {
         session_regenerate_id();
     }
 }
开发者ID:JKN-INC,项目名称:SHELBY-ILIAS,代码行数:20,代码来源:class.ilInitialisation.php

示例3: _writeData

 /**
  * Write session data
  *
  * @param	string		session id
  * @param	string		session data
  */
 static function _writeData($a_session_id, $a_data)
 {
     global $ilDB, $ilClientIniFile;
     if ($GLOBALS['WEB_ACCESS_WITHOUT_SESSION']) {
         // Prevent session data written for web access checker
         // when no cookie was sent (e.g. for pdf files linking others).
         // This would result in new session records for each request.
         return false;
     }
     $now = time();
     // prepare session data
     $fields = array("user_id" => array("integer", (int) $_SESSION["AccountId"]), "expires" => array("integer", self::getExpireValue()), "data" => array("clob", $a_data), "ctime" => array("integer", $now), "type" => array("integer", (int) $_SESSION["SessionType"]));
     if ($ilClientIniFile->readVariable("session", "save_ip")) {
         $fields["remote_addr"] = array("text", $_SERVER["REMOTE_ADDR"]);
     }
     if (ilSession::_exists($a_session_id)) {
         $ilDB->update("usr_session", $fields, array("session_id" => array("text", $a_session_id)));
     } else {
         $fields["session_id"] = array("text", $a_session_id);
         $fields["createtime"] = array("integer", $now);
         $ilDB->insert("usr_session", $fields);
         // check type against session control
         $type = $fields["type"][1];
         if (in_array($type, ilSessionControl::$session_types_controlled)) {
             ilSessionStatistics::createRawEntry($fields["session_id"][1], $type, $fields["createtime"][1], $fields["user_id"][1]);
         }
     }
     // finally delete deprecated sessions
     if (rand(0, 50) == 2) {
         // get time _before_ destroying expired sessions
         self::_destroyExpiredSessions();
         ilSessionStatistics::aggretateRaw($now);
     }
     return true;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:41,代码来源:class.ilSession.php

示例4: initIlias

 function initIlias($context = "web")
 {
     global $ilDB, $ilUser, $ilLog, $ilErr, $ilClientIniFile, $ilIliasIniFile, $ilSetting, $ilias, $https, $ilObjDataCache, $ilLog, $objDefinition, $lng, $ilCtrl, $ilBrowser, $ilHelp, $ilTabs, $ilMainMenu, $rbacsystem, $ilNavigationHistory;
     // remove unsafe characters
     $this->removeUnsafeCharacters();
     // error reporting
     // remove notices from error reporting
     if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
         error_reporting(ini_get("error_reporting") & ~E_NOTICE & ~E_DEPRECATED);
     } else {
         error_reporting(ini_get('error_reporting') & ~E_NOTICE);
     }
     // include common code files
     $this->requireCommonIncludes();
     global $ilBench;
     // set error handler (to do: check preconditions for error handler to work)
     $ilBench->start("Core", "HeaderInclude_GetErrorHandler");
     $ilErr = new ilErrorHandling();
     $GLOBALS['ilErr'] =& $ilErr;
     $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, 'errorHandler'));
     $ilBench->stop("Core", "HeaderInclude_GetErrorHandler");
     // prepare file access to work with safe mode (has been done in class ilias before)
     umask(0117);
     // set cookie params
     $this->setCookieParams();
     // $ilIliasIniFile initialisation
     $this->initIliasIniFile();
     // CLIENT_ID determination
     $this->determineClient();
     // $ilAppEventHandler initialisation
     $this->initEventHandling();
     // $ilClientIniFile initialisation
     $this->initClientIniFile();
     // removed redirection madness the service should respond with SERVICE UNAVAILABLE
     // $ilDB initialisation
     $this->initDatabase();
     // init plugin admin class
     include_once "Services/Component/classes/class.ilPluginAdmin.php";
     $ilPluginAdmin = new ilPluginAdmin();
     $GLOBALS['ilPluginAdmin'] = $ilPluginAdmin;
     // set session handler
     $this->setSessionHandler();
     // $ilSetting initialisation
     $this->initSettings();
     // $ilLog initialisation
     $this->initLog();
     // $https initialisation
     require_once 'classes/class.ilHTTPS.php';
     $https = new ilHTTPS();
     $GLOBALS['https'] =& $https;
     $https->enableSecureCookies();
     $https->checkPort();
     if ($this->returnBeforeAuth()) {
         return;
     }
     $ilCtrl = new ilCtrl2();
     $GLOBALS['ilCtrl'] =& $ilCtrl;
     // $ilAuth initialisation
     include_once "Services/Authentication/classes/class.ilAuthUtils.php";
     ilAuthUtils::_initAuth();
     global $ilAuth;
     $this->includePhp5Compliance();
     // Do not accept external session ids
     if (!ilSession::_exists(session_id())) {
         // $_GET["PHPSESSID"] = "";
         session_regenerate_id();
     }
     // $ilias initialisation
     global $ilias, $ilBench;
     $ilBench->start("Core", "HeaderInclude_GetILIASObject");
     $ilias = new ILIAS();
     $GLOBALS['ilias'] =& $ilias;
     $ilBench->stop("Core", "HeaderInclude_GetILIASObject");
     // $ilObjDataCache initialisation
     $ilObjDataCache = new ilObjectDataCache();
     $GLOBALS['ilObjDataCache'] =& $ilObjDataCache;
     // workaround: load old post variables if error handler 'message' was called
     if (isset($_SESSION["message"]) && $_SESSION["message"]) {
         $_POST = $_SESSION["post_vars"];
     }
     // put debugging functions here
     require_once "include/inc.debug.php";
     // $objDefinition initialisation
     $ilBench->start("Core", "HeaderInclude_getObjectDefinitions");
     $objDefinition = new ilObjectDefinition();
     $GLOBALS['objDefinition'] =& $objDefinition;
     // $objDefinition->startParsing();
     $ilBench->stop("Core", "HeaderInclude_getObjectDefinitions");
     // init tree
     $tree = new ilTree(ROOT_FOLDER_ID);
     $GLOBALS['tree'] =& $tree;
     // $ilAccess and $rbac... initialisation
     $this->initAccessHandling();
     // authenticate & start session
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, "errorHandler"));
     $ilBench->start("Core", "HeaderInclude_Authentication");
     //var_dump($_SESSION);
     ////require_once('Log.php');
     ////$ilAuth->logger = Log::singleton('error_log',PEAR_LOG_TYPE_SYSTEM,'TEST');
     ////$ilAuth->enableLogging = true;
//.........这里部分代码省略.........
开发者ID:phish108,项目名称:PowerTLA,代码行数:101,代码来源:ilRESTInitialisation.4.2.php


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