I'm trying to follow this article:
Also looking at HttpKernel https://github.com/symfony/HttpKernel
And I'm quite confused. It seems to me that the Kernel is really something much more than the HttpKernel class here, and even the standard Symfony app.php
has
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
//$kernel = new AppCache($kernel);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
The Kernel, in turns, will call the HttpKernel->handle()
within $kernel->handle($request)
anyhow; plus it also seems to be taking care of loading bundles as well?
However, when the kernel creates the service container through boot()
within handle()
it also compile the container making it impossible to add more parameters and services.
So I guess my questions are:
- Is there any specific reason that in the tutorial the Framework class extends HttpKernel instead of Kernel?
- Should I also follow suit? Or should I use Kernel as my core. And if so, how do I get around the
compile()
issue? I do have parameters and services I have to add, how do I handle?