summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/drivers/Session_memcached_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-01-19 12:54:53 +0100
committerAndrey Andreev <narf@devilix.net>2015-01-19 12:54:53 +0100
commit10411fc94395bdf217e8bbae61e0af3a73d37325 (patch)
treec6cdf4ecb1374d2534bc2b6a319b4ea78fdba475 /system/libraries/Session/drivers/Session_memcached_driver.php
parent052c02fb042a307c689441ef32ef23e8451a3136 (diff)
[ci skip] feature/session (#3073): Add missing method docblocks
Diffstat (limited to 'system/libraries/Session/drivers/Session_memcached_driver.php')
-rw-r--r--system/libraries/Session/drivers/Session_memcached_driver.php66
1 files changed, 66 insertions, 0 deletions
diff --git a/system/libraries/Session/drivers/Session_memcached_driver.php b/system/libraries/Session/drivers/Session_memcached_driver.php
index e2b568f52..683bb5c69 100644
--- a/system/libraries/Session/drivers/Session_memcached_driver.php
+++ b/system/libraries/Session/drivers/Session_memcached_driver.php
@@ -94,6 +94,15 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
// ------------------------------------------------------------------------
+ /**
+ * Open
+ *
+ * Sanitizes save_path and initializes connections.
+ *
+ * @param string $save_path Server path(s)
+ * @param string $name Session cookie name, unused
+ * @return bool
+ */
public function open($save_path, $name)
{
$this->_memcached = new Memcached();
@@ -141,6 +150,14 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
// ------------------------------------------------------------------------
+ /**
+ * Read
+ *
+ * Reads session data and acquires a lock
+ *
+ * @param string $session_id Session ID
+ * @return string Serialized session data
+ */
public function read($session_id)
{
if (isset($this->_memcached) && $this->_get_lock($session_id))
@@ -156,6 +173,17 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
return FALSE;
}
+ // ------------------------------------------------------------------------
+
+ /**
+ * Write
+ *
+ * Writes (create / update) session data
+ *
+ * @param string $session_id Session ID
+ * @param string $session_data Serialized session data
+ * @return bool
+ */
public function write($session_id, $session_data)
{
if ( ! isset($this->_memcached))
@@ -196,6 +224,13 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
// ------------------------------------------------------------------------
+ /**
+ * Close
+ *
+ * Releases locks and closes connection.
+ *
+ * @return void
+ */
public function close()
{
if (isset($this->_memcached))
@@ -215,6 +250,14 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
// ------------------------------------------------------------------------
+ /**
+ * Destroy
+ *
+ * Destroys the current session.
+ *
+ * @param string $session_id Session ID
+ * @return bool
+ */
public function destroy($session_id)
{
if (isset($this->_memcached, $this->_lock_key))
@@ -228,6 +271,14 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
// ------------------------------------------------------------------------
+ /**
+ * Garbage Collector
+ *
+ * Deletes expired sessions
+ *
+ * @param int $maxlifetime Maximum lifetime of sessions
+ * @return bool
+ */
public function gc($maxlifetime)
{
// Not necessary, Memcached takes care of that.
@@ -236,6 +287,14 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
// ------------------------------------------------------------------------
+ /**
+ * Get lock
+ *
+ * Acquires an (emulated) lock.
+ *
+ * @param string $session_id Session ID
+ * @return bool
+ */
protected function _get_lock($session_id)
{
if (isset($this->_lock_key))
@@ -289,6 +348,13 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
// ------------------------------------------------------------------------
+ /**
+ * Release lock
+ *
+ * Releases a previously acquired lock
+ *
+ * @return bool
+ */
protected function _release_lock()
{
if (isset($this->_memcached, $this->_lock_key) && $this->_lock)