/** * Load kernel, handle a request from a webserver and send the response * * Utility function for the entrypoint of your application, only use when you are in a request context (from a webserver) */ public static function boot(Request $request, RouteCollection $routeCollection, Container $container) { try { $kernel = new self($routeCollection, $container); $kernel->configureErrors(); $response = $kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, true); $response->send(); if ($kernel instanceof TerminableInterface) { $kernel->terminate($request, $response); } } catch (\Exception $exception) { $kernel->uncaughtRenderer->render($exception); } }