1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Bluz Framework Component |
5
|
|
|
* |
6
|
|
|
* @copyright Bluz PHP Team |
7
|
|
|
* @link https://github.com/bluzphp/framework |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
declare(strict_types=1); |
11
|
|
|
|
12
|
|
|
namespace Bluz\Proxy; |
13
|
|
|
|
14
|
|
|
use Bluz\Session\Session as Instance; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Proxy to Session |
18
|
|
|
* |
19
|
|
|
* Example of usage |
20
|
|
|
* <code> |
21
|
|
|
* use Bluz\Proxy\Session; |
22
|
|
|
* |
23
|
|
|
* // lazy session loading |
24
|
|
|
* Session::set('some key in session', 'value example'); |
25
|
|
|
* Session::get('some key in session'); |
26
|
|
|
* </code> |
27
|
|
|
* |
28
|
|
|
* @package Bluz\Proxy |
29
|
|
|
* @author Anton Shevchuk |
30
|
|
|
* |
31
|
|
|
* @method static Instance getInstance() |
32
|
|
|
* |
33
|
|
|
* @method static void start() |
34
|
|
|
* @see Instance::start() |
35
|
|
|
* @method static void destroy() |
36
|
|
|
* @see Instance::destroy() |
37
|
|
|
* @method static void set($key, $value) |
38
|
|
|
* @see Instance::set() |
39
|
|
|
* @method static mixed get($key) |
40
|
|
|
* @see Instance::get() |
41
|
|
|
* @method static bool contains($key) |
42
|
|
|
* @see Instance::contains() |
43
|
|
|
* @method static void delete($key) |
44
|
|
|
* @see Instance::delete() |
45
|
|
|
* @method static string getId() |
46
|
|
|
* @see Instance::getId() |
47
|
|
|
* @method static bool regenerateId($deleteOldSession = true) |
48
|
|
|
* @see Instance::regenerateId() |
49
|
|
|
* @method static void setSessionCookieLifetime($ttl) |
50
|
|
|
* @see Instance::setSessionCookieLifetime() |
51
|
|
|
* |
52
|
|
|
* @method static void expireSessionCookie() |
53
|
|
|
*/ |
54
|
|
|
final class Session |
55
|
|
|
{ |
56
|
|
|
use ProxyTrait; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Init instance |
60
|
|
|
* |
61
|
|
|
* @return Instance |
62
|
|
|
*/ |
63
|
587 |
|
private static function initInstance(): Instance |
|
|
|
|
64
|
|
|
{ |
65
|
587 |
|
$instance = new Instance(); |
66
|
587 |
|
$instance->setOptions(Config::get('session')); |
67
|
587 |
|
return $instance; |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|
This check looks for private methods that have been defined, but are not used inside the class.