PHPackages                             kodus/sapi-host - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. kodus/sapi-host

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

kodus/sapi-host
===============

FCGI SAPI host for dispatch of PSR-15 Handler

v0.6.0(7y ago)09↓100%1MITPHPPHP ^7.1

Since Apr 4Pushed 2y agoCompare

[ Source](https://github.com/kodus/sapi-host)[ Packagist](https://packagist.org/packages/kodus/sapi-host)[ RSS](/packages/kodus-sapi-host/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (8)Versions (19)Used By (0)

`kodus/sapi-host`
=================

[](#kodussapi-host)

Archived / Abandoned

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

**This project is work in progress.**

Originally a fork of [Daniel Bannert](https://github.com/prisis)'s [`narrowspark/http-emitter`](https://packagist.org/packages/narrowspark/http-emitter) package, this package takes a different approach, internally leveraging [Tobias Nyholm](https://github.com/Nyholm)'s [`nyholm/psr7-server`](https://packagist.org/packages/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
-----

[](#usage)

To bootstrap a `SapiHost`, you need to pick a [PSR-7](https://www.php-fig.org/psr/psr-7/) and [PSR-17](https://www.php-fig.org/psr/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](https://www.php-fig.org/psr/psr-15/) handler implementation to dispatch, and then, for example, dispatch it from an `index.php` file, as follows:

```
