1 | <?php |
||
12 | class HTTPApplication implements Application |
||
13 | { |
||
14 | use HTTPMiddlewareAware; |
||
15 | |||
16 | /** |
||
17 | * @var Kernel |
||
18 | */ |
||
19 | protected $kernel; |
||
20 | |||
21 | public function __construct(Kernel $kernel) |
||
25 | |||
26 | /** |
||
27 | * Get the kernel for this application |
||
28 | * |
||
29 | * @return Kernel |
||
30 | */ |
||
31 | public function getKernel() |
||
35 | |||
36 | /** |
||
37 | * Handle the given HTTP request |
||
38 | * |
||
39 | * @param HTTPRequest $request |
||
40 | * @return HTTPResponse |
||
41 | */ |
||
42 | public function handle(HTTPRequest $request) |
||
51 | |||
52 | /** |
||
53 | * Safely boot the application and execute the given main action |
||
54 | * |
||
55 | * @param HTTPRequest $request |
||
56 | * @param callable $callback |
||
57 | * @param bool $flush |
||
58 | * @return HTTPResponse |
||
59 | */ |
||
60 | public function execute(HTTPRequest $request, callable $callback, $flush = false) |
||
74 | } |
||
75 |