有人能指出我实例化HttpKernel的地方,或者更好地询问它在何处配置为服务?
我所知道的:
在symfony full stack前端控制器中:" app_dev.php"
$kernel = new AppKernel('dev', true);
$response = $kernel->handle($request);
然后我们看到:
class AppKernel extends Kernel
然后在" Kernel.php"
/**
* {@inheritdoc}
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
if (false === $this->booted) {
$this->boot();
}
return $this->getHttpKernel()->handle($request, $type, $catch);
}
/**
* Gets a HTTP kernel from the container.
*
* @return HttpKernel
*/
protected function getHttpKernel()
{
return $this->container->get('http_kernel');
}
还有一条评论说HttpKernel是从容器加载的。现在,我有兴趣了解这个类的实例化时间,地点和方式,并将其设置为服务。
谢谢!