暫無描述

HttpKernelInterface.php 1.2KB

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. public const MASTER_REQUEST = 1;
  21. public 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 int $type The type of the request
  29. * (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)
  30. * @param bool $catch Whether to catch exceptions or not
  31. *
  32. * @return Response A Response instance
  33. *
  34. * @throws \Exception When an Exception occurs during processing
  35. */
  36. public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
  37. }