friendsofhyperf/http-request-lifecycle

The http request lifecycle component for Hyperf.


README

Latest Stable Version Total Downloads License

The http request lifecycle component for Hyperf. This feature has been merged into the official repository (hyperf/http-server, #5715).

Installation

composer require friendsofhyperf/http-request-lifecycle

Usage

<?php
namespace App\Listener;

use FriendsOfHyperf\Http\RequestLifeCycle\Events\RequestHandled;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;

#[Listener]
class RequestHandledListener implements ListenerInterface
{
    public function listen(): array
    {
        return [
            RequestHandled::class,
        ];
    }

    /**
     * @param RequestHandled $event
     */
    public function process(object $event)
    {
        var_dump($event);
    }
}

Events

  • RequestReceived
  • RequestHandled
  • RequestTerminated

Sponsor

If you like this project, Buy me a cup of coffee. [ Alipay | WePay ]