Application
The primary purpose of the web application and its runner in Yii 3 is to process requests to get responses.
Typically, the runtime consists of:
- Startup. Get config, create an instance of container and do additional environment initialization such as registering error handler, so it can handle errors occurring. Fire
ApplicationStartup
event. - Handle requests by passing request object to middleware dispatcher to execute middleware stack and get a response object. In usual PHP applications it's done once. In environments such as RoadRunner, it could be done multiple times with the same application instance. Response object is converted into an actual HTTP response by using emitter. Fire
AfterEmit
event. - Shutdown. Fire
ApplicationShutdown
event.