-
Notifications
You must be signed in to change notification settings - Fork 0
process
Joe Huss edited this page Nov 10, 2022
·
1 revision
The flow of execution after executing php start.php start is as follows:
- Load configuration under config/
- Set Worker related configuration like
pid_filestdout_filelog_filemax_package_sizeetc. - Create webman process and listen to the port (default8787)
- Create custom process based on configuration
- webmanThe following logic is executed after the process and custom processes start (the following are executed in onWorkerStart)):
① Load the file set in
config/autoload.php, e.g.app/functions.php② loadconfig/middleware.php(includeconfig/plugin/*/*/middleware.php)middleware set in ③ Executeconfig/bootstrap.php(includeconfig/plugin/*/*/bootstrap.php)Modify in filestartMethod,Used to initialize some modules,for exampleLaravelDatabase initialization connection ④ loadconfig/route.php(includeconfig/plugin/*/*/route.php)Methods will not be checked
- Determine if the request url corresponds to a static file under public, if so return the file (end of request), if not enter2
- Determine if a route is hit based on the url, no hit into 3, hit into4
- Is the default route turned off, if yes return 404 (end request), if not enter4
- Find the middleware that requests the corresponding controller,performs middleware predecessor operations in order(Onion Model Request Phase),Execute controller business logic,Perform middleware post-operation(Onion Model Response Phase),So it is。(in referenceDevelopment of high performance)