Skip to content

Latest commit

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

README

This library is an effective FastCGI to PSR-7 adapter.

Install

composer require garveen/fastcgi

Usage

useGarveen\FastCgi\FastCgi;
usePsr\Http\Message\ServerRequestInterface;
// First of all, define 3 callbacks// When a request is ready, this library will call $requestCallback:$requestCallback = function (ServerRequestInterface$serverRequest) {
// Do something...// And the response must be instance of Psr\Http\Message\ResponseInterface// This library provides Garveen\FastCgi\ResponsereturnnewResponse;
};
// After this library got the response, $sendCallback will be called:$sendCallback = function (int$fd, string$data) {
// send $data to downstreamfwrite($downstreams[$fd], $data);
};
// At the end, if keepalive is not set, there will be $closeCallback:$closeCallback = function (int$fd) {
fclose($downstreams[$fd]);
};
// The instance$fastcgi = newFastCgi($requestCallback, $sendCallback, $closeCallback, $logger);
// Once you have recevied a FastCGI network-package, just pass it to the instance:$fastcgi->receive(int $fd, string $data);

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages