webman icon indicating copy to clipboard operation
webman copied to clipboard

新版本的 Handler.php 现在是在哪个目录下呢?

Open mouyong opened this issue 3 years ago • 4 comments

https://github.com/walkor/webman/blob/8e93d319ffe4cfb41bc916d3ac8f8c124f2ca802/config/exception.php#L16

mouyong avatar Mar 18 '22 03:03 mouyong

在新版本中,这部分需要调整,以便于适配。这里的调整有比较好的建议吗?

https://github.com/mouyong/php-support/blob/master/README.md?plain=1#L26

mouyong avatar Mar 18 '22 03:03 mouyong

新版的目录找到了,在 webman-framework 的目录下:https://github.com/walkor/webman-framework/blob/master/src/support/exception/Handler.php

通过 composer.json 配置了 psr-4 加载规范:https://github.com/walkor/webman-framework/blob/master/composer.json#L37-L42

mouyong avatar Mar 18 '22 03:03 mouyong

Hello, I am having the same problem, my Handler.php in "support\exception" is not being called

juanfelipepipen avatar Mar 18 '22 18:03 juanfelipepipen

我是自己继承了webman的 ExceptionHandler 不使用vender 下面的

namespace App\handler; use Webman\Exception\ExceptionHandler; class Handler extends ExceptionHandler{ public function report(Throwable $exception) { parent::report($exception); }

public function render(Request $request, Throwable $exception): Response
{
  .....
 return json();
 }

}

Bigweixi avatar Apr 26 '22 03:04 Bigweixi