public static function Request::createFromGlobals

Creates a new request with values from PHP's super globals.

@api

Return value

Request A new request

8 calls to Request::createFromGlobals()
drupal_handle_request in drupal/core/includes/bootstrap.inc
Handles an entire PHP request.
install_begin_request in drupal/core/includes/install.core.inc
Begins an installation request, modifying the installation state as needed.
install_finished in drupal/core/includes/install.core.inc
Performs final installation steps and displays a 'finished' page.
language_test_subrequest in drupal/core/modules/language/tests/language_test/language_test.module
Page callback. Uses a subrequest to retrieve the 'user' page.
RequestTest::testCreateFromGlobals in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php
@dataProvider provideOverloadedMethods

... See full list

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php, line 237

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public static function createFromGlobals() {
  $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
  if (0 === strpos($request->headers
    ->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);
    $request->request = new ParameterBag($data);
  }
  return $request;
}