|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Facades for Yii 2 |
|
4
|
|
|
* |
|
5
|
|
|
* Generated on Yii 2.0.12 |
|
6
|
|
|
* |
|
7
|
|
|
* @see https://github.com/sergeymakinen/yii2-facades |
|
8
|
|
|
* @copyright Copyright (c) 2016-2017 Sergey Makinen (https://makinen.ru) |
|
9
|
|
|
* @license https://github.com/sergeymakinen/yii2-facades/blob/master/LICENSE The MIT License |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace sergeymakinen\facades; |
|
13
|
|
|
|
|
14
|
|
|
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */ |
|
15
|
|
|
/** |
|
16
|
|
|
* Yii::$app->get('session') facade. |
|
17
|
|
|
* |
|
18
|
|
|
* Methods |
|
19
|
|
|
* |
|
20
|
|
|
* @method static void addFlash(string $key, mixed $value = true, bool $removeAfterAccess = true) Adds a flash message. |
|
21
|
|
|
* @see \yii\web\Session::addFlash |
|
22
|
|
|
* |
|
23
|
|
|
* @method static \yii\base\Behavior attachBehavior(string $name, string|array|\yii\base\Behavior $behavior) Attaches a behavior to this component. |
|
24
|
|
|
* @see \yii\base\Component::attachBehavior |
|
25
|
|
|
* |
|
26
|
|
|
* @method static void attachBehaviors(array $behaviors) Attaches a list of behaviors to the component. |
|
27
|
|
|
* @see \yii\base\Component::attachBehaviors |
|
28
|
|
|
* |
|
29
|
|
|
* @method static array behaviors() Returns a list of behaviors that this component should behave as. |
|
30
|
|
|
* @see \yii\base\Component::behaviors |
|
31
|
|
|
* |
|
32
|
|
|
* @method static void close() Ends the current session and store session data. |
|
33
|
|
|
* @see \yii\web\Session::close |
|
34
|
|
|
* |
|
35
|
|
|
* @method static bool closeSession() Session close handler. |
|
36
|
|
|
* @see \yii\web\Session::closeSession |
|
37
|
|
|
* |
|
38
|
|
|
* @method static int count() Returns the number of items in the session. |
|
39
|
|
|
* @see \yii\web\Session::count |
|
40
|
|
|
* |
|
41
|
|
|
* @method static void destroy() Frees all session variables and destroys all data registered to a session. |
|
42
|
|
|
* @see \yii\web\Session::destroy |
|
43
|
|
|
* |
|
44
|
|
|
* @method static bool destroySession(string $id) Session destroy handler. |
|
45
|
|
|
* @see \yii\web\Session::destroySession |
|
46
|
|
|
* |
|
47
|
|
|
* @method static null|\yii\base\Behavior detachBehavior(string $name) Detaches a behavior from the component. |
|
48
|
|
|
* @see \yii\base\Component::detachBehavior |
|
49
|
|
|
* |
|
50
|
|
|
* @method static void detachBehaviors() Detaches all behaviors from the component. |
|
51
|
|
|
* @see \yii\base\Component::detachBehaviors |
|
52
|
|
|
* |
|
53
|
|
|
* @method static void ensureBehaviors() Makes sure that the behaviors declared in [[behaviors()]] are attached to this component. |
|
54
|
|
|
* @see \yii\base\Component::ensureBehaviors |
|
55
|
|
|
* |
|
56
|
|
|
* @method static bool gcSession(int $maxLifetime) Session GC (garbage collection) handler. |
|
57
|
|
|
* @see \yii\web\Session::gcSession |
|
58
|
|
|
* |
|
59
|
|
|
* @method static mixed get(string $key, mixed $defaultValue = null) Returns the session variable value with the session variable name. |
|
60
|
|
|
* @see \yii\web\Session::get |
|
61
|
|
|
* |
|
62
|
|
|
* @method static array getAllFlashes(bool $delete = false) Returns all flash messages. |
|
63
|
|
|
* @see \yii\web\Session::getAllFlashes |
|
64
|
|
|
* |
|
65
|
|
|
* @method static null|\yii\base\Behavior getBehavior(string $name) Returns the named behavior object. |
|
66
|
|
|
* @see \yii\base\Component::getBehavior |
|
67
|
|
|
* |
|
68
|
|
|
* @method static \yii\base\Behavior[] getBehaviors() Returns all behaviors attached to this component. |
|
69
|
|
|
* @see \yii\base\Component::getBehaviors |
|
70
|
|
|
* |
|
71
|
|
|
* @method static array getCookieParams() |
|
72
|
|
|
* @see \yii\web\Session::getCookieParams |
|
73
|
|
|
* |
|
74
|
|
|
* @method static int getCount() Returns the number of items in the session. |
|
75
|
|
|
* @see \yii\web\Session::getCount |
|
76
|
|
|
* |
|
77
|
|
|
* @method static mixed getFlash(string $key, mixed $defaultValue = null, bool $delete = false) Returns a flash message. |
|
78
|
|
|
* @see \yii\web\Session::getFlash |
|
79
|
|
|
* |
|
80
|
|
|
* @method static float getGCProbability() |
|
81
|
|
|
* @see \yii\web\Session::getGCProbability |
|
82
|
|
|
* |
|
83
|
|
|
* @method static bool getHasSessionId() Returns a value indicating whether the current request has sent the session ID. |
|
84
|
|
|
* @see \yii\web\Session::getHasSessionId |
|
85
|
|
|
* |
|
86
|
|
|
* @method static string getId() Gets the session ID. |
|
87
|
|
|
* @see \yii\web\Session::getId |
|
88
|
|
|
* |
|
89
|
|
|
* @method static bool getIsActive() |
|
90
|
|
|
* @see \yii\web\Session::getIsActive |
|
91
|
|
|
* |
|
92
|
|
|
* @method static string getName() Gets the name of the current session. |
|
93
|
|
|
* @see \yii\web\Session::getName |
|
94
|
|
|
* |
|
95
|
|
|
* @method static string getSavePath() Gets the current session save path. |
|
96
|
|
|
* @see \yii\web\Session::getSavePath |
|
97
|
|
|
* |
|
98
|
|
|
* @method static int getTimeout() |
|
99
|
|
|
* @see \yii\web\Session::getTimeout |
|
100
|
|
|
* |
|
101
|
|
|
* @method static bool|null getUseCookies() Returns the value indicating whether cookies should be used to store session IDs. |
|
102
|
|
|
* @see \yii\web\Session::getUseCookies |
|
103
|
|
|
* |
|
104
|
|
|
* @method static bool getUseCustomStorage() Returns a value indicating whether to use custom session storage. |
|
105
|
|
|
* @see \yii\web\Session::getUseCustomStorage |
|
106
|
|
|
* |
|
107
|
|
|
* @method static bool getUseTransparentSessionID() |
|
108
|
|
|
* @see \yii\web\Session::getUseTransparentSessionID |
|
109
|
|
|
* |
|
110
|
|
|
* @method static bool has(mixed $key) |
|
111
|
|
|
* @see \yii\web\Session::has |
|
112
|
|
|
* |
|
113
|
|
|
* @method static bool hasEventHandlers(string $name) Returns a value indicating whether there is any handler attached to the named event. |
|
114
|
|
|
* @see \yii\base\Component::hasEventHandlers |
|
115
|
|
|
* |
|
116
|
|
|
* @method static bool hasFlash(string $key) Returns a value indicating whether there are flash messages associated with the specified key. |
|
117
|
|
|
* @see \yii\web\Session::hasFlash |
|
118
|
|
|
* |
|
119
|
|
|
* @method static bool off(string $name, callable $handler = null) Detaches an existing event handler from this component. |
|
120
|
|
|
* @see \yii\base\Component::off |
|
121
|
|
|
* |
|
122
|
|
|
* @method static void on(string $name, callable $handler, mixed $data = null, bool $append = true) Attaches an event handler to an event. |
|
123
|
|
|
* @see \yii\base\Component::on |
|
124
|
|
|
* |
|
125
|
|
|
* @method static void open() Starts the session. |
|
126
|
|
|
* @see \yii\web\Session::open |
|
127
|
|
|
* |
|
128
|
|
|
* @method static bool openSession(string $savePath, string $sessionName) Session open handler. |
|
129
|
|
|
* @see \yii\web\Session::openSession |
|
130
|
|
|
* |
|
131
|
|
|
* @method static string readSession(string $id) Session read handler. |
|
132
|
|
|
* @see \yii\web\Session::readSession |
|
133
|
|
|
* |
|
134
|
|
|
* @method static void regenerateID(bool $deleteOldSession = false) Updates the current session ID with a newly generated one. |
|
135
|
|
|
* @see \yii\web\Session::regenerateID |
|
136
|
|
|
* |
|
137
|
|
|
* @method static mixed remove(string $key) Removes a session variable. |
|
138
|
|
|
* @see \yii\web\Session::remove |
|
139
|
|
|
* |
|
140
|
|
|
* @method static void removeAll() Removes all session variables. |
|
141
|
|
|
* @see \yii\web\Session::removeAll |
|
142
|
|
|
* |
|
143
|
|
|
* @method static void removeAllFlashes() Removes all flash messages. |
|
144
|
|
|
* @see \yii\web\Session::removeAllFlashes |
|
145
|
|
|
* |
|
146
|
|
|
* @method static mixed removeFlash(string $key) Removes a flash message. |
|
147
|
|
|
* @see \yii\web\Session::removeFlash |
|
148
|
|
|
* |
|
149
|
|
|
* @method static void set(string $key, mixed $value) Adds a session variable. |
|
150
|
|
|
* @see \yii\web\Session::set |
|
151
|
|
|
* |
|
152
|
|
|
* @method static void setCookieParams(array $value) Sets the session cookie parameters. |
|
153
|
|
|
* @see \yii\web\Session::setCookieParams |
|
154
|
|
|
* |
|
155
|
|
|
* @method static void setFlash(string $key, mixed $value = true, bool $removeAfterAccess = true) Sets a flash message. |
|
156
|
|
|
* @see \yii\web\Session::setFlash |
|
157
|
|
|
* |
|
158
|
|
|
* @method static void setGCProbability(float $value) |
|
159
|
|
|
* @see \yii\web\Session::setGCProbability |
|
160
|
|
|
* |
|
161
|
|
|
* @method static void setHasSessionId(bool $value) Sets the value indicating whether the current request has sent the session ID. |
|
162
|
|
|
* @see \yii\web\Session::setHasSessionId |
|
163
|
|
|
* |
|
164
|
|
|
* @method static void setId(string $value) Sets the session ID. |
|
165
|
|
|
* @see \yii\web\Session::setId |
|
166
|
|
|
* |
|
167
|
|
|
* @method static void setName(string $value) Sets the name for the current session. |
|
168
|
|
|
* @see \yii\web\Session::setName |
|
169
|
|
|
* |
|
170
|
|
|
* @method static void setSavePath(string $value) Sets the current session save path. |
|
171
|
|
|
* @see \yii\web\Session::setSavePath |
|
172
|
|
|
* |
|
173
|
|
|
* @method static void setTimeout(int $value) |
|
174
|
|
|
* @see \yii\web\Session::setTimeout |
|
175
|
|
|
* |
|
176
|
|
|
* @method static void setUseCookies(bool|null $value) Sets the value indicating whether cookies should be used to store session IDs. |
|
177
|
|
|
* @see \yii\web\Session::setUseCookies |
|
178
|
|
|
* |
|
179
|
|
|
* @method static void setUseTransparentSessionID(bool $value) |
|
180
|
|
|
* @see \yii\web\Session::setUseTransparentSessionID |
|
181
|
|
|
* |
|
182
|
|
|
* @method static void trigger(string $name, \yii\base\Event $event = null) Triggers an event. |
|
183
|
|
|
* @see \yii\base\Component::trigger |
|
184
|
|
|
* |
|
185
|
|
|
* @method static bool writeSession(string $id, string $data) Session write handler. |
|
186
|
|
|
* @see \yii\web\Session::writeSession |
|
187
|
|
|
* |
|
188
|
|
|
* Property accessors |
|
189
|
|
|
* |
|
190
|
|
|
* @method static string getFlashParam() Returns the name of the session variable that stores the flash message data. |
|
191
|
|
|
* @see \yii\web\Session::flashParam |
|
192
|
|
|
* |
|
193
|
|
|
* @method static \SessionHandlerInterface|array getHandler() Returns an object implementing the SessionHandlerInterface or a configuration array. |
|
194
|
|
|
* @see \yii\web\Session::handler |
|
195
|
|
|
* |
|
196
|
|
|
* @method static void setFlashParam(string $value) Sets the name of the session variable that stores the flash message data. |
|
197
|
|
|
* @see \yii\web\Session::flashParam |
|
198
|
|
|
* |
|
199
|
|
|
* @method static void setHandler(\SessionHandlerInterface|array $value) Sets an object implementing the SessionHandlerInterface or a configuration array. |
|
200
|
|
|
* @see \yii\web\Session::handler |
|
201
|
|
|
*/ |
|
202
|
|
|
class Session extends Facade |
|
203
|
|
|
{ |
|
204
|
|
|
/** |
|
205
|
|
|
* @inheritDoc |
|
206
|
|
|
*/ |
|
207
|
1 |
|
public static function getFacadeComponentId() |
|
208
|
|
|
{ |
|
209
|
1 |
|
return 'session'; |
|
210
|
|
|
} |
|
211
|
|
|
} |
|
212
|
|
|
|