friendsofhyperf / http-request-lifecycle

[READ-ONLY]The http request lifecycle component for Hyperf.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Http Request LifeCycle

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 ]

About

[READ-ONLY]The http request lifecycle component for Hyperf.

License:MIT License


Languages

Language:PHP 100.0%