Subversion-Projekte lars-tiefland.ci

Revision

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

Revision 68 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 197... Zeile 197...
197
	 * @param	string	$session_data	Serialized session data
197
	 * @param	string	$session_data	Serialized session data
198
	 * @return	bool
198
	 * @return	bool
199
	 */
199
	 */
200
	public function write($session_id, $session_data)
200
	public function write($session_id, $session_data)
201
	{
201
	{
202
		if ( ! isset($this->_redis))
202
		if ( ! isset($this->_redis, $this->_lock_key))
203
		{
203
		{
204
			return $this->_fail();
204
			return $this->_fail();
205
		}
205
		}
206
		// Was the ID regenerated?
206
		// Was the ID regenerated?
207
		elseif ($session_id !== $this->_session_id)
207
		elseif ($session_id !== $this->_session_id)
Zeile 213... Zeile 213...
213
 
213
 
214
			$this->_key_exists = FALSE;
214
			$this->_key_exists = FALSE;
215
			$this->_session_id = $session_id;
215
			$this->_session_id = $session_id;
Zeile 216... Zeile 216...
216
		}
216
		}
-
 
217
 
217
 
218
		$this->_redis->setTimeout($this->_lock_key, 300);
218
		if (isset($this->_lock_key))
-
 
219
		{
219
		if ($this->_fingerprint !== ($fingerprint = md5($session_data)) OR $this->_key_exists === FALSE)
220
			$this->_redis->setTimeout($this->_lock_key, 300);
220
		{
221
			if ($this->_fingerprint !== ($fingerprint = md5($session_data)) OR $this->_key_exists === FALSE)
-
 
222
			{
-
 
223
				if ($this->_redis->set($this->_key_prefix.$session_id, $session_data, $this->_config['expiration']))
221
			if ($this->_redis->set($this->_key_prefix.$session_id, $session_data, $this->_config['expiration']))
224
				{
222
			{
225
					$this->_fingerprint = $fingerprint;
223
				$this->_fingerprint = $fingerprint;
226
					$this->_key_exists = TRUE;
-
 
227
					return $this->_success;
-
 
228
				}
-
 
229
 
224
				$this->_key_exists = TRUE;
Zeile 230... Zeile -...
230
				return $this->_fail();
-
 
231
			}
-
 
232
 
225
				return $this->_success;
233
			return ($this->_redis->setTimeout($this->_key_prefix.$session_id, $this->_config['expiration']))
226
			}
Zeile -... Zeile 227...
-
 
227
 
-
 
228
			return $this->_fail();
234
				? $this->_success
229
		}
235
				: $this->_fail();
230
 
Zeile 236... Zeile 231...
236
		}
231
		return ($this->_redis->setTimeout($this->_key_prefix.$session_id, $this->_config['expiration']))
Zeile 237... Zeile 232...
237
 
232
			? $this->_success