friendsofhyperf/http-request-lifecycle

The http request lifecycle component for Hyperf.

Fund package maintenance!
huangdijia
hdj.me/sponsors

Installs: 6 311

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

pkg:composer/friendsofhyperf/http-request-lifecycle


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 ]