123456789101112131415161718192021222324252627 |
- <?php namespace Symfony\Component\HttpFoundation;
- class LaravelRequest extends Request {
- /**
- * Creates a new request with values from PHP's super globals.
- *
- * @return Request A new request
- *
- * @api
- */
- static public function createFromGlobals()
- {
- $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
- if (0 === strpos($request->server->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')
- && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH'))
- ) {
- parse_str($request->getContent(), $data);
- if (magic_quotes()) $data = array_strip_slashes($data);
- $request->request = new ParameterBag($data);
- }
- return $request;
- }
- }
|