1 | <?php |
||
34 | class SessionStorage extends Nette\Object |
||
35 | { |
||
36 | /** |
||
37 | * @var Http\SessionSection |
||
38 | */ |
||
39 | protected $session; |
||
40 | |||
41 | /** |
||
42 | * @param Http\Session $session |
||
43 | * @param Configuration $config |
||
44 | */ |
||
45 | public function __construct(Http\Session $session, Configuration $config) |
||
49 | |||
50 | /** |
||
51 | * Stores the given ($key, $value) pair, so that future calls to |
||
52 | * getPersistentData($key) return $value. This call may be in another request. |
||
53 | * |
||
54 | * Provides the implementations of the inherited abstract |
||
55 | * methods. |
||
56 | * |
||
57 | * The implementation uses PHP sessions to maintain |
||
58 | * a store for authorization codes, user ids, CSRF states, and |
||
59 | * access tokens. |
||
60 | */ |
||
61 | public function set($key, $value) |
||
65 | |||
66 | /** |
||
67 | * @param string $key The key of the data to retrieve |
||
68 | * @param mixed $default The default value to return if $key is not found |
||
69 | * |
||
70 | * @return mixed |
||
71 | */ |
||
72 | public function get($key, $default = FALSE) |
||
76 | |||
77 | /** |
||
78 | * Clear the data with $key from the persistent storage |
||
79 | * |
||
80 | * @param string $key |
||
81 | * @return void |
||
82 | */ |
||
83 | public function clear($key) |
||
87 | |||
88 | /** |
||
89 | * Clear all data from the persistent storage |
||
90 | * |
||
91 | * @return void |
||
92 | */ |
||
93 | public function clearAll() |
||
97 | |||
98 | /** |
||
99 | * @param string $name |
||
100 | * @return mixed |
||
101 | */ |
||
102 | public function &__get($name) |
||
103 | { |
||
104 | $value = $this->get($name); |
||
105 | return $value; |
||
106 | } |
||
107 | |||
108 | /** |
||
109 | * @param string $name |
||
110 | * @param mixed $value |
||
111 | */ |
||
112 | public function __set($name, $value) |
||
116 | |||
117 | /** |
||
118 | * @param string $name |
||
119 | * @return bool |
||
120 | */ |
||
121 | public function __isset($name) |
||
125 | |||
126 | /** |
||
127 | * @param string $name |
||
128 | */ |
||
129 | public function __unset($name) |
||
133 | } |