Download the PHP package chubbyphp/chubbyphp-swoole-request-handler without Composer

On this page you can find all versions of the php package chubbyphp/chubbyphp-swoole-request-handler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chubbyphp-swoole-request-handler

chubbyphp-swoole-request-handler

CI Coverage Status Mutation testing badge Latest Stable Version Total Downloads Monthly Downloads

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities

Description

A request handler adapter for swoole, using PSR-7, PSR-15 and PSR-17.

It turns a swoole HTTP Server into a runtime for any PSR-15 request handler: each incoming swoole request is converted into a PSR-7 server request through PSR-17 factories, handed to your application, and the returned PSR-7 response is sent back through the swoole response.

Because swoole is a long-running process, your application is bootstrapped once per worker process and then serves many requests. This removes the per-request bootstrap cost of a classic PHP-FPM setup.

Requirements

Suggest

Any PSR-7 / PSR-17 implementation can be used, for example:

Installation

Through Composer as chubbyphp/chubbyphp-swoole-request-handler.

The examples below use slim/psr7 as the PSR-7 / PSR-17 implementation:

Usage

Basic server

Create a server.php and start it with php server.php:

Components

The package consists of three small, replaceable parts. Each one has an interface, so you can swap in your own implementation where the defaults don't fit.

Class Interface Responsibility
OnRequest OnRequestInterface Swoole request callback: builds the PSR-7 request, calls the PSR-15 handler and emits the response.
PsrRequestFactory PsrRequestFactoryInterface Converts a swoole request into a PSR-7 server request via the given PSR-17 factories.
SwooleResponseEmitter SwooleResponseEmitterInterface Converts a PSR-7 response into a swoole response and sends it to the client.

PsrRequestFactory maps the following data:

SwooleResponseEmitter maps the following data:

Long-running process caveats

Swoole keeps the PHP process alive between requests, which differs from PHP-FPM:

With Blackfire

BlackfireOnRequestAdapter wraps an OnRequestInterface and profiles a request whenever the X-Blackfire-Query header is present, for example when triggered by the Blackfire browser extension or the blackfire curl command. Requests without that header pass through untouched. The probe is always ended, even if the wrapped handler throws.

Requires the blackfire extension and the blackfire/php-sdk package.

With New Relic

NewRelicOnRequestAdapter wraps an OnRequestInterface and starts a New Relic transaction for every request. The transaction is always ended, even if the wrapped handler throws, so each request is reported separately instead of as one endless transaction per worker process.

Requires the newrelic extension.

Both adapters implement OnRequestInterface, so they can be combined by nesting them.

Copyright

2026 Dominik Zogg


All versions of chubbyphp-swoole-request-handler with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-swoole Version ^5.1.8|^6.1.9
dflydev/fig-cookies Version ^3.2
psr/http-factory Version ^1.1
psr/http-message Version ^1.1|^2.0
psr/http-server-handler Version ^1.0.2
psr/log Version ^2.0|^3.0.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chubbyphp/chubbyphp-swoole-request-handler contains the following files

Loading the files please wait ...