Easyswoole provides Whoops drivers for the development phase to friendly eliminate errors and exceptions in HTTP business.

Don't use it in production phase, otherwise EasySwoole will not be responsible for code leakage!!!


composer require easyswoole/easy-whoops=3.x


Register directly in EasySwoole global events

use EasySwoole\EasySwoole\Swoole\EventRegister;
use EasySwoole\EasySwoole\AbstractInterface\Event;
use EasySwoole\Http\Request;
use EasySwoole\Http\Response;
use EasySwoole\Whoops\Handler\CallbackHandler;
use EasySwoole\Whoops\Handler\PrettyPageHandler;
use EasySwoole\Whoops\Run;

class EasySwooleEvent implements Event

    public static function initialize()
        // TODO: Implement initialize() method.
        $whoops = new Run();
        $whoops->pushHandler(new PrettyPageHandler);  // Output a beautiful page
        $whoops->pushHandler(new CallbackHandler(function ($exception, $inspector, $run, $handle) {
            // Multiple Handles can be pushed forward to support callbacks for more follow-up processing

    public static function mainServerCreate(EventRegister $register)


    public static function onRequest(Request $request, Response $response): bool
        //Interception request
        Run::attachRequest($request, $response);
        return true;

    public static function afterRequest(Request $request, Response $response): void
        // TODO: Implement afterAction() method.

0 results matching ""

    No results matching ""