Xys*_*sis 12 php error-handling laravel laravel-5
在Laravel 4中,很容易抑制E_NOTICE消息; 我似乎无法做到这一点,因为如果我添加
error_reporting(E_ALL ^ E_NOTICE)
Run Code Online (Sandbox Code Playgroud)
它只是被覆盖的任何地方.
这似乎发生在这里:(index.php)
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
Run Code Online (Sandbox Code Playgroud)
我添加了自定义代码来处理Exceptions/Handler.php中异常/错误的更多"漂亮"视图,但是我很难关闭通知(我不希望任何这些通知都会被通知)
在Laravel 5中,我们可以error_reporting(E_ALL ^ E_NOTICE)在AppServiceProviders::boot方法内部进行设置:
public function boot()
{
//set whatever level you want
error_reporting(E_ALL ^ E_NOTICE);
}
Run Code Online (Sandbox Code Playgroud)