go-wandering

php 异常处理

set_error_handler():捕获错误,受捕获Warning、Notice级别的限制
register_shutdown_function():捕获系统级E_ERROR、E_PARSE等错误
set_exception_handler():默认的异常处理程序

打印日志

\think\facade\Log::write();

打印sql

$model->getLastsql();

新建项目

composer create-project topthink/think tp  //拉取TP6
composer require topthink/think-multi-app  //需要开启多应用时加载

中间件middleware.php

\think\middleware\SessionInit::class    //开启session
\think\middleware\AllowCrossDomain::class  //允许跨域

分类:

技术点:

相关文章:

  • 2021-11-28
  • 2021-11-28
  • 2021-11-28
  • 2021-12-22
  • 2022-01-19
  • 2021-06-05
  • 2022-02-07
  • 2021-10-04
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-11-28
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案