1 | <?php |
||
22 | class EE_Request implements LegacyRequestInterface, InterminableInterface |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * @var RequestInterface $request |
||
27 | */ |
||
28 | private $request; |
||
29 | |||
30 | /** |
||
31 | * whether current request is for the admin but NOT via AJAX |
||
32 | * |
||
33 | * @var boolean $admin |
||
34 | */ |
||
35 | public $admin = false; |
||
36 | |||
37 | /** |
||
38 | * whether current request is via AJAX |
||
39 | * |
||
40 | * @var boolean $ajax |
||
41 | */ |
||
42 | public $ajax = false; |
||
43 | |||
44 | /** |
||
45 | * whether current request is via AJAX from the frontend of the site |
||
46 | * |
||
47 | * @var boolean $front_ajax |
||
48 | */ |
||
49 | public $front_ajax = false; |
||
50 | |||
51 | |||
52 | /** |
||
53 | * @deprecated 4.9.53 |
||
54 | * @param array $get |
||
55 | * @param array $post |
||
56 | * @param array $cookie |
||
57 | * @param array $server |
||
58 | */ |
||
59 | public function __construct(array $get, array $post, array $cookie, array $server = array()) |
||
62 | |||
63 | |||
64 | /** |
||
65 | * @return RequestInterface |
||
66 | * @throws InvalidArgumentException |
||
67 | * @throws InvalidInterfaceException |
||
68 | * @throws InvalidDataTypeException |
||
69 | */ |
||
70 | private function request() |
||
79 | |||
80 | |||
81 | /** |
||
82 | * @param RequestInterface $request |
||
83 | */ |
||
84 | public function setRequest(RequestInterface $request) |
||
88 | |||
89 | |||
90 | |||
91 | /** |
||
92 | * @deprecated 4.9.53 |
||
93 | * @return array |
||
94 | * @throws InvalidArgumentException |
||
95 | * @throws InvalidDataTypeException |
||
96 | * @throws InvalidInterfaceException |
||
97 | */ |
||
98 | public function get_params() |
||
102 | |||
103 | |||
104 | |||
105 | /** |
||
106 | * @deprecated 4.9.53 |
||
107 | * @return array |
||
108 | * @throws InvalidArgumentException |
||
109 | * @throws InvalidDataTypeException |
||
110 | * @throws InvalidInterfaceException |
||
111 | */ |
||
112 | public function post_params() |
||
116 | |||
117 | |||
118 | |||
119 | /** |
||
120 | * @deprecated 4.9.53 |
||
121 | * @return array |
||
122 | * @throws InvalidArgumentException |
||
123 | * @throws InvalidDataTypeException |
||
124 | * @throws InvalidInterfaceException |
||
125 | */ |
||
126 | public function cookie_params() |
||
130 | |||
131 | |||
132 | /** |
||
133 | * @deprecated 4.9.53 |
||
134 | * @return array |
||
135 | * @throws InvalidArgumentException |
||
136 | * @throws InvalidDataTypeException |
||
137 | * @throws InvalidInterfaceException |
||
138 | */ |
||
139 | public function server_params() |
||
143 | |||
144 | |||
145 | |||
146 | /** |
||
147 | * returns contents of $_REQUEST |
||
148 | * |
||
149 | * @deprecated 4.9.53 |
||
150 | * @return array |
||
151 | * @throws InvalidArgumentException |
||
152 | * @throws InvalidDataTypeException |
||
153 | * @throws InvalidInterfaceException |
||
154 | */ |
||
155 | public function params() |
||
159 | |||
160 | |||
161 | |||
162 | /** |
||
163 | * @deprecated 4.9.53 |
||
164 | * @param $key |
||
165 | * @param $value |
||
166 | * @param bool $override_ee |
||
167 | * @return void |
||
168 | * @throws InvalidArgumentException |
||
169 | * @throws InvalidDataTypeException |
||
170 | * @throws InvalidInterfaceException |
||
171 | */ |
||
172 | public function set($key, $value, $override_ee = false) |
||
176 | |||
177 | |||
178 | |||
179 | /** |
||
180 | * returns the value for a request param if the given key exists |
||
181 | * |
||
182 | * @deprecated 4.9.53 |
||
183 | * @param $key |
||
184 | * @param null $default |
||
185 | * @return mixed |
||
186 | * @throws InvalidArgumentException |
||
187 | * @throws InvalidDataTypeException |
||
188 | * @throws InvalidInterfaceException |
||
189 | */ |
||
190 | public function get($key, $default = null) |
||
194 | |||
195 | |||
196 | |||
197 | /** |
||
198 | * check if param exists |
||
199 | * |
||
200 | * @deprecated 4.9.53 |
||
201 | * @param $key |
||
202 | * @return bool |
||
203 | * @throws InvalidArgumentException |
||
204 | * @throws InvalidDataTypeException |
||
205 | * @throws InvalidInterfaceException |
||
206 | */ |
||
207 | public function is_set($key) |
||
211 | |||
212 | |||
213 | /** |
||
214 | * remove param |
||
215 | * |
||
216 | * @deprecated 4.9.53 |
||
217 | * @param $key |
||
218 | * @param bool $unset_from_global_too |
||
219 | * @throws InvalidArgumentException |
||
220 | * @throws InvalidDataTypeException |
||
221 | * @throws InvalidInterfaceException |
||
222 | */ |
||
223 | public function un_set($key, $unset_from_global_too = false) |
||
227 | |||
228 | |||
229 | |||
230 | /** |
||
231 | * @deprecated 4.9.53 |
||
232 | * @return string |
||
233 | * @throws InvalidArgumentException |
||
234 | * @throws InvalidDataTypeException |
||
235 | * @throws InvalidInterfaceException |
||
236 | */ |
||
237 | public function ip_address() |
||
241 | |||
242 | |||
243 | /** |
||
244 | * @deprecated 4.9.53 |
||
245 | * @return bool |
||
246 | * @throws InvalidArgumentException |
||
247 | * @throws InvalidDataTypeException |
||
248 | * @throws InvalidInterfaceException |
||
249 | */ |
||
250 | public function isAdmin() |
||
254 | |||
255 | |||
256 | /** |
||
257 | * @deprecated 4.9.53 |
||
258 | * @return mixed |
||
259 | * @throws InvalidArgumentException |
||
260 | * @throws InvalidDataTypeException |
||
261 | * @throws InvalidInterfaceException |
||
262 | */ |
||
263 | public function isAjax() |
||
267 | |||
268 | |||
269 | /** |
||
270 | * @deprecated 4.9.53 |
||
271 | * @return mixed |
||
272 | * @throws InvalidArgumentException |
||
273 | * @throws InvalidDataTypeException |
||
274 | * @throws InvalidInterfaceException |
||
275 | */ |
||
276 | public function isFrontAjax() |
||
280 | |||
281 | |||
282 | /** |
||
283 | * @deprecated 4.9.53 |
||
284 | * @return mixed|string |
||
285 | * @throws InvalidArgumentException |
||
286 | * @throws InvalidDataTypeException |
||
287 | * @throws InvalidInterfaceException |
||
288 | */ |
||
289 | public function requestUri() |
||
293 | |||
294 | |||
295 | /** |
||
296 | * @deprecated 4.9.53 |
||
297 | * @return string |
||
298 | * @throws InvalidArgumentException |
||
299 | * @throws InvalidDataTypeException |
||
300 | * @throws InvalidInterfaceException |
||
301 | */ |
||
302 | public function userAgent() |
||
306 | |||
307 | |||
308 | /** |
||
309 | * @deprecated 4.9.53 |
||
310 | * @param string $user_agent |
||
311 | * @throws InvalidArgumentException |
||
312 | * @throws InvalidDataTypeException |
||
313 | * @throws InvalidInterfaceException |
||
314 | */ |
||
315 | public function setUserAgent($user_agent = '') |
||
319 | |||
320 | |||
321 | /** |
||
322 | * @deprecated 4.9.53 |
||
323 | * @return bool |
||
324 | * @throws InvalidArgumentException |
||
325 | * @throws InvalidDataTypeException |
||
326 | * @throws InvalidInterfaceException |
||
327 | */ |
||
328 | public function isBot() |
||
332 | |||
333 | |||
334 | /** |
||
335 | * @deprecated 4.9.53 |
||
336 | * @param bool $is_bot |
||
337 | * @throws InvalidArgumentException |
||
338 | * @throws InvalidDataTypeException |
||
339 | * @throws InvalidInterfaceException |
||
340 | */ |
||
341 | public function setIsBot($is_bot) |
||
345 | |||
346 | |||
347 | /** |
||
348 | * check if a request parameter exists whose key that matches the supplied wildcard pattern |
||
349 | * and return the value for the first match found |
||
350 | * wildcards can be either of the following: |
||
351 | * ? to represent a single character of any type |
||
352 | * * to represent one or more characters of any type |
||
353 | * |
||
354 | * @param string $pattern |
||
355 | * @param null|mixed $default |
||
356 | * @return false|int |
||
357 | * @throws InvalidArgumentException |
||
358 | * @throws InvalidInterfaceException |
||
359 | * @throws InvalidDataTypeException |
||
360 | */ |
||
361 | public function getMatch($pattern, $default = null) |
||
365 | |||
366 | |||
367 | /** |
||
368 | * check if a request parameter exists whose key matches the supplied wildcard pattern |
||
369 | * wildcards can be either of the following: |
||
370 | * ? to represent a single character of any type |
||
371 | * * to represent one or more characters of any type |
||
372 | * returns true if a match is found or false if not |
||
373 | * |
||
374 | * @param string $pattern |
||
375 | * @return false|int |
||
376 | * @throws InvalidArgumentException |
||
377 | * @throws InvalidInterfaceException |
||
378 | * @throws InvalidDataTypeException |
||
379 | */ |
||
380 | public function matches($pattern) |
||
384 | |||
385 | |||
386 | } |
||
387 | // End of file EE_Request.core.php |
||
389 |