mindplay/sapi-host 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mindplay/sapi-host

Composer 安装命令:

composer require mindplay/sapi-host

包简介

FCGI SAPI host for dispatch of PSR-15 Handler

README 文档

README

This library implements a SAPI host for dispatch of PSR-15 RequestHandlerInterface.

In a nutshell, this is a front-controller for the index.php file in a PSR-7/15/17 based project.

Originally a fork of Daniel Bannert's narrowspark/http-emitter package, this package takes a different approach, internally leveraging Tobias Nyholm's nyholm/psr7-server package to bootstrap the incoming PSR-7 Request.

The philosophy of this package is that hosting a single handler, for a single request, should be a single operation.

Usage

To bootstrap a SapiHost, you need to pick a PSR-7 and PSR-17 implementation - for example, nyholm/psr7-server supports both, and you can install it with:

composer require nyholm/psr7-server

You need to have your PSR-15 handler implementation to dispatch, and then, for example, dispatch it from an index.php file, as follows:

<?php

use mindplay\host\SapiHost;
use Nyholm\Psr7\Factory\Psr17Factory;

$factory = new Psr17Factory();

$host = new SapiHost(
    $factory,
    $factory,
    $factory,
    $factory
);

$host->dispatch(new YourRequestHandler());

Note that Psr17Factory implements all of the required PSR-17 factory interfaces.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固