當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CI_Session_driver類代碼示例

本文整理匯總了PHP中CI_Session_driver的典型用法代碼示例。如果您正苦於以下問題:PHP CI_Session_driver類的具體用法?PHP CI_Session_driver怎麽用?PHP CI_Session_driver使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CI_Session_driver類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Class constructor
  *
  * @param	array	$params	Configuration parameters
  * @return	void
  */
 public function __construct(&$params)
 {
     parent::__construct($params);
     if (empty($this->_config['save_path'])) {
         log_message('error', 'Session: No Redis save path configured.');
     } elseif (preg_match('#^unix://([^\\?]+)(?<options>\\?.+)?$#', $this->_config['save_path'], $matches)) {
         $save_path = array('path' => $matches[1]);
     } elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\\:(\\d+))?(?<options>\\?.+)?#', $this->_config['save_path'], $matches)) {
         $save_path = array('host' => $matches[1], 'port' => empty($matches[2]) ? NULL : $matches[2]);
     } else {
         log_message('error', 'Session: Invalid Redis save path format: ' . $this->_config['save_path']);
     }
     if (isset($save_path)) {
         if (isset($matches['options'])) {
             $save_path['password'] = preg_match('#auth=([^\\s&]+)#', $matches['options'], $match) ? $match[1] : NULL;
             $save_path['database'] = preg_match('#database=(\\d+)#', $matches['options'], $match) ? (int) $match[1] : NULL;
             $save_path['timeout'] = preg_match('#timeout=(\\d+\\.\\d+)#', $matches['options'], $match) ? (double) $match[1] : NULL;
             preg_match('#prefix=([^\\s&]+)#', $matches['options'], $match) && ($this->_key_prefix = $match[1]);
         }
         $this->_config['save_path'] = $save_path;
         if ($this->_config['match_ip'] === TRUE) {
             $this->_key_prefix .= $_SERVER['REMOTE_ADDR'] . ':';
         }
     }
 }
開發者ID:NicolasMontoya,項目名稱:SARA,代碼行數:31,代碼來源:Session_redis_driver.php

示例2: __construct

 /**
  * Class constructor
  *
  * @param	array	$params	Configuration parameters
  * @return	void
  */
 public function __construct(&$params)
 {
     parent::__construct($params);
     if (empty($this->_config['save_path'])) {
     }
     if ($this->_config['match_ip'] === TRUE) {
         $this->_key_prefix .= $_SERVER['REMOTE_ADDR'] . ':';
     }
 }
開發者ID:evolutionscript,項目名稱:CI_Session,代碼行數:15,代碼來源:Session_memcached_driver.php

示例3: __construct

 /**
  * Class constructor
  *
  * @param    array $params Configuration parameters
  * @return    void
  */
 public function __construct(&$params)
 {
     parent::__construct($params);
     if (empty($this->_config['save_path'])) {
         log_message('error', 'Session: No Memcached save path configured.');
     }
     if ($this->_config['match_ip'] === TRUE) {
         $this->_key_prefix .= $_SERVER['REMOTE_ADDR'] . ':';
     }
 }
開發者ID:lkho,項目名稱:comp3421,代碼行數:16,代碼來源:Session_memcached_driver.php

示例4: __construct

 /**
  * Class constructor
  *
  * @param	array	$params	Configuration parameters
  * @return	void
  */
 public function __construct(&$params)
 {
     parent::__construct($params);
     if (isset($this->_config['save_path'])) {
         $this->_config['save_path'] = rtrim($this->_config['save_path'], '/\\');
         ini_set('session.save_path', $this->_config['save_path']);
     } else {
         $this->_config['save_path'] = rtrim(ini_get('session.save_path'), '/\\');
     }
 }
開發者ID:opengbu,項目名稱:seating-plan,代碼行數:16,代碼來源:Session_files_driver.php

示例5: __construct

 /**
  * Class constructor.
  *
  * @param array $params Configuration parameters
  *
  * @return void
  */
 public function __construct(&$params)
 {
     parent::__construct($params);
     if (isset($this->_config['save_path'])) {
         $this->_config['save_path'] = rtrim($this->_config['save_path'], '/\\');
         ini_set('session.save_path', $this->_config['save_path']);
     } else {
         log_message('debug', 'Session: "sess_save_path" is empty; using "session.save_path" value from php.ini.');
         $this->_config['save_path'] = rtrim(ini_get('session.save_path'), '/\\');
     }
 }
開發者ID:recca0120,項目名稱:laraigniter,代碼行數:18,代碼來源:Session_files_driver.php

示例6: __construct

 /**
  * Class constructor
  *
  * @param	array	$params	Configuration parameters
  * @return	void
  */
 public function __construct(&$params)
 {
     // DO NOT forget this
     parent::__construct($params);
     //mongo PECL driver loaded ??
     if (!class_exists('Mongo') && !class_exists('MongoClient')) {
         show_error("The MongoDB PECL extension has not been installed or enabled", 500);
     }
     // Configuration & other initializations
     $CI =& get_instance();
     $CI->config->load('session_mongo');
     $this->_build_config($CI);
 }
開發者ID:intekhabrizvi,項目名稱:codeigniter-mongodb-session-driver,代碼行數:19,代碼來源:Session_mongo_driver.php

示例7: __construct

 /**
  * Class constructor
  *
  * @param	array	$params	Configuration parameters
  * @return	void
  */
 public function __construct(&$params)
 {
     parent::__construct($params);
     if (empty($this->_config['save_path'])) {
     } elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\\:(\\d+))?(\\?.+)?#', $this->_config['save_path'], $matches)) {
         isset($matches[3]) or $matches[3] = '';
         // Just to avoid undefined index notices below
         $this->_config['save_path'] = array('host' => $matches[1], 'port' => empty($matches[2]) ? NULL : $matches[2], 'password' => preg_match('#auth=([^\\s&]+)#', $matches[3], $match) ? $match[1] : NULL, 'database' => preg_match('#database=(\\d+)#', $matches[3], $match) ? (int) $match[1] : NULL, 'timeout' => preg_match('#timeout=(\\d+\\.\\d+)#', $matches[3], $match) ? (double) $match[1] : NULL);
         preg_match('#prefix=([^\\s&]+)#', $matches[3], $match) && ($this->_key_prefix = $match[1]);
     } else {
     }
     if ($this->_config['match_ip'] === TRUE) {
         $this->_key_prefix .= $_SERVER['REMOTE_ADDR'] . ':';
     }
 }
開發者ID:evolutionscript,項目名稱:CI_Session,代碼行數:21,代碼來源:Session_redis_driver.php

示例8: __construct

 /**
  * Class constructor.
  *
  * @param array $params Configuration parameters
  *
  * @return void
  */
 public function __construct(&$params)
 {
     parent::__construct($params);
     if (empty($this->_config['save_path'])) {
         log_message('error', 'Session: No Redis save path configured.');
     } elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\\:(\\d+))?(\\?.+)?#', $this->_config['save_path'], $matches)) {
         isset($matches[3]) or $matches[3] = '';
         // Just to avoid undefined index notices below
         $this->_config['save_path'] = ['host' => $matches[1], 'port' => empty($matches[2]) ? null : $matches[2], 'password' => preg_match('#auth=([^\\s&]+)#', $matches[3], $match) ? $match[1] : null, 'database' => preg_match('#database=(\\d+)#', $matches[3], $match) ? (int) $match[1] : null, 'timeout' => preg_match('#timeout=(\\d+\\.\\d+)#', $matches[3], $match) ? (double) $match[1] : null];
         preg_match('#prefix=([^\\s&]+)#', $matches[3], $match) && ($this->_key_prefix = $match[1]);
     } else {
         log_message('error', 'Session: Invalid Redis save path format: ' . $this->_config['save_path']);
     }
     if ($this->_config['match_ip'] === true) {
         $this->_key_prefix .= $_SERVER['REMOTE_ADDR'] . ':';
     }
 }
開發者ID:recca0120,項目名稱:laraigniter,代碼行數:24,代碼來源:Session_redis_driver.php

示例9: _release_lock

 protected function _release_lock()
 {
     return parent::_release_lock($session_id);
 }
開發者ID:ehoutsma,項目名稱:Codeigniter-Session-MongoDB-Driver,代碼行數:4,代碼來源:Session_mongodb_driver.php

示例10: _release_lock

 /**
  * Release lock
  *
  * Releases a previously acquired lock
  *
  * @return	bool
  */
 protected function _release_lock()
 {
     if (!$this->_lock) {
         return TRUE;
     }
     if ($this->_platform === 'mysql') {
         if ($this->_db->query("SELECT RELEASE_LOCK('" . $this->_lock . "') AS ci_session_lock")->row()->ci_session_lock) {
             $this->_lock = FALSE;
             return TRUE;
         }
         return FALSE;
     } elseif ($this->_platform === 'postgre') {
         if ($this->_db->simple_query('SELECT pg_advisory_unlock(' . $this->_lock . ')')) {
             $this->_lock = FALSE;
             return TRUE;
         }
         return FALSE;
     }
     return parent::_release_lock();
 }
開發者ID:SkullaCode,項目名稱:skullaframe,代碼行數:27,代碼來源:Session_database_driver.php

示例11: __construct

 /**
  * Class constructor
  *
  * @param	array	$params	Configuration parameters
  * @return	void
  */
 public function __construct(&$params)
 {
     parent::__construct($params);
     if (isset($this->_config['save_path'])) {
         $this->_config['save_path'] = rtrim($this->_config['save_path'], '/\\');
         ini_set('session.save_path', $this->_config['save_path']);
     } else {
         log_message('debug', 'Session: "sess_save_path" is empty; using "session.save_path" value from php.ini.');
         $this->_config['save_path'] = rtrim(ini_get('session.save_path'), '/\\');
     }
     $this->_sid_regexp = $this->_config['_sid_regexp'];
     isset(self::$func_override) or self::$func_override = extension_loaded('mbstring') && ini_get('mbstring.func_override');
 }
開發者ID:noikiy,項目名稱:CodeIgniter,代碼行數:19,代碼來源:Session_files_driver.php


注:本文中的CI_Session_driver類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。