|
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('request') facade. |
|
17
|
|
|
* |
|
18
|
|
|
* Methods |
|
19
|
|
|
* |
|
20
|
|
|
* @method static \yii\base\Behavior attachBehavior(string $name, string|array|\yii\base\Behavior $behavior) Attaches a behavior to this component. |
|
21
|
|
|
* @see \yii\base\Component::attachBehavior |
|
22
|
|
|
* |
|
23
|
|
|
* @method static void attachBehaviors(array $behaviors) Attaches a list of behaviors to the component. |
|
24
|
|
|
* @see \yii\base\Component::attachBehaviors |
|
25
|
|
|
* |
|
26
|
|
|
* @method static array behaviors() Returns a list of behaviors that this component should behave as. |
|
27
|
|
|
* @see \yii\base\Component::behaviors |
|
28
|
|
|
* |
|
29
|
|
|
* @method static null|\yii\base\Behavior detachBehavior(string $name) Detaches a behavior from the component. |
|
30
|
|
|
* @see \yii\base\Component::detachBehavior |
|
31
|
|
|
* |
|
32
|
|
|
* @method static void detachBehaviors() Detaches all behaviors from the component. |
|
33
|
|
|
* @see \yii\base\Component::detachBehaviors |
|
34
|
|
|
* |
|
35
|
|
|
* @method static void ensureBehaviors() Makes sure that the behaviors declared in [[behaviors()]] are attached to this component. |
|
36
|
|
|
* @see \yii\base\Component::ensureBehaviors |
|
37
|
|
|
* |
|
38
|
|
|
* @method static array|mixed get(string $name = null, mixed $defaultValue = null) Returns GET parameter with a given name. |
|
39
|
|
|
* @see \yii\web\Request::get |
|
40
|
|
|
* |
|
41
|
|
|
* @method static string getAbsoluteUrl() Returns the currently requested absolute URL. |
|
42
|
|
|
* @see \yii\web\Request::getAbsoluteUrl |
|
43
|
|
|
* |
|
44
|
|
|
* @method static array getAcceptableContentTypes() Returns the content types acceptable by the end user. |
|
45
|
|
|
* @see \yii\web\Request::getAcceptableContentTypes |
|
46
|
|
|
* |
|
47
|
|
|
* @method static array getAcceptableLanguages() Returns the languages acceptable by the end user. |
|
48
|
|
|
* @see \yii\web\Request::getAcceptableLanguages |
|
49
|
|
|
* |
|
50
|
|
|
* @method static string|null getAuthPassword() |
|
51
|
|
|
* @see \yii\web\Request::getAuthPassword |
|
52
|
|
|
* |
|
53
|
|
|
* @method static string|null getAuthUser() |
|
54
|
|
|
* @see \yii\web\Request::getAuthUser |
|
55
|
|
|
* |
|
56
|
|
|
* @method static string getBaseUrl() Returns the relative URL for the application. |
|
57
|
|
|
* @see \yii\web\Request::getBaseUrl |
|
58
|
|
|
* |
|
59
|
|
|
* @method static null|\yii\base\Behavior getBehavior(string $name) Returns the named behavior object. |
|
60
|
|
|
* @see \yii\base\Component::getBehavior |
|
61
|
|
|
* |
|
62
|
|
|
* @method static \yii\base\Behavior[] getBehaviors() Returns all behaviors attached to this component. |
|
63
|
|
|
* @see \yii\base\Component::getBehaviors |
|
64
|
|
|
* |
|
65
|
|
|
* @method static mixed getBodyParam(string $name, mixed $defaultValue = null) Returns the named request body parameter value. |
|
66
|
|
|
* @see \yii\web\Request::getBodyParam |
|
67
|
|
|
* |
|
68
|
|
|
* @method static array getBodyParams() Returns the request parameters given in the request body. |
|
69
|
|
|
* @see \yii\web\Request::getBodyParams |
|
70
|
|
|
* |
|
71
|
|
|
* @method static string getContentType() Returns request content-type The Content-Type header field indicates the MIME type of the data contained in [[getRawBody()]] or, in the case of the HEAD method, the media type that would have been sent had the request been a GET. |
|
72
|
|
|
* @see \yii\web\Request::getContentType |
|
73
|
|
|
* |
|
74
|
|
|
* @method static \yii\web\CookieCollection getCookies() Returns the cookie collection. |
|
75
|
|
|
* @see \yii\web\Request::getCookies |
|
76
|
|
|
* |
|
77
|
|
|
* @method static string getCsrfToken(bool $regenerate = false) Returns the token used to perform CSRF validation. |
|
78
|
|
|
* @see \yii\web\Request::getCsrfToken |
|
79
|
|
|
* |
|
80
|
|
|
* @method static string getCsrfTokenFromHeader() |
|
81
|
|
|
* @see \yii\web\Request::getCsrfTokenFromHeader |
|
82
|
|
|
* |
|
83
|
|
|
* @method static array getETags() Gets the Etags. |
|
84
|
|
|
* @see \yii\web\Request::getETags |
|
85
|
|
|
* |
|
86
|
|
|
* @method static \yii\web\HeaderCollection getHeaders() Returns the header collection. |
|
87
|
|
|
* @see \yii\web\Request::getHeaders |
|
88
|
|
|
* |
|
89
|
|
|
* @method static string|null getHostInfo() Returns the schema and host part of the current request URL. |
|
90
|
|
|
* @see \yii\web\Request::getHostInfo |
|
91
|
|
|
* |
|
92
|
|
|
* @method static string|null getHostName() Returns the host part of the current request URL. |
|
93
|
|
|
* @see \yii\web\Request::getHostName |
|
94
|
|
|
* |
|
95
|
|
|
* @method static bool getIsAjax() Returns whether this is an AJAX (XMLHttpRequest) request. |
|
96
|
|
|
* @see \yii\web\Request::getIsAjax |
|
97
|
|
|
* |
|
98
|
|
|
* @method static bool getIsConsoleRequest() Returns a value indicating whether the current request is made via command line. |
|
99
|
|
|
* @see \yii\base\Request::getIsConsoleRequest |
|
100
|
|
|
* |
|
101
|
|
|
* @method static bool getIsDelete() Returns whether this is a DELETE request. |
|
102
|
|
|
* @see \yii\web\Request::getIsDelete |
|
103
|
|
|
* |
|
104
|
|
|
* @method static bool getIsFlash() Returns whether this is an Adobe Flash or Flex request. |
|
105
|
|
|
* @see \yii\web\Request::getIsFlash |
|
106
|
|
|
* |
|
107
|
|
|
* @method static bool getIsGet() Returns whether this is a GET request. |
|
108
|
|
|
* @see \yii\web\Request::getIsGet |
|
109
|
|
|
* |
|
110
|
|
|
* @method static bool getIsHead() Returns whether this is a HEAD request. |
|
111
|
|
|
* @see \yii\web\Request::getIsHead |
|
112
|
|
|
* |
|
113
|
|
|
* @method static bool getIsOptions() Returns whether this is an OPTIONS request. |
|
114
|
|
|
* @see \yii\web\Request::getIsOptions |
|
115
|
|
|
* |
|
116
|
|
|
* @method static bool getIsPatch() Returns whether this is a PATCH request. |
|
117
|
|
|
* @see \yii\web\Request::getIsPatch |
|
118
|
|
|
* |
|
119
|
|
|
* @method static bool getIsPjax() Returns whether this is a PJAX request. |
|
120
|
|
|
* @see \yii\web\Request::getIsPjax |
|
121
|
|
|
* |
|
122
|
|
|
* @method static bool getIsPost() Returns whether this is a POST request. |
|
123
|
|
|
* @see \yii\web\Request::getIsPost |
|
124
|
|
|
* |
|
125
|
|
|
* @method static bool getIsPut() Returns whether this is a PUT request. |
|
126
|
|
|
* @see \yii\web\Request::getIsPut |
|
127
|
|
|
* |
|
128
|
|
|
* @method static bool getIsSecureConnection() Return if the request is sent via secure channel (https). |
|
129
|
|
|
* @see \yii\web\Request::getIsSecureConnection |
|
130
|
|
|
* |
|
131
|
|
|
* @method static string getMethod() Returns the method of the current request (e.g. GET, POST, HEAD, PUT, PATCH, DELETE). |
|
132
|
|
|
* @see \yii\web\Request::getMethod |
|
133
|
|
|
* |
|
134
|
|
|
* @method static array getParams() Returns the command line arguments. |
|
135
|
|
|
* @see \yii\console\Request::getParams |
|
136
|
|
|
* |
|
137
|
|
|
* @method static string getPathInfo() Returns the path info of the currently requested URL. |
|
138
|
|
|
* @see \yii\web\Request::getPathInfo |
|
139
|
|
|
* |
|
140
|
|
|
* @method static int getPort() Returns the port to use for insecure requests. |
|
141
|
|
|
* @see \yii\web\Request::getPort |
|
142
|
|
|
* |
|
143
|
|
|
* @method static string getPreferredLanguage(array $languages = []) Returns the user-preferred language that should be used by this application. |
|
144
|
|
|
* @see \yii\web\Request::getPreferredLanguage |
|
145
|
|
|
* |
|
146
|
|
|
* @method static mixed getQueryParam(string $name, mixed $defaultValue = null) Returns the named GET parameter value. |
|
147
|
|
|
* @see \yii\web\Request::getQueryParam |
|
148
|
|
|
* |
|
149
|
|
|
* @method static array getQueryParams() Returns the request parameters given in the [[queryString]]. |
|
150
|
|
|
* @see \yii\web\Request::getQueryParams |
|
151
|
|
|
* |
|
152
|
|
|
* @method static string getQueryString() Returns part of the request URL that is after the question mark. |
|
153
|
|
|
* @see \yii\web\Request::getQueryString |
|
154
|
|
|
* |
|
155
|
|
|
* @method static string getRawBody() Returns the raw HTTP request body. |
|
156
|
|
|
* @see \yii\web\Request::getRawBody |
|
157
|
|
|
* |
|
158
|
|
|
* @method static string|null getReferrer() Returns the URL referrer. |
|
159
|
|
|
* @see \yii\web\Request::getReferrer |
|
160
|
|
|
* |
|
161
|
|
|
* @method static string getScriptFile() Returns the entry script file path. |
|
162
|
|
|
* @see \yii\web\Request::getScriptFile |
|
163
|
|
|
* |
|
164
|
|
|
* @method static string getScriptUrl() Returns the relative URL of the entry script. |
|
165
|
|
|
* @see \yii\web\Request::getScriptUrl |
|
166
|
|
|
* |
|
167
|
|
|
* @method static int getSecurePort() Returns the port to use for secure requests. |
|
168
|
|
|
* @see \yii\web\Request::getSecurePort |
|
169
|
|
|
* |
|
170
|
|
|
* @method static string getServerName() Returns the server name. |
|
171
|
|
|
* @see \yii\web\Request::getServerName |
|
172
|
|
|
* |
|
173
|
|
|
* @method static int|null getServerPort() Returns the server port number. |
|
174
|
|
|
* @see \yii\web\Request::getServerPort |
|
175
|
|
|
* |
|
176
|
|
|
* @method static string getUrl() Returns the currently requested relative URL. |
|
177
|
|
|
* @see \yii\web\Request::getUrl |
|
178
|
|
|
* |
|
179
|
|
|
* @method static string|null getUserAgent() Returns the user agent. |
|
180
|
|
|
* @see \yii\web\Request::getUserAgent |
|
181
|
|
|
* |
|
182
|
|
|
* @method static string|null getUserHost() Returns the user host name. |
|
183
|
|
|
* @see \yii\web\Request::getUserHost |
|
184
|
|
|
* |
|
185
|
|
|
* @method static string|null getUserIP() Returns the user IP address. |
|
186
|
|
|
* @see \yii\web\Request::getUserIP |
|
187
|
|
|
* |
|
188
|
|
|
* @method static bool hasEventHandlers(string $name) Returns a value indicating whether there is any handler attached to the named event. |
|
189
|
|
|
* @see \yii\base\Component::hasEventHandlers |
|
190
|
|
|
* |
|
191
|
|
|
* @method static bool off(string $name, callable $handler = null) Detaches an existing event handler from this component. |
|
192
|
|
|
* @see \yii\base\Component::off |
|
193
|
|
|
* |
|
194
|
|
|
* @method static void on(string $name, callable $handler, mixed $data = null, bool $append = true) Attaches an event handler to an event. |
|
195
|
|
|
* @see \yii\base\Component::on |
|
196
|
|
|
* |
|
197
|
|
|
* @method static array parseAcceptHeader(string $header) Parses the given `Accept` (or `Accept-Language`) header. |
|
198
|
|
|
* @see \yii\web\Request::parseAcceptHeader |
|
199
|
|
|
* |
|
200
|
|
|
* @method static array|mixed post(string $name = null, mixed $defaultValue = null) Returns POST parameter with a given name. |
|
201
|
|
|
* @see \yii\web\Request::post |
|
202
|
|
|
* |
|
203
|
|
|
* @method static array resolve() Resolves the current request into a route and the associated parameters. |
|
204
|
|
|
* @see \yii\web\Request::resolve |
|
205
|
|
|
* |
|
206
|
|
|
* @method static void setAcceptableContentTypes(array $value) Sets the acceptable content types. |
|
207
|
|
|
* @see \yii\web\Request::setAcceptableContentTypes |
|
208
|
|
|
* |
|
209
|
|
|
* @method static void setAcceptableLanguages(array $value) |
|
210
|
|
|
* @see \yii\web\Request::setAcceptableLanguages |
|
211
|
|
|
* |
|
212
|
|
|
* @method static void setBaseUrl(string $value) Sets the relative URL for the application. |
|
213
|
|
|
* @see \yii\web\Request::setBaseUrl |
|
214
|
|
|
* |
|
215
|
|
|
* @method static void setBodyParams(array $values) Sets the request body parameters. |
|
216
|
|
|
* @see \yii\web\Request::setBodyParams |
|
217
|
|
|
* |
|
218
|
|
|
* @method static void setHostInfo(string|null $value) Sets the schema and host part of the application URL. |
|
219
|
|
|
* @see \yii\web\Request::setHostInfo |
|
220
|
|
|
* |
|
221
|
|
|
* @method static void setIsConsoleRequest(bool $value) Sets the value indicating whether the current request is made via command line. |
|
222
|
|
|
* @see \yii\base\Request::setIsConsoleRequest |
|
223
|
|
|
* |
|
224
|
|
|
* @method static void setParams(array $params) Sets the command line arguments. |
|
225
|
|
|
* @see \yii\console\Request::setParams |
|
226
|
|
|
* |
|
227
|
|
|
* @method static void setPathInfo(string $value) Sets the path info of the current request. |
|
228
|
|
|
* @see \yii\web\Request::setPathInfo |
|
229
|
|
|
* |
|
230
|
|
|
* @method static void setPort(int $value) Sets the port to use for insecure requests. |
|
231
|
|
|
* @see \yii\web\Request::setPort |
|
232
|
|
|
* |
|
233
|
|
|
* @method static void setQueryParams(array $values) Sets the request [[queryString]] parameters. |
|
234
|
|
|
* @see \yii\web\Request::setQueryParams |
|
235
|
|
|
* |
|
236
|
|
|
* @method static void setRawBody(string $rawBody) Sets the raw HTTP request body, this method is mainly used by test scripts to simulate raw HTTP requests. |
|
237
|
|
|
* @see \yii\web\Request::setRawBody |
|
238
|
|
|
* |
|
239
|
|
|
* @method static void setScriptFile(string $value) Sets the entry script file path. |
|
240
|
|
|
* @see \yii\web\Request::setScriptFile |
|
241
|
|
|
* |
|
242
|
|
|
* @method static void setScriptUrl(string $value) Sets the relative URL for the application entry script. |
|
243
|
|
|
* @see \yii\web\Request::setScriptUrl |
|
244
|
|
|
* |
|
245
|
|
|
* @method static void setSecurePort(int $value) Sets the port to use for secure requests. |
|
246
|
|
|
* @see \yii\web\Request::setSecurePort |
|
247
|
|
|
* |
|
248
|
|
|
* @method static void setUrl(string $value) Sets the currently requested relative URL. |
|
249
|
|
|
* @see \yii\web\Request::setUrl |
|
250
|
|
|
* |
|
251
|
|
|
* @method static void trigger(string $name, \yii\base\Event $event = null) Triggers an event. |
|
252
|
|
|
* @see \yii\base\Component::trigger |
|
253
|
|
|
* |
|
254
|
|
|
* @method static bool validateCsrfToken(string $clientSuppliedToken = null) Performs the CSRF validation. |
|
255
|
|
|
* @see \yii\web\Request::validateCsrfToken |
|
256
|
|
|
* |
|
257
|
|
|
* Property accessors |
|
258
|
|
|
* |
|
259
|
|
|
* @method static string getCookieValidationKey() Returns a secret key used for cookie validation. |
|
260
|
|
|
* @see \yii\web\Request::cookieValidationKey |
|
261
|
|
|
* |
|
262
|
|
|
* @method static array getCsrfCookie() Returns the configuration for creating the CSRF [[Cookie|cookie]]. |
|
263
|
|
|
* @see \yii\web\Request::csrfCookie |
|
264
|
|
|
* |
|
265
|
|
|
* @method static string getCsrfParam() Returns the name of the token used to prevent CSRF. |
|
266
|
|
|
* @see \yii\web\Request::csrfParam |
|
267
|
|
|
* |
|
268
|
|
|
* @method static bool getEnableCookieValidation() Returns whether cookies should be validated to ensure they are not tampered. |
|
269
|
|
|
* @see \yii\web\Request::enableCookieValidation |
|
270
|
|
|
* |
|
271
|
|
|
* @method static bool getEnableCsrfCookie() Returns whether to use cookie to persist CSRF token. |
|
272
|
|
|
* @see \yii\web\Request::enableCsrfCookie |
|
273
|
|
|
* |
|
274
|
|
|
* @method static bool getEnableCsrfValidation() Returns whether to enable CSRF (Cross-Site Request Forgery) validation. |
|
275
|
|
|
* @see \yii\web\Request::enableCsrfValidation |
|
276
|
|
|
* |
|
277
|
|
|
* @method static string getMethodParam() Returns the name of the POST parameter that is used to indicate if a request is a PUT, PATCH or DELETE request tunneled through POST. |
|
278
|
|
|
* @see \yii\web\Request::methodParam |
|
279
|
|
|
* |
|
280
|
|
|
* @method static array getParsers() Returns the parsers for converting the raw HTTP request body into [[bodyParams]]. |
|
281
|
|
|
* @see \yii\web\Request::parsers |
|
282
|
|
|
* |
|
283
|
|
|
* @method static void setCookieValidationKey(string $value) Sets a secret key used for cookie validation. |
|
284
|
|
|
* @see \yii\web\Request::cookieValidationKey |
|
285
|
|
|
* |
|
286
|
|
|
* @method static void setCsrfCookie(array $value) Sets the configuration for creating the CSRF [[Cookie|cookie]]. |
|
287
|
|
|
* @see \yii\web\Request::csrfCookie |
|
288
|
|
|
* |
|
289
|
|
|
* @method static void setCsrfParam(string $value) Sets the name of the token used to prevent CSRF. |
|
290
|
|
|
* @see \yii\web\Request::csrfParam |
|
291
|
|
|
* |
|
292
|
|
|
* @method static void setEnableCookieValidation(bool $value) Sets whether cookies should be validated to ensure they are not tampered. |
|
293
|
|
|
* @see \yii\web\Request::enableCookieValidation |
|
294
|
|
|
* |
|
295
|
|
|
* @method static void setEnableCsrfCookie(bool $value) Sets whether to use cookie to persist CSRF token. |
|
296
|
|
|
* @see \yii\web\Request::enableCsrfCookie |
|
297
|
|
|
* |
|
298
|
|
|
* @method static void setEnableCsrfValidation(bool $value) Sets whether to enable CSRF (Cross-Site Request Forgery) validation. |
|
299
|
|
|
* @see \yii\web\Request::enableCsrfValidation |
|
300
|
|
|
* |
|
301
|
|
|
* @method static void setMethodParam(string $value) Sets the name of the POST parameter that is used to indicate if a request is a PUT, PATCH or DELETE request tunneled through POST. |
|
302
|
|
|
* @see \yii\web\Request::methodParam |
|
303
|
|
|
* |
|
304
|
|
|
* @method static void setParsers(array $value) Sets the parsers for converting the raw HTTP request body into [[bodyParams]]. |
|
305
|
|
|
* @see \yii\web\Request::parsers |
|
306
|
|
|
*/ |
|
307
|
|
|
class Request extends Facade |
|
308
|
|
|
{ |
|
309
|
|
|
/** |
|
310
|
|
|
* @inheritDoc |
|
311
|
|
|
*/ |
|
312
|
7 |
|
public static function getFacadeComponentId() |
|
313
|
|
|
{ |
|
314
|
7 |
|
return 'request'; |
|
315
|
|
|
} |
|
316
|
|
|
} |
|
317
|
|
|
|