App.php 646 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\common\behavior;
  3. use think\Log;
  4. use think\Request;
  5. /**
  6. * 应用行为管理
  7. * Class App
  8. * @package app\common\behavior
  9. */
  10. class App
  11. {
  12. /**
  13. * 应用开始
  14. * @param $dispatch
  15. */
  16. public function appBegin($dispatch)
  17. {
  18. // 记录访问日志
  19. if (!config('app_debug')) {
  20. $request = Request::instance();
  21. Log::record('[ ROUTE ] ' . var_export($dispatch, true), 'begin');
  22. Log::record('[ HEADER ] ' . var_export($request->header(), true), 'begin');
  23. Log::record('[ PARAM ] ' . var_export($request->param(), true), 'begin');
  24. }
  25. }
  26. }