HttpKernelInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpKernel;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpFoundation\Response;
  13. /**
  14. * HttpKernelInterface handles a Request to convert it to a Response.
  15. *
  16. * @author Fabien Potencier <fabien@symfony.com>
  17. */
  18. interface HttpKernelInterface
  19. {
  20. const MASTER_REQUEST = 1;
  21. const SUB_REQUEST = 2;
  22. /**
  23. * Handles a Request to convert it to a Response.
  24. *
  25. * When $catch is true, the implementation must catch all exceptions
  26. * and do its best to convert them to a Response instance.
  27. *
  28. * @param Request $request A Request instance
  29. * @param int $type The type of the request
  30. * (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)
  31. * @param bool $catch Whether to catch exceptions or not
  32. *
  33. * @return Response A Response instance
  34. *
  35. * @throws \Exception When an Exception occurs during processing
  36. */
  37. public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
  38. }