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