laravel 主流程 发表于 2019-05-06 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768st=>start: index.php入口e=>end: 结束define_start_time=>operation: 定义开始运行时间LARAVEL_STARTautoload=>operation: composer自动加载load_app=>condition: 框架载入instance_application=>condition: 实例化容器Application::__constructapp_base_binding=>operation: 容器自绑定app_base_provider=>operation: 容器基础provider注册Route/Log/Eventapp_base_alias=>operation: 容器核心别名定义bind_base_kernel=>operation: 单例绑定容器核心服务HttpKernelConsoleKernelExceptionsHandlermake_http_kernel=>operation: 实例化http处理器capture_http=>operation: 捕获http请求kernel_handle_request=>condition: http处理器处理请求bootstrap=>condition: 容器启动bootstrap_app=>operation: 加载环境变量配置加载配置文件注册异常handler注册Facades注册应用providers启动应用proveidercommon_middleware=>condition: 全局中间件过滤dispatch_route=>operation: 解析路由match_route=>operation: 匹配路由instance_controller=>operation: 实例化控制器route_middleware=>condition: 路由中间件过滤call_action=>operation: callAction引导执行控制器方法run_action=>operation: 执行控制器common_middleware_item=>operation: 全局中间件详情up&down检查post包大小检查空格过滤空数据转化为null代理设置web_route_middleware_item=>operation: 路由中间件详情cookie加密解密cookie设置start sessionError闪存至sessioncsrf验证路由模型绑定监听send_response=>operation: 发送响应kernel_terminate=>operation: http处理器运行后台任务st->define_start_time->autoload->load_appload_app(yes,right)->instance_applicationload_app(no,)->make_http_kernel->capture_http->kernel_handle_requestinstance_application(no)->bind_base_kernel(left)->make_http_kernelinstance_application(yes, right)->app_base_binding->app_base_provider->app_base_alias(left)->bind_base_kernelkernel_handle_request(no)->send_response->kernel_terminate->ekernel_handle_request(yes, right)->bootstrapbootstrap(no)->common_middlewarebootstrap(yes, right)->bootstrap_appcommon_middleware(no)->dispatch_route->match_route->instance_controller->route_middlewarecommon_middleware(yes, right)->common_middleware_itemroute_middleware(no)->call_action->run_action(left)->send_responseroute_middleware(yes, right)->web_route_middleware_item