定制 garveen/fastcgi 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

garveen/fastcgi

Composer 安装命令:

composer require garveen/fastcgi

包简介

An effective FastCGI to psr-7 adapter

README 文档

README

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

Install

composer require garveen/fastcgi

Usage

use Garveen\FastCgi\FastCgi;
use Psr\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\Response
	return new Response;
};

// After this library got the response, $sendCallback will be called:
$sendCallback = function (int $fd, string $data) {
	// send $data to downstream
	fwrite($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 = new FastCgi($requestCallback, $sendCallback, $closeCallback, $logger);

// Once you have recevied a FastCGI network-package, just pass it to the instance:
$fastcgi->receive(int $fd, string $data);

统计信息

  • 总下载量: 7.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 8
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固