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 | /** |
||
215 | * remove param |
||
216 | * |
||
217 | * @deprecated 4.9.53 |
||
218 | * @param $key |
||
219 | * @param bool $unset_from_global_too |
||
220 | * @throws InvalidArgumentException |
||
221 | * @throws InvalidDataTypeException |
||
222 | * @throws InvalidInterfaceException |
||
223 | */ |
||
224 | public function un_set($key, $unset_from_global_too = false) |
||
228 | |||
229 | |||
230 | |||
231 | /** |
||
232 | * @deprecated 4.9.53 |
||
233 | * @return string |
||
234 | * @throws InvalidArgumentException |
||
235 | * @throws InvalidDataTypeException |
||
236 | * @throws InvalidInterfaceException |
||
237 | */ |
||
238 | public function ip_address() |
||
242 | |||
243 | |||
244 | /** |
||
245 | * @deprecated 4.9.53 |
||
246 | * @return bool |
||
247 | * @throws InvalidArgumentException |
||
248 | * @throws InvalidDataTypeException |
||
249 | * @throws InvalidInterfaceException |
||
250 | */ |
||
251 | public function isAdmin() |
||
255 | |||
256 | |||
257 | /** |
||
258 | * @deprecated 4.9.53 |
||
259 | * @return mixed |
||
260 | * @throws InvalidArgumentException |
||
261 | * @throws InvalidDataTypeException |
||
262 | * @throws InvalidInterfaceException |
||
263 | */ |
||
264 | public function isAjax() |
||
268 | |||
269 | |||
270 | /** |
||
271 | * @deprecated 4.9.53 |
||
272 | * @return mixed |
||
273 | * @throws InvalidArgumentException |
||
274 | * @throws InvalidDataTypeException |
||
275 | * @throws InvalidInterfaceException |
||
276 | */ |
||
277 | public function isFrontAjax() |
||
281 | |||
282 | |||
283 | /** |
||
284 | * @deprecated 4.9.53 |
||
285 | * @return mixed|string |
||
286 | * @throws InvalidArgumentException |
||
287 | * @throws InvalidDataTypeException |
||
288 | * @throws InvalidInterfaceException |
||
289 | */ |
||
290 | public function requestUri() |
||
294 | |||
295 | |||
296 | /** |
||
297 | * @deprecated 4.9.53 |
||
298 | * @return string |
||
299 | * @throws InvalidArgumentException |
||
300 | * @throws InvalidDataTypeException |
||
301 | * @throws InvalidInterfaceException |
||
302 | */ |
||
303 | public function userAgent() |
||
307 | |||
308 | |||
309 | /** |
||
310 | * @deprecated 4.9.53 |
||
311 | * @param string $user_agent |
||
312 | * @throws InvalidArgumentException |
||
313 | * @throws InvalidDataTypeException |
||
314 | * @throws InvalidInterfaceException |
||
315 | */ |
||
316 | public function setUserAgent($user_agent = '') |
||
320 | |||
321 | |||
322 | /** |
||
323 | * @deprecated 4.9.53 |
||
324 | * @return bool |
||
325 | * @throws InvalidArgumentException |
||
326 | * @throws InvalidDataTypeException |
||
327 | * @throws InvalidInterfaceException |
||
328 | */ |
||
329 | public function isBot() |
||
333 | |||
334 | |||
335 | /** |
||
336 | * @deprecated 4.9.53 |
||
337 | * @param bool $is_bot |
||
338 | * @throws InvalidArgumentException |
||
339 | * @throws InvalidDataTypeException |
||
340 | * @throws InvalidInterfaceException |
||
341 | */ |
||
342 | public function setIsBot($is_bot) |
||
346 | |||
347 | |||
348 | |||
349 | } |
||
350 | // End of file EE_Request.core.php |
||
352 |