Subversion-Projekte lars-tiefland.ci

Revision

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

Revision 2242 Revision 2254
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 - 2018, 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 - 2018, 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 143... Zeile 143...
143
		{
143
		{
144
			log_message('error', 'Session: Memcached server pool is empty.');
144
			log_message('error', 'Session: Memcached server pool is empty.');
145
			return $this->_fail();
145
			return $this->_fail();
146
		}
146
		}
Zeile 147... Zeile -...
147
 
-
 
148
		$this->php5_validate_id();
-
 
149
 
147
 
150
		return $this->_success;
148
		return $this->_success;
Zeile 151... Zeile 149...
151
	}
149
	}
Zeile 290... Zeile 288...
290
	{
288
	{
291
		// Not necessary, Memcached takes care of that.
289
		// Not necessary, Memcached takes care of that.
292
		return $this->_success;
290
		return $this->_success;
293
	}
291
	}
Zeile 294... Zeile -...
294
 
-
 
295
	// --------------------------------------------------------------------
-
 
296
 
-
 
297
	/**
-
 
298
	 * Validate ID
-
 
299
	 *
-
 
300
	 * Checks whether a session ID record exists server-side,
-
 
301
	 * to enforce session.use_strict_mode.
-
 
302
	 *
-
 
303
	 * @param	string	$id
-
 
304
	 * @return	bool
-
 
305
	 */
-
 
306
	public function validateId($id)
-
 
307
	{
-
 
308
		$this->_memcached-get($this->_key_prefix.$id);
-
 
309
		return ($this->_memcached->getResultCode() === Memcached::RES_SUCCESS);
-
 
310
	}
-
 
311
 
292
 
Zeile 312... Zeile 293...
312
	// ------------------------------------------------------------------------
293
	// ------------------------------------------------------------------------
313
 
294
 
314
	/**
295
	/**
Zeile 330... Zeile 311...
330
			{
311
			{
331
				return ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND)
312
				return ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND)
332
					? $this->_memcached->add($this->_lock_key, time(), 300)
313
					? $this->_memcached->add($this->_lock_key, time(), 300)
333
					: FALSE;
314
					: FALSE;
334
			}
315
			}
335
 
-
 
336
			return TRUE;
-
 
337
		}
316
		}
Zeile 338... Zeile 317...
338
 
317
 
339
		// 30 attempts to obtain a lock, in case another request already has it
318
		// 30 attempts to obtain a lock, in case another request already has it
340
		$lock_key = $this->_key_prefix.$session_id.':lock';
319
		$lock_key = $this->_key_prefix.$session_id.':lock';