HttpKernelInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. * @api
  19. */
  20. interface HttpKernelInterface
  21. {
  22. const MASTER_REQUEST = 1;
  23. const SUB_REQUEST = 2;
  24. /**
  25. * Handles a Request to convert it to a Response.
  26. *
  27. * When $catch is true, the implementation must catch all exceptions
  28. * and do its best to convert them to a Response instance.
  29. *
  30. * @param Request $request A Request instance
  31. * @param integer $type The type of the request
  32. * (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)
  33. * @param Boolean $catch Whether to catch exceptions or not
  34. *
  35. * @return Response A Response instance
  36. *
  37. * @throws \Exception When an Exception occurs during processing
  38. *
  39. * @api
  40. */
  41. public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
  42. }