/**
  * 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();
 }
 /**
  * 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();
 }
Exemple #3
0
 public function init()
 {
     if (\Yii::$app->cmsSettings->sessionType == CmsSettings::SESSION_DB) {
         $this->dbSession = \Yii::$app->dbSession;
     } else {
         parent::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();
 }
 /**
  * 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();
 }
 /**
  * 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();
 }
Exemple #7
0
 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);
     }
 }
Exemple #8
0
 /**
  * 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();
 }
Exemple #9
0
 /**
  * Initializes the application component.
  */
 public function init()
 {
     parent::init();
     $this->cache = Instance::ensure($this->cache, Cache::className());
 }
Exemple #10
0
 /**
  * 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());
 }
Exemple #11
0
 public function init()
 {
     parent::init();
     // Yii::$app->cache->useMemcached=true;
     register_shutdown_function([$this, 'close']);
 }
 /**
  * Initializes the application component.
  * This method overrides the parent implementation by checking if redis is available.
  */
 public function init()
 {
     $this->getConnection();
     parent::init();
 }
Exemple #13
0
 public function init()
 {
     parent::init();
 }