summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session
diff options
context:
space:
mode:
authorMichael Long <mchobbylong@gmail.com>2019-08-13 21:13:10 +0200
committerMichael Long <mchobbylong@gmail.com>2019-08-13 21:13:10 +0200
commit8535d803b8feb252c6f4a14b5e87a47111f1d4a8 (patch)
treec99438f58503d6b5ee7e2e58ff7aa7eef911a482 /system/libraries/Session
parent4aec0ed32942b52535b69bfbe33ff9e8e957b245 (diff)
Adapt to styleguide
Diffstat (limited to 'system/libraries/Session')
-rw-r--r--system/libraries/Session/drivers/Session_redis_driver.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php
index 1f1004fb9..3323ca6cf 100644
--- a/system/libraries/Session/drivers/Session_redis_driver.php
+++ b/system/libraries/Session/drivers/Session_redis_driver.php
@@ -240,7 +240,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
$this->_session_id = $session_id;
}
- $this->_expire($this->_lock_key, 300);
+ $this->_expire_key($this->_lock_key, 300);
if ($this->_fingerprint !== ($fingerprint = md5($session_data)) OR $this->_key_exists === FALSE)
{
if ($this->_redis->set($this->_key_prefix.$session_id, $session_data, $this->_config['expiration']))
@@ -253,7 +253,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
return $this->_fail();
}
- return ($this->_expire($this->_key_prefix.$session_id, $this->_config['expiration']))
+ return ($this->_expire_key($this->_key_prefix.$session_id, $this->_config['expiration']))
? $this->_success
: $this->_fail();
}
@@ -273,7 +273,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
{
try {
$ping = $this->_redis->ping();
- if ($ping === '+PONG' || $ping === TRUE)
+ if ($ping === '+PONG' OR $ping === TRUE)
{
$this->_release_lock();
if ($this->_redis->close() === FALSE)
@@ -308,7 +308,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
{
if (isset($this->_redis, $this->_lock_key))
{
- if (($result = $this->_delete($this->_key_prefix.$session_id)) !== 1)
+ if (($result = $this->_delete_key($this->_key_prefix.$session_id)) !== 1)
{
log_message('debug', 'Session: Redis::del() expected to return 1, got '.var_export($result, TRUE).' instead.');
}
@@ -369,7 +369,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
// correct session ID.
if ($this->_lock_key === $this->_key_prefix.$session_id.':lock')
{
- return $this->_expire($this->_lock_key, 300);
+ return $this->_expire_key($this->_lock_key, 300);
}
// 30 attempts to obtain a lock, in case another request already has it
@@ -443,15 +443,15 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
// ------------------------------------------------------------------------
/**
- * Expire
+ * Expire key
*
* Sets expiration for a key
*
* @param string $key Redis key
- * @param int $ttl The key's remaining Time To Live, in seconds.
+ * @param int $ttl The key's remaining Time To Live, in seconds.
* @return bool
*/
- protected function _expire($key, $ttl)
+ protected function _expire_key($key, $ttl)
{
if (method_exists($this->_redis, 'expire'))
return $this->_redis->expire($key, $ttl);
@@ -461,14 +461,14 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
// ------------------------------------------------------------------------
/**
- * Delete
+ * Delete key
*
* Deletes a key
*
* @param string $key Redis key
* @return bool
*/
- protected function _delete($key)
+ protected function _delete_key($key)
{
if (method_exists($this->_redis, 'del'))
return $this->_redis->del($key);