8.5.x Request.php Request::setFactory($callable)
8.0.x Request.php Request::setFactory($callable)
8.1.x Request.php Request::setFactory($callable)
8.2.x Request.php Request::setFactory($callable)
8.3.x Request.php Request::setFactory($callable)
8.4.x Request.php Request::setFactory($callable)
8.6.x Request.php Request::setFactory($callable)

Sets a callable able to create a Request instance.

This is mainly useful when you need to override the Request class to keep BC with an existing system. It should not be used for any other purpose.

Parameters

callable|null $callable A PHP callable:

3 calls to Request::setFactory()
DrupalKernel::setupTrustedHosts in core/lib/Drupal/Core/DrupalKernel.php
Sets up the lists of trusted HTTP Host headers.
DrupalKernelTest::testInitializeSettings in core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php
Tests the reregistration of autoloaders if APCu available.
DrupalKernelTest::testTrustedHosts in core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php
Tests hostname validation with settings.

File

vendor/symfony/http-foundation/Request.php, line 410

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public static function setFactory($callable) {
  self::$requestFactory = $callable;
}