Home  >  Article  >  Backend Development  >  What is whoops in php?

What is whoops in php?

一个新手
一个新手Original
2017-10-02 19:42:483341browse

What is whoops in php?

What is whoops?

Whoops is a good PHP error handling library. It provides a very nice error interface to help you debug web projects, but essentially it is a simple yet powerful stacked error handling system.

Features

Flexible, stack-based error handling

Separate library, no required dependencies (currently)

Simple API for handling exceptions, tracking frames and their data

Includes a pretty nice error page for your webapp project

Includes opening directly in editors and IDEs Features for referenced files

Includes handlers for different response formats (JSON, XML, SOAP)

Easy to extend and integrate with existing libraries

Clean, well-structured, and tested Passed code library

Whoops is an error capture and debugging PHP library suitable for PHP environments; whoops is very easy to use, it provides stackbased error capture and super-beautiful error viewing

Test effects As follows

Installation steps (composer installation)

After the installation is completed, create a new directory tools in the current directory, in the tools directory Create a new whoops.php and add the following code to register the monitoring class

require __DIR__."/../vendor/autoload.php";
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();
然后就可以测试了,代码如下,测试效果图如上

For more related knowledge, please visit PHP Chinese website! !

The above is the detailed content of What is whoops in php?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn