[laravel源码]Bootstrap\HandleExceptions.php解析
说明
本章节说明框架默认引导文件之一HandleExceptions.php
所涉及的流程。
源码
public function bootstrap(Application $app)
{
$this->app = $app;
// 1. 报告所有错误
error_reporting(-1);
// 2. 设置错误处理函数
set_error_handler([$this, 'handleError']);
// 3. 设置异常处理函数
set_exception_handler([$this, 'handleException']);
// 4. 注册在关闭时执行的函数(脚本执行完或exit()后调用)
register_shutdown_function([$this, 'handleShutdown']);
// 5. 配置测试
if (! $app->environment('testing')) {
ini_set('display_errors', 'Off');
}
}
分析
本作品采用《CC 协议》,转载必须注明作者和本文链接