看 Symfony 框架,发现 HttpKernel 分了 MASTER_REQUEST 和 SUB_REQUEST ,而且 kernel 做 handle() 时还有个请求栈 requestStack ,一个 url 不是对应一个 Request 请求嘛,为什么还有子请求这个概念?是程序内发出的请求?这个子请求的应用场景是怎样的?主要是为了解决什么问题啊?
求解!
1
ZYWJ 2016-08-24 16:23:26 +08:00 1
|
2
likezun 2016-08-25 10:06:17 +08:00 1
我觉得核心就是:
The only difference internally is that some listeners (e.g. security) may only act upon the master request. Each listener is passed some sub-class of KernelEvent, whose isMasterRequest() can be used to check if the current request is a "master" or "sub" request. |