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


PHP Session::init方法代码示例

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


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

示例1: init

 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     $credentials = new Credentials($this->params['key'], $this->params['secret']);
     $this->dynamoDb = DynamoDbClient::factory(['region' => $this->params['region'], 'credentials' => $credentials, 'base_url' => isset($this->params['base_url']) ? $this->params['base_url'] : '']);
     $this->tableName = $this->sessionTable;
     parent::init();
 }
开发者ID:pythagor,项目名称:yii2-dynamodbsession,代码行数:11,代码来源:DynamoDbSession.php

示例2: init

 /**
  * Initialize the client.
  */
 public function init()
 {
     $this->_client = DynamoDbClient::factory($this->config);
     if ($this->keyPrefix === null) {
         $this->keyPrefix = substr(md5(Yii::$app->id), 0, 5);
     }
     parent::init();
 }
开发者ID:urbanindo,项目名称:yii2-dynamodb-session,代码行数:11,代码来源:Session.php

示例3: init

 public function init()
 {
     if (\Yii::$app->cmsSettings->sessionType == CmsSettings::SESSION_DB) {
         $this->dbSession = \Yii::$app->dbSession;
     } else {
         parent::init();
     }
 }
开发者ID:Liv1020,项目名称:cms,代码行数:8,代码来源:Session.php

示例4: init

 /**
  * Initializes the application component.
  */
 public function init()
 {
     if (is_string($this->cache)) {
         $this->cache = Yii::$app->getComponent($this->cache);
     }
     if (!$this->cache instanceof Cache) {
         throw new InvalidConfigException('CacheSession::cache must refer to the application component ID of a cache object.');
     }
     parent::init();
 }
开发者ID:davidpersson,项目名称:FrameworkBenchmarks,代码行数:13,代码来源:CacheSession.php

示例5: init

 /**
  * Initializes the DbSession component.
  * This method will initialize the [[db]] property to make sure it refers to a valid DB connection.
  * @throws InvalidConfigException if [[db]] is invalid.
  */
 public function init()
 {
     if (is_string($this->db)) {
         $this->db = Yii::$app->getComponent($this->db);
     }
     if (!$this->db instanceof Connection) {
         throw new InvalidConfigException("DbSession::db must be either a DB connection instance or the application component ID of a DB connection.");
     }
     parent::init();
 }
开发者ID:davidpersson,项目名称:FrameworkBenchmarks,代码行数:15,代码来源:DbSession.php

示例6: init

 /**
  * Initializes the application component.
  * This method overrides the parent implementation by checking if cache is available.
  */
 public function init()
 {
     foreach ($this->iniParameters as $k => $v) {
         if (!ini_set("session.{$k}", $v)) {
             throw new InvalidConfigException("The key session.{$k} could not be set to {$v}.");
         }
     }
     if ($this->servers) {
         // Yii::trace( 'old servers:'.print_r( ini_get( 'session.save_path' ), true ), 'ext.CNativeMemcachedSession.init' );
         ini_set('session.save_path', $this->servers);
     } else {
         throw new InvalidConfigException('Forgot the list of servers.');
     }
     // Yii::trace( 'ses server:'.print_r( $this->servers, true ), 'ext.CNativeMemcachedSession.init' );
     parent::init();
 }
开发者ID:NetClearly,项目名称:yii2-extensions,代码行数:20,代码来源:NativeSession.php

示例7: init

 public function init()
 {
     parent::init();
     if (is_string($this->ssdb)) {
         $this->ssdb = \Yii::$app->get($this->ssdb);
     } elseif (is_array($this->ssdb)) {
         if (!isset($this->ssdb['class'])) {
             $this->ssdb['class'] = Connection::className();
         }
         $this->ssdb = \Yii::createObject($this->ssdb);
     }
     if (!$this->ssdb instanceof Connection) {
         throw new InvalidConfigException("Session::ssdb must be either a Ssdb Connection instance or the application component ID of a ssdb Connection.");
     }
     if ($this->key_prefix === null) {
         $this->key_prefix = substr(md5(Yii::$app->id), 0, 5);
     }
 }
开发者ID:ijackwu,项目名称:yii2-ssdb,代码行数:18,代码来源:SsdbSession.php

示例8: init

 /**
  * Initializes the aerospike Session component.
  * This method will initialize the [[aerospike]] property to make sure it refers to a valid aerospike connection.
  * @throws InvalidConfigException if [[aerospike]] is invalid.
  */
 public function init()
 {
     if (is_string($this->aerospike)) {
         $this->aerospike = Yii::$app->get($this->aerospike);
     } elseif (is_array($this->aerospike)) {
         if (!isset($this->aerospike['class'])) {
             $this->aerospike['class'] = Connection::className();
         }
         $this->aerospike = Yii::createObject($this->aerospike);
     }
     if (!$this->aerospike instanceof Connection) {
         throw new InvalidConfigException("Session::aerospike must be either a Redis connection instance or the application component ID of a Redis connection.");
     }
     if ($this->keyPrefix === null) {
         $this->keyPrefix = substr(md5(Yii::$app->id), 0, 5);
     }
     parent::init();
 }
开发者ID:nserban,项目名称:yii2-aerospike,代码行数:23,代码来源:Session.php

示例9: init

 /**
  * Initializes the application component.
  */
 public function init()
 {
     parent::init();
     $this->cache = Instance::ensure($this->cache, Cache::className());
 }
开发者ID:Jaaviieer,项目名称:PrograWeb,代码行数:8,代码来源:CacheSession.php

示例10: init

 /**
  * Initializes the DbSession component.
  * This method will initialize the [[db]] property to make sure it refers to a valid DB connection.
  * @throws InvalidConfigException if [[db]] is invalid.
  */
 public function init()
 {
     parent::init();
     $this->db = Instance::ensure($this->db, Connection::className());
 }
开发者ID:albertinho88,项目名称:jlweb,代码行数:10,代码来源:DbSession.php

示例11: init

 public function init()
 {
     parent::init();
     // Yii::$app->cache->useMemcached=true;
     register_shutdown_function([$this, 'close']);
 }
开发者ID:smilehaha,项目名称:bag-test,代码行数:6,代码来源:ZSession2.php

示例12: 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:highestgoodlikewater,项目名称:yii2-liuxy-extension,代码行数:9,代码来源:ARedisSession.php

示例13: init

 public function init()
 {
     parent::init();
 }
开发者ID:kd-brinex,项目名称:kd,代码行数:4,代码来源:BrxSession.php


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