Zendframework application 引导过程

Applications 会期望用户提供一个配置好的ServiceManager。提供以下服务:

1、EventManager

2、ModuleManager

3、Request

4、Response

5、 RouteListener

6、Router

7、DispatchListener

8、MiddlewareListener

9、ViewManager

使用配置好的ServiceManager创建一个Application对象,在构造函数里提供事件。然后调用bootstrap()方法

关于bootstrap()方法:合并监听器,将监听器和事件绑定。设置MVC Event,传入request、response、router,然后触发事件。返回的是Application对象自身。

然后我们就可以运行application了,调用run()方法:触发路由事件,触发调度事件,完成应答。

原文地址:https://www.cnblogs.com/san-fu-su/p/5690258.html