You are here

public function RequestStack::getMasterRequest in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Symfony/Component/HttpFoundation/RequestStack.php \Symfony\Component\HttpFoundation\RequestStack::getMasterRequest()

Gets the master Request.

Be warned that making your code aware of the master request might make it un-compatible with other features of your framework like ESI support.

Return value

Request|null

File

lib/Symfony/Component/HttpFoundation/RequestStack.php, line 73

Class

RequestStack
Request stack that controls the lifecycle of requests.

Namespace

Symfony\Component\HttpFoundation

Code

public function getMasterRequest() {
  if (!$this->requests) {
    return;
  }
  return $this->requests[0];
}