public function ExceptionHandler::sendPhpResponse

Sends the error associated with the given Exception as a plain PHP response.

This method uses plain PHP functions like header() and echo to output the response.

Parameters

\Exception|FlattenException $exception An \Exception instance:

1 call to ExceptionHandler::sendPhpResponse()
ExceptionHandler::handle in drupal/core/vendor/symfony/debug/Symfony/Component/Debug/ExceptionHandler.php
Sends a response for the given Exception.

File

drupal/core/vendor/symfony/debug/Symfony/Component/Debug/ExceptionHandler.php, line 88

Class

ExceptionHandler
ExceptionHandler converts an exception to a Response object.

Namespace

Symfony\Component\Debug

Code

public function sendPhpResponse($exception) {
  if (!$exception instanceof FlattenException) {
    $exception = FlattenException::create($exception);
  }
  header(sprintf('HTTP/1.0 %s', $exception
    ->getStatusCode()));
  foreach ($exception
    ->getHeaders() as $name => $value) {
    header($name . ': ' . $value, false);
  }
  echo $this
    ->decorate($this
    ->getContent($exception), $this
    ->getStylesheet($exception));
}