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


PHP CHttpSession::init方法代码示例

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


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

示例1: init

 /**
  * Initializes the application component.
  *
  * @return null
  */
 public function init()
 {
     $cookieParams = array('httponly' => true);
     if (($defaultCookieDomain = craft()->config->get('defaultCookieDomain')) !== '') {
         $cookieParams['domain'] = $defaultCookieDomain;
     }
     $secureCookies = craft()->config->get('useSecureCookies');
     // If it's set to auto and a secure connection or it's set to true, set the secure flag.
     if ($secureCookies === 'auto' && craft()->request->isSecureConnection() || $secureCookies === true) {
         $cookieParams['secure'] = true;
     }
     // Set the PHP session cookie to HTTP only.
     $this->setCookieParams($cookieParams);
     // Check if the config value has actually been set to true/false
     $configVal = craft()->config->get('overridePhpSessionLocation');
     // If it's set to true, override the PHP save session path.
     if (is_bool($configVal) && $configVal === true) {
         $this->setSavePath(craft()->path->getSessionPath());
     } else {
         if ($configVal !== false) {
             if (mb_strpos($this->getSavePath(), 'tcp://') === false) {
                 $this->setSavePath(craft()->path->getSessionPath());
             }
         }
     }
     parent::init();
 }
开发者ID:scisahaha,项目名称:generator-craft,代码行数:32,代码来源:HttpSessionService.php

示例2: init

 /**
  * Initializes the application component.
  * This method overrides the parent implementation by checking if cache is available.
  */
 public function init()
 {
     $this->_cache = Yii::app()->getComponent($this->cacheID);
     if (!$this->_cache instanceof ICache) {
         throw new CException(Yii::t('yii', 'CCacheHttpSession.cacheID is invalid. Please make sure "{id}" refers to a valid cache application component.', array('{id}' => $this->cacheID)));
     }
     parent::init();
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:12,代码来源:CCacheHttpSession.php

示例3: init

 /**
  *
  */
 public function init()
 {
     // Check if the config value has actually been set to true/false
     $configVal = craft()->config->get('overridePHPSessionLocation');
     // If it's set to true, override the PHP save session path.
     if (is_bool($configVal) && $configVal === true) {
         $this->setSavePath(craft()->path->getSessionPath());
     } else {
         if ($configVal !== false) {
             if (strpos($this->getSavePath(), 'tcp://') === false) {
                 $this->setSavePath(craft()->path->getSessionPath());
             }
         }
     }
     parent::init();
 }
开发者ID:kentonquatman,项目名称:portfolio,代码行数:19,代码来源:HttpSessionService.php

示例4: init

 /**
  * Initializes the application component.
  *
  * @return null
  */
 public function init()
 {
     $cookieParams = array('httponly' => true);
     if (($defaultCookieDomain = craft()->config->get('defaultCookieDomain')) !== '') {
         $cookieParams['domain'] = $defaultCookieDomain;
     }
     // Set the PHP session cookie to HTTP only.
     $this->setCookieParams($cookieParams);
     // Check if the config value has actually been set to true/false
     $configVal = craft()->config->get('overridePHPSessionLocation');
     // If it's set to true, override the PHP save session path.
     if (is_bool($configVal) && $configVal === true) {
         $this->setSavePath(craft()->path->getSessionPath());
     } else {
         if ($configVal !== false) {
             if (mb_strpos($this->getSavePath(), 'tcp://') === false) {
                 $this->setSavePath(craft()->path->getSessionPath());
             }
         }
     }
     parent::init();
 }
开发者ID:kentonquatman,项目名称:portfolio,代码行数:27,代码来源:HttpSessionService.php

示例5: getSession

 /**
  * 获取session对像
  *
  * @return CHttpSession
  */
 public function getSession()
 {
     if (!isset($this->components['session'])) {
         $session = new CHttpSession();
         $session->init();
         $this->components['session'] = $session;
     }
     return $this->components['session'];
 }
开发者ID:erdincay,项目名称:WIIBOX,代码行数:14,代码来源:CWebApplication.php

示例6: init

 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     $this->setCollection($this->collectionName);
     $this->_options = array('fsync' => $this->fsync, 'safe' => $this->safe);
     parent::init();
 }
开发者ID:phiphi1992,项目名称:alongaydep,代码行数:10,代码来源:EMongoHttpSession.php

示例7: init

 /**
  * Initializes the application component.
  * This method overrides the parent implementation by checking if redis is available.
  */
 public function init()
 {
     $this->getConnection();
     parent::init();
 }
开发者ID:njxjxj,项目名称:YiiRedis,代码行数:9,代码来源:ARedisSession.php

示例8: init

 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     $this->collection = Yii::app()->edmsMongoCollection($this->collectionName, $this->dbName, $this->connectionId);
     $this->options = array('fsync' => $this->fsync, 'safe' => $this->safe);
     if (!is_null($this->timeout)) {
         $this->options['timeout'] = $this->timeout;
     }
     parent::init();
 }
开发者ID:rgummadi,项目名称:ScriptOverflow,代码行数:13,代码来源:EDMSHttpSession.php

示例9: init

 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     $connection = new Mongo($this->connectionString);
     $dbName = $this->dbName;
     $collectionName = $this->collectionName;
     $this->collection = $connection->{$dbName}->{$collectionName};
     $this->options = array('fsync' => $this->fsync, 'safe' => $this->safe);
     if (!is_null($this->mongoTimeout)) {
         $this->options['timeout'] = $this->mongoTimeout;
     }
     parent::init();
 }
开发者ID:niranjan2m,项目名称:Voyanga,代码行数:16,代码来源:EMongoDbHttpSession.php

示例10: init

 public function init()
 {
     $this->cacheSessionHandler->init();
     Yii::log('initialized cache session handler in zurmosession', CLogger::LEVEL_TRACE, 'session');
     parent::init();
 }
开发者ID:spiogit,项目名称:cna-seed-project,代码行数:6,代码来源:ZurmoSession.php


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