Subversion-Projekte lars-tiefland.ci

Revision

Revision 1257 | Revision 2107 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1257 Revision 2049
Zeile 4... Zeile 4...
4
 *
4
 *
5
 * An open source application development framework for PHP
5
 * An open source application development framework for PHP
6
 *
6
 *
7
 * This content is released under the MIT License (MIT)
7
 * This content is released under the MIT License (MIT)
8
 *
8
 *
9
 * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2017, British Columbia Institute of Technology
10
 *
10
 *
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
12
 * of this software and associated documentation files (the "Software"), to deal
12
 * of this software and associated documentation files (the "Software"), to deal
13
 * in the Software without restriction, including without limitation the rights
13
 * in the Software without restriction, including without limitation the rights
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Zeile 27... Zeile 27...
27
 * THE SOFTWARE.
27
 * THE SOFTWARE.
28
 *
28
 *
29
 * @package	CodeIgniter
29
 * @package	CodeIgniter
30
 * @author	EllisLab Dev Team
30
 * @author	EllisLab Dev Team
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
32
 * @copyright	Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
33
 * @license	http://opensource.org/licenses/MIT	MIT License
34
 * @link	https://codeigniter.com
34
 * @link	https://codeigniter.com
35
 * @since	Version 3.0.0
35
 * @since	Version 3.0.0
36
 * @filesource
36
 * @filesource
37
 */
37
 */
Zeile 184... Zeile 184...
184
	 * @param	string	$session_data	Serialized session data
184
	 * @param	string	$session_data	Serialized session data
185
	 * @return	bool
185
	 * @return	bool
186
	 */
186
	 */
187
	public function write($session_id, $session_data)
187
	public function write($session_id, $session_data)
188
	{
188
	{
189
		if ( ! isset($this->_memcached))
189
		if ( ! isset($this->_memcached, $this->_lock_key))
190
		{
190
		{
191
			return $this->_fail();
191
			return $this->_fail();
192
		}
192
		}
193
		// Was the ID regenerated?
193
		// Was the ID regenerated?
194
		elseif ($session_id !== $this->_session_id)
194
		elseif ($session_id !== $this->_session_id)
Zeile 200... Zeile 200...
200
 
200
 
201
			$this->_fingerprint = md5('');
201
			$this->_fingerprint = md5('');
202
			$this->_session_id = $session_id;
202
			$this->_session_id = $session_id;
Zeile 203... Zeile -...
203
		}
-
 
204
 
-
 
205
		if (isset($this->_lock_key))
203
		}
206
		{
-
 
207
			$key = $this->_key_prefix.$session_id;
-
 
208
 
-
 
209
			$this->_memcached->replace($this->_lock_key, time(), 300);
-
 
210
			if ($this->_fingerprint !== ($fingerprint = md5($session_data)))
-
 
211
			{
-
 
212
				if ($this->_memcached->set($key, $session_data, $this->_config['expiration']))
-
 
213
				{
-
 
214
					$this->_fingerprint = $fingerprint;
-
 
Zeile 215... Zeile 204...
215
					return $this->_success;
204
 
-
 
205
		$key = $this->_key_prefix.$session_id;
216
				}
206
 
217
 
-
 
218
				return $this->_fail();
207
		$this->_memcached->replace($this->_lock_key, time(), 300);
219
			}
-
 
220
			elseif (
-
 
221
				$this->_memcached->touch($key, $this->_config['expiration'])
208
		if ($this->_fingerprint !== ($fingerprint = md5($session_data)))
-
 
209
		{
222
				OR ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND && $this->_memcached->set($key, $session_data, $this->_config['expiration']))
210
			if ($this->_memcached->set($key, $session_data, $this->_config['expiration']))
223
			)
211
			{
-
 
212
				$this->_fingerprint = $fingerprint;
-
 
213
				return $this->_success;
-
 
214
			}
-
 
215
 
-
 
216
			return $this->_fail();
-
 
217
		}
-
 
218
		elseif (
-
 
219
			$this->_memcached->touch($key, $this->_config['expiration'])
-
 
220
			OR ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND && $this->_memcached->set($key, $session_data, $this->_config['expiration']))
224
			{
221
		)
Zeile 225... Zeile 222...
225
				return $this->_success;
222
		{
226
			}
223
			return $this->_success;
Zeile 373... Zeile 370...
373
			$this->_lock = FALSE;
370
			$this->_lock = FALSE;
374
		}
371
		}
Zeile 375... Zeile 372...
375
 
372
 
376
		return TRUE;
373
		return TRUE;
377
	}
-
 
378
}
374
	}
-
 
375
}