1: <?php namespace Symfony\Component\HttpFoundation;
2:
3: class LaravelRequest extends Request {
4:
5: 6: 7: 8: 9: 10: 11:
12: static public function createFromGlobals()
13: {
14: $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
15:
16: if ((0 === strpos($request->server->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')
17: || (0 === strpos($request->server->get('HTTP_CONTENT_TYPE'), 'application/x-www-form-urlencoded')))
18: && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH'))
19: ) {
20: parse_str($request->getContent(), $data);
21: if (magic_quotes()) $data = array_strip_slashes($data);
22: $request->request = new ParameterBag($data);
23: }
24:
25: return $request;
26: }
27:
28: 29: 30: 31: 32:
33: public function getRootUrl()
34: {
35: return $this->getScheme().'://'.$this->getHttpHost().$this->getBasePath();
36: }
37:
38: }